Loading repl/command.go +1 −0 Original line number Diff line number Diff line Loading @@ -1343,6 +1343,7 @@ If -1 is specified, messages will become permanent.`, Specifies the folder for which the default expire is to modified. If not specified, the system default expire is modified.`, OptArg: true, }, }, }, Loading repl/set.go +12 −4 Original line number Diff line number Diff line Loading @@ -193,11 +193,19 @@ func setExpire(cmd *dclish.Command, expire func(context.Context, int64) error) e // ActionSetDefaultExpire handles the `SET DEFAULT_EXPIRE` command. func ActionSetDefaultExpire(cmd *dclish.Command) error { folderName := cmd.Flags["/ALL"].Value if folderName == "" { if !cmd.Flags["/FOLDER"].Set { return setExpire(cmd, this.Q.UpdateDefaultExpire) } isOwner, err := folders.IsFolderOwner(folderName, this.User.Login) folder, err := folders.FindFolder(cmd.Flags["/FOLDER"].Value) if err != nil { return err } if folder.Name == "" { fmt.Println("ERROR: Folder not found.") return nil } isOwner, err := folders.IsFolderOwner(folder.Name, this.User.Login) if err != nil { return err } Loading @@ -209,7 +217,7 @@ func ActionSetDefaultExpire(cmd *dclish.Command) error { return err } ctx := storage.Context() return this.Q.UpdateFolderExpire(ctx, value, folderName) return this.Q.UpdateFolderExpire(ctx, value, folder.Name) } // ActionSetExpireLimit handles the `SET EXPIRE_LIMIT` command. Loading Loading
repl/command.go +1 −0 Original line number Diff line number Diff line Loading @@ -1343,6 +1343,7 @@ If -1 is specified, messages will become permanent.`, Specifies the folder for which the default expire is to modified. If not specified, the system default expire is modified.`, OptArg: true, }, }, }, Loading
repl/set.go +12 −4 Original line number Diff line number Diff line Loading @@ -193,11 +193,19 @@ func setExpire(cmd *dclish.Command, expire func(context.Context, int64) error) e // ActionSetDefaultExpire handles the `SET DEFAULT_EXPIRE` command. func ActionSetDefaultExpire(cmd *dclish.Command) error { folderName := cmd.Flags["/ALL"].Value if folderName == "" { if !cmd.Flags["/FOLDER"].Set { return setExpire(cmd, this.Q.UpdateDefaultExpire) } isOwner, err := folders.IsFolderOwner(folderName, this.User.Login) folder, err := folders.FindFolder(cmd.Flags["/FOLDER"].Value) if err != nil { return err } if folder.Name == "" { fmt.Println("ERROR: Folder not found.") return nil } isOwner, err := folders.IsFolderOwner(folder.Name, this.User.Login) if err != nil { return err } Loading @@ -209,7 +217,7 @@ func ActionSetDefaultExpire(cmd *dclish.Command) error { return err } ctx := storage.Context() return this.Q.UpdateFolderExpire(ctx, value, folderName) return this.Q.UpdateFolderExpire(ctx, value, folder.Name) } // ActionSetExpireLimit handles the `SET EXPIRE_LIMIT` command. Loading