aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview/toggle-headers.go
blob: 201fce90d5e3a13e853aa40beb7dddbf51e5c1d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package msgview

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

type ToggleHeaders struct{}

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

func (ToggleHeaders) Context() commands.CommandContext {
	return commands.MESSAGE_VIEWER
}

func (ToggleHeaders) Aliases() []string {
	return []string{"toggle-headers"}
}

func (ToggleHeaders) Execute(args []string) error {
	mv, _ := app.SelectedTabContent().(*app.MessageViewer)
	mv.ToggleHeaders()
	return nil
}