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
 75type DeleteEmailMsg struct {
 76	UID uint32
 77}
 78
 79type ArchiveEmailMsg struct {
 80	UID uint32
 81}
 82
 83type EmailActionDoneMsg struct {
 84	UID uint32
 85	Err error
 86}
 87
 88type GoToChoiceMenuMsg struct{}
 89
 90type DownloadAttachmentMsg struct {
 91	Index    int
 92	Filename string
 93	PartID   string
 94	Data     []byte
 95}
 96
 97type AttachmentDownloadedMsg struct {
 98	Path string
 99	Err  error
100}
101
102type RestoreViewMsg struct{}
103
104type BackToInboxMsg struct{}
105
106// --- Draft Messages ---
107
108// DiscardDraftMsg signals that a draft should be cached.
109type DiscardDraftMsg struct {
110	ComposerState *Composer
111}
112
113// RestoreDraftMsg signals that the cached draft should be restored.
114type RestoreDraftMsg struct{}
115
116type EmailBodyFetchedMsg struct {
117	Index       int
118	Body        string
119	Attachments []fetcher.Attachment
120	Err         error
121}