aboutsummaryrefslogblamecommitdiffstats
path: root/commands/msg/toggle-thread-context.go
blob: 83dc87bdc1ce7c3aaba61950d88676bfcea774b1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


           
                                         
                                       




                                 



                                                              
                                                              





                                                
                                                         
                        







                                   
package msg

import (
	"git.sr.ht/~rjarry/aerc/commands"
	"git.sr.ht/~rjarry/aerc/lib/ui"
)

type ToggleThreadContext struct{}

func init() {
	commands.Register(ToggleThreadContext{})
}

func (ToggleThreadContext) Context() commands.CommandContext {
	return commands.MESSAGE_LIST | commands.MESSAGE_VIEWER
}

func (ToggleThreadContext) Aliases() []string {
	return []string{"toggle-thread-context"}
}

func (ToggleThreadContext) Execute(args []string) error {
	h := newHelper()
	store, err := h.store()
	if err != nil {
		return err
	}
	store.ToggleThreadContext()
	ui.Invalidate()
	return nil
}