messages.go

 1package tui
 2
 3import "github.com/andrinoff/email-cli/fetcher"
 4
 5type ViewEmailMsg struct {
 6	Index int
 7}
 8
 9type SendEmailMsg struct {
10	To             string
11	Subject        string
12	Body           string
13	AttachmentPath string
14	InReplyTo      string
15	References     []string
16}
17
18type Credentials struct {
19	Provider string
20	Name     string
21	Email    string
22	Password string
23}
24
25type ChooseServiceMsg struct {
26	Service string
27}
28
29type EmailResultMsg struct {
30	Err error
31}
32
33type ClearStatusMsg struct{}
34
35type EmailsFetchedMsg struct {
36	Emails []fetcher.Email
37}
38
39type FetchErr error
40
41type GoToInboxMsg struct{}
42
43type GoToSendMsg struct {
44	To      string
45	Subject string
46	Body    string
47}
48
49type GoToSettingsMsg struct{}
50
51type FetchMoreEmailsMsg struct {
52	Offset uint32
53}
54
55type FetchingMoreEmailsMsg struct{}
56
57type EmailsAppendedMsg struct {
58	Emails []fetcher.Email
59}
60
61type ReplyToEmailMsg struct {
62	Email fetcher.Email
63}
64
65type SetComposerCursorToStartMsg struct{}
66
67type GoToFilePickerMsg struct{}
68
69type FileSelectedMsg struct {
70	Path string
71}
72
73type CancelFilePickerMsg struct{}
74
75// --- Email Action Messages ---
76
77type DeleteEmailMsg struct {
78	UID uint32
79}
80
81type ArchiveEmailMsg struct {
82	UID uint32
83}
84
85// EmailActionDoneMsg reports the result of an action like delete or archive.
86type EmailActionDoneMsg struct {
87	UID uint32
88	Err error
89}