Debian Codegraph @

commands/msg/toggle-thread-context.go

raw
1 package msg
2
3 import (
4 "git.sr.ht/~rjarry/aerc/commands"
5 "git.sr.ht/~rjarry/aerc/lib/ui"
6 )
7
8 type ToggleThreadContext struct{}
9
10 func init() {
11 commands.Register(ToggleThreadContext{})
12 }
13
14 func (ToggleThreadContext) Description() string {
15 return "Show/hide message thread context."
16 }
17
18 func (ToggleThreadContext) Context() commands.CommandContext {
19 return commands.MESSAGE_LIST | commands.MESSAGE_VIEWER
20 }
21
22 func (ToggleThreadContext) Aliases() []string {
23 return []string{"toggle-thread-context"}
24 }
25
26 func (ToggleThreadContext) Execute(args []string) error {
27 h := newHelper()
28 store, err := h.store()
29 if err != nil {
30 return err
31 }
32 store.ToggleThreadContext()
33 ui.Invalidate()
34 return nil
35 }