forked from Silverfish/proton-bridge
GODT-1741: GUI and CLI settings to change visibility of All Mail folder.
This commit is contained in:
@ -137,6 +137,23 @@ func New( //nolint:funlen
|
||||
})
|
||||
fe.AddCmd(dohCmd)
|
||||
|
||||
// All mail visibility commands.
|
||||
allMailCmd := &ishell.Cmd{
|
||||
Name: "all-mail-visibility",
|
||||
Help: "choose not to list the All Mail folder in your local client",
|
||||
}
|
||||
allMailCmd.AddCmd(&ishell.Cmd{
|
||||
Name: "disable",
|
||||
Help: "All Mail folder will not be listed in your local client",
|
||||
Func: fe.disableAllMail,
|
||||
})
|
||||
allMailCmd.AddCmd(&ishell.Cmd{
|
||||
Name: "enable",
|
||||
Help: "All Mail folder will be listed in your local client",
|
||||
Func: fe.enableAllMail,
|
||||
})
|
||||
fe.AddCmd(allMailCmd)
|
||||
|
||||
// Cache-On-Disk commands.
|
||||
codCmd := &ishell.Cmd{
|
||||
Name: "local-cache",
|
||||
|
||||
@ -152,6 +152,32 @@ func (f *frontendCLI) disallowProxy(c *ishell.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *frontendCLI) disableAllMail(c *ishell.Context) {
|
||||
if !f.bridge.IsAllMailVisible() {
|
||||
f.Println("All Mail folder is not listed in your local client.")
|
||||
return
|
||||
}
|
||||
|
||||
f.Println("All Mail folder is listed in your client right now.")
|
||||
|
||||
if f.yesNoQuestion("Do you want to hide All Mail folder") {
|
||||
f.bridge.SetIsAllMailVisible(false)
|
||||
}
|
||||
}
|
||||
|
||||
func (f *frontendCLI) enableAllMail(c *ishell.Context) {
|
||||
if f.bridge.IsAllMailVisible() {
|
||||
f.Println("All Mail folder is listed in your local client.")
|
||||
return
|
||||
}
|
||||
|
||||
f.Println("All Mail folder is not listed in your client right now.")
|
||||
|
||||
if f.yesNoQuestion("Do you want to show All Mail folder") {
|
||||
f.bridge.SetIsAllMailVisible(true)
|
||||
}
|
||||
}
|
||||
|
||||
func (f *frontendCLI) enableCacheOnDisk(c *ishell.Context) {
|
||||
if f.settings.GetBool(settings.CacheEnabledKey) {
|
||||
f.Println("The local cache is already enabled.")
|
||||
|
||||
Reference in New Issue
Block a user