diff --git a/repl/command.go b/repl/command.go index 3740e46cf11700afa029f8089064af2d4bc39f45..ecfff20d048f2db9c7935c748514d2ccbdb5a89e 100644 --- a/repl/command.go +++ b/repl/command.go @@ -270,11 +270,6 @@ BULLCOM.CLD.`, OptArg: true, Default: "14", }, - "/NOTIFY": { - Description: ` Specifies that all users automatically have NOTIFY set for this - folder. Only a privileged user can use this qualifier. (See HELP SET - NOTIFY for more information.)`, - }, "/OWNER": { Description: `/OWNER=username @@ -1136,9 +1131,8 @@ The following options are available: ACCESS ALWAYS BRIEF DEFAULT_EXPIRE EXPIRE_LIMIT FOLDER NOALWAYS NOBRIEF - NONOTIFY NOPROMPT_EXPIRE NOREADNEW NOSHOWNEW - NOSYSTEM NOTIFY PROMPT_EXPIRE READNEW - SHOWNEW SYSTEM + NOPROMPT_EXPIRE NOREADNEW NOSHOWNEW NOSYSTEM + PROMPT_EXPIRE READNEW SHOWNEW SYSTEM `, Action: ActionSet, Commands: dclish.Commands{ @@ -1318,46 +1312,6 @@ on that command for more information. }, }, }, - "NOTIFY": { - Description: `Specifies whether you will be notified via a broadcast message when a -message is added to the selected folder. - - Format: - SET NOTIFY - -In a cluster, if the logical name MAIL$SYSTEM_FLAGS is defined so that -bit 1 is set, users will be notified no matter which node they are logged -in to. If you wish to disable this, you should define BULL_SYSTEM_FLAGS -so that bit 1 is cleared.`, - Action: ActionSetNotify, - Flags: dclish.Flags{ - "/ALL": { - Description: ` Specifies that the SET NOTIFY option is the default for all users for - the specified folder. This is a privileged qualifier.`, - }, - "/DEFAULT": { - Description: ` Specifies that the NOTIFY option is the default for the specified - folder. This is a privileged qualifier. It will only affect brand new - users (or those that have never logged in). Use /ALL to modify all - users.`, - }, - "/PERMANENT": { - Description: `/[NO]PERMANENT - - Specifies that NOTIFY is a permanent flag and cannot be changed by - the individual. /DEFAULT must be specified. This is a privileged - qualifier.`, - }, - }, - }, - "NONOTIFY": { - Description: `Removes notification from the current folder or optional folder-name. - - Format: - SET NONOTIFY [folder-name]`, - Action: ActionSetNonotify, - MaxArgs: 1, - }, "PROMPT_EXPIRE": { Description: `Specifies that a user will be prompted for an expiration date when adding a message. If the value specified is greater than the expiration @@ -1528,7 +1482,7 @@ The following options are available: Action: ActionShow, Commands: dclish.Commands{ "FLAGS": { - Description: `Shows whether BRIEF, NOTIFY, READNEW, or SHOWNEW has been set for the + Description: `Shows whether BRIEF, READNEW, or SHOWNEW has been set for the currently selected folder. `, Action: ActionShowFlags, diff --git a/repl/folders.go b/repl/folders.go index 5b0631b375a7ba13c075c1f717e911ad83daade2..4e5fe8d9e6c8c872ee19017950ebbbd64f0ede53 100644 --- a/repl/folders.go +++ b/repl/folders.go @@ -62,9 +62,6 @@ func ActionCreate(cmd *dclish.Command) error { if cmd.Flags["/DESCRIPTION"].Value != "" { options.Description = cmd.Flags["/DESCRIPTION"].Value } - if cmd.Flags["/NOTIFY"].Value == "true" { - options.Notify = 1 - } if cmd.Flags["/READNEW"].Value == "true" { options.Alert = 2 } diff --git a/repl/set.go b/repl/set.go index 5222acb160cd714a5e28f39bc9f9db9437f04b7e..dc094688498f800d932b6cada4598376fe43a1ea 100644 --- a/repl/set.go +++ b/repl/set.go @@ -122,28 +122,6 @@ func ActionSetExpireLimit(cmd *dclish.Command) error { return this.Q.UpdateExpireLimit(ctx, value) } -// ActionSetNotify handles the `SET NOTIFY` command. -func ActionSetNotify(_ *dclish.Command) error { - // TODO: parse flags and args. - ctx := storage.Context() - this.Q.UpdateFolderNotify(ctx, storage.UpdateFolderNotifyParams{ - Notify: 1, - Name: this.Folder.Name, - }) - return nil -} - -// ActionSetNonotify handles the `SET NONOTIFY` command. -func ActionSetNonotify(_ *dclish.Command) error { - // TODO: parse flags and args. - ctx := storage.Context() - this.Q.UpdateFolderNotify(ctx, storage.UpdateFolderNotifyParams{ - Notify: 0, - Name: this.Folder.Name, - }) - return nil -} - // ActionSetPromptExpire handles the `SET PROMPT_EXPIRE` command. func ActionSetPromptExpire(_ *dclish.Command) error { ctx := storage.Context() diff --git a/repl/show.go b/repl/show.go index 00de916bb5588c0a7c7dd39949e9187e16f38d6f..d4a6b00aedede0bd6f40cf410c6a043a0c991e28 100644 --- a/repl/show.go +++ b/repl/show.go @@ -24,10 +24,6 @@ func ActionShow(cmd *dclish.Command) error { func ActionShowFlags(_ *dclish.Command) error { flagset := false fmt.Printf("For the selected folder %s:\n", this.Folder.Name) - if this.Folder.Notify != 0 { - fmt.Println(" NOTIFY is set.") - flagset = true - } if this.Folder.Alert != 0 { fmt.Printf(" %s is set.\n", strings.ToUpper(storage.AlertString(this.Folder.Alert))) @@ -83,9 +79,6 @@ func ActionShowFolder(cmd *dclish.Command) error { if folder.Always != 0 { fmt.Println(" ALWAYS has been set.") } - if this.Folder.Notify != 0 { - fmt.Println(" Default is NOTIFY.") - } if this.Folder.Alert != 0 { fmt.Printf(" %s is set.\n", strings.ToUpper(storage.AlertString(this.Folder.Alert))) diff --git a/storage/display.go b/storage/display.go index 680e034e15a85f06a1771a48c24c3b7ff8a353bd..a1edaecf4919651f10b3ebabccc4ce3acbad4342 100644 --- a/storage/display.go +++ b/storage/display.go @@ -116,12 +116,11 @@ func (u User) String() string { // String displays a folder (mainly used for debugging). func (f Folder) String() string { - return fmt.Sprintf("Folder %s (%s) [a%d, !<%s>, n%d, sys%d, exp%d, v%d]", + return fmt.Sprintf("Folder %s (%s) [a%d, !<%s>, sys%d, exp%d, v%d]", f.Name, f.Description, f.Always, FolderAlertString(f.Alert), - f.Notify, f.System, f.Expire, f.Visibility) diff --git a/storage/folders.sql.go b/storage/folders.sql.go index 374acf42f9e5c00cdba2000f70d82f9c80d8ff0f..98722dabe26e97740d2f1099af6e3960542b74fd 100644 --- a/storage/folders.sql.go +++ b/storage/folders.sql.go @@ -11,9 +11,9 @@ import ( const createFolder = `-- name: CreateFolder :exec INSERT INTO folders - (name, always, alert, description, owner, notify, system, expire, visibility) + (name, always, alert, description, owner, system, expire, visibility) VALUES - (?, ?, ?, ?, ?, ?, ?, ?, ?) + (?, ?, ?, ?, ?, ?, ?, ?) ` type CreateFolderParams struct { @@ -22,7 +22,6 @@ type CreateFolderParams struct { Alert int64 Description string Owner string - Notify int64 System int64 Expire int64 Visibility int64 @@ -35,7 +34,6 @@ func (q *Queries) CreateFolder(ctx context.Context, arg CreateFolderParams) erro arg.Alert, arg.Description, arg.Owner, - arg.Notify, arg.System, arg.Expire, arg.Visibility, @@ -44,7 +42,7 @@ func (q *Queries) CreateFolder(ctx context.Context, arg CreateFolderParams) erro } const findFolderExact = `-- name: FindFolderExact :one -SELECT name, "always", alert, description, owner, notify, system, expire, visibility, create_at, update_at FROM folders where name = ? +SELECT name, "always", alert, description, owner, system, expire, visibility, create_at, update_at FROM folders where name = ? ` func (q *Queries) FindFolderExact(ctx context.Context, name string) (Folder, error) { @@ -56,7 +54,6 @@ func (q *Queries) FindFolderExact(ctx context.Context, name string) (Folder, err &i.Alert, &i.Description, &i.Owner, - &i.Notify, &i.System, &i.Expire, &i.Visibility, @@ -67,7 +64,7 @@ func (q *Queries) FindFolderExact(ctx context.Context, name string) (Folder, err } const findFolderPrefix = `-- name: FindFolderPrefix :one -SELECT name, "always", alert, description, owner, notify, system, expire, visibility, create_at, update_at FROM folders where name LIKE ? +SELECT name, "always", alert, description, owner, system, expire, visibility, create_at, update_at FROM folders where name LIKE ? ORDER BY name LIMIT 1 ` @@ -81,7 +78,6 @@ func (q *Queries) FindFolderPrefix(ctx context.Context, name string) (Folder, er &i.Alert, &i.Description, &i.Owner, - &i.Notify, &i.System, &i.Expire, &i.Visibility, @@ -285,20 +281,6 @@ func (q *Queries) UpdateFolderMain(ctx context.Context, arg UpdateFolderMainPara return err } -const updateFolderNotify = `-- name: UpdateFolderNotify :exec -UPDATE folders SET notify = ? WHERE name = ? -` - -type UpdateFolderNotifyParams struct { - Notify int64 - Name string -} - -func (q *Queries) UpdateFolderNotify(ctx context.Context, arg UpdateFolderNotifyParams) error { - _, err := q.db.ExecContext(ctx, updateFolderNotify, arg.Notify, arg.Name) - return err -} - const updateFolderSystem = `-- name: UpdateFolderSystem :exec UPDATE folders SET system = ? WHERE name = ? ` diff --git a/storage/migrations/1_create_table.up.sql b/storage/migrations/1_create_table.up.sql index df9ce8eb761ee58697940df387b1883ae72cd629..e81b14847c4291f4f1a2a05330cd71f046e8ef97 100644 --- a/storage/migrations/1_create_table.up.sql +++ b/storage/migrations/1_create_table.up.sql @@ -40,7 +40,6 @@ CREATE TABLE folders ( alert INT DEFAULT 1 NOT NULL, description VARCHAR(53) DEFAULT 0 NOT NULL, owner VARCHAR(12) NOT NULL, - notify INT DEFAULT 0 NOT NULL, system INT DEFAULT 0 NOT NULL, expire INT DEFAULT 14 NOT NULL, --- public=0, semiprivate=1, private=2 diff --git a/storage/models.go b/storage/models.go index 3efeab40d1a24d55a02cd8bc061be10cb6f1e4dd..fd2c0cddcdf5ec49d091aeec0a36c4a81b03708a 100644 --- a/storage/models.go +++ b/storage/models.go @@ -21,7 +21,6 @@ type Folder struct { Alert int64 Description string Owner string - Notify int64 System int64 Expire int64 Visibility int64 diff --git a/storage/queries/folders.sql b/storage/queries/folders.sql index 881979d658165a7db68b6985a849857d25218d99..7f965c5a67d3710bbbe92ee6e775b508b253dd1a 100644 --- a/storage/queries/folders.sql +++ b/storage/queries/folders.sql @@ -1,8 +1,8 @@ -- name: CreateFolder :exec INSERT INTO folders - (name, always, alert, description, owner, notify, system, expire, visibility) + (name, always, alert, description, owner, system, expire, visibility) VALUES - (?, ?, ?, ?, ?, ?, ?, ?, ?); + (?, ?, ?, ?, ?, ?, ?, ?); -- name: ListFolderForAdmin :many SELECT f.name, count(m.id) as count, f.description @@ -45,9 +45,6 @@ UPDATE folders SET system = ? WHERE name = ?; -- name: UpdateFolderAlert :exec UPDATE folders SET alert = ? WHERE name = ?; --- name: UpdateFolderNotify :exec -UPDATE folders SET notify = ? WHERE name = ?; - -- name: UpdateFolderVisibility :exec UPDATE folders SET visibility = ? WHERE name = ?; diff --git a/storage/standard.sql.go b/storage/standard.sql.go index 56080b80dec3527a67893c9b0bcc3b6a81f4567a..47ad5d41b7fa94c3ae4566384091d7fe3539c55c 100644 --- a/storage/standard.sql.go +++ b/storage/standard.sql.go @@ -181,7 +181,7 @@ func (q *Queries) DeleteUser(ctx context.Context, login string) error { } const getFolder = `-- name: GetFolder :one -SELECT name, "always", alert, description, owner, notify, system, expire, visibility, create_at, update_at FROM folders WHERE name = ? +SELECT name, "always", alert, description, owner, system, expire, visibility, create_at, update_at FROM folders WHERE name = ? ` func (q *Queries) GetFolder(ctx context.Context, name string) (Folder, error) { @@ -193,7 +193,6 @@ func (q *Queries) GetFolder(ctx context.Context, name string) (Folder, error) { &i.Alert, &i.Description, &i.Owner, - &i.Notify, &i.System, &i.Expire, &i.Visibility, @@ -378,7 +377,7 @@ func (q *Queries) ListFolderConfig(ctx context.Context) ([]FolderConfig, error) } const listFolders = `-- name: ListFolders :many -SELECT name, "always", alert, description, owner, notify, system, expire, visibility, create_at, update_at FROM folders +SELECT name, "always", alert, description, owner, system, expire, visibility, create_at, update_at FROM folders ` func (q *Queries) ListFolders(ctx context.Context) ([]Folder, error) { @@ -396,7 +395,6 @@ func (q *Queries) ListFolders(ctx context.Context) ([]Folder, error) { &i.Alert, &i.Description, &i.Owner, - &i.Notify, &i.System, &i.Expire, &i.Visibility,