Unverified Commit 9fca0a4a authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Add completer; remove notify

parent f93c53c5
Loading
Loading
Loading
Loading
+3 −49
Original line number Diff line number Diff line
@@ -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,
+0 −3
Original line number Diff line number Diff line
@@ -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
	}
+0 −22
Original line number Diff line number Diff line
@@ -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()
+0 −7
Original line number Diff line number Diff line
@@ -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)))
+1 −2
Original line number Diff line number Diff line
@@ -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)
Loading