summary refs log tree commit diff stats
path: root/widgets/msgviewer.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-07 22:43:56 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-08 16:06:23 -0400
commitcce7cb48081ca090ac2d3a0e781dfbc25d581946 (patch)
tree0709eff3daf75ac975bc9e12f068d7951aeaefe6 /widgets/msgviewer.go
parentc79577d37675c8d9ed3355c532a215377e76d3b2 (diff)
downloadaerc-cce7cb48081ca090ac2d3a0e781dfbc25d581946.tar.gz
Factor UI models out of the worker message package
Before, the information needed to display different parts of the UI was
tightly coupled to the specific messages being sent back and forth to
the backend worker. Separating out a models package allows us to be more
specific about exactly what a backend is able to and required to
provide for the UI.
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r--widgets/msgviewer.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index b0ae79e..6a645f9 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -20,7 +20,7 @@ import (
 	"git.sr.ht/~sircmpwn/aerc/config"
 	"git.sr.ht/~sircmpwn/aerc/lib"
 	"git.sr.ht/~sircmpwn/aerc/lib/ui"
-	"git.sr.ht/~sircmpwn/aerc/worker/types"
+	"git.sr.ht/~sircmpwn/aerc/models"
 )
 
 var ansi = regexp.MustCompile("^\x1B\\[[0-?]*[ -/]*[@-~]")
@@ -31,7 +31,7 @@ type MessageViewer struct {
 	conf     *config.AercConfig
 	err      error
 	grid     *ui.Grid
-	msg      *types.MessageInfo
+	msg      *models.MessageInfo
 	switcher *PartSwitcher
 	store    *lib.MessageStore
 }
@@ -44,7 +44,7 @@ type PartSwitcher struct {
 }
 
 func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
-	store *lib.MessageStore, msg *types.MessageInfo) *MessageViewer {
+	store *lib.MessageStore, msg *models.MessageInfo) *MessageViewer {
 
 	grid := ui.NewGrid().Rows([]ui.GridSpec{
 		{ui.SIZE_EXACT, 4}, // TODO: Based on number of header rows
@@ -112,7 +112,7 @@ handle_error:
 }
 
 func enumerateParts(conf *config.AercConfig, store *lib.MessageStore,
-	msg *types.MessageInfo, body *imap.BodyStructure,
+	msg *models.MessageInfo, body *imap.BodyStructure,
 	showHeaders bool, index []int) ([]*PartViewer, error) {
 
 	var parts []*PartViewer
@@ -140,7 +140,7 @@ func enumerateParts(conf *config.AercConfig, store *lib.MessageStore,
 }
 
 func createSwitcher(switcher *PartSwitcher, conf *config.AercConfig,
-	store *lib.MessageStore, msg *types.MessageInfo, showHeaders bool) error {
+	store *lib.MessageStore, msg *models.MessageInfo, showHeaders bool) error {
 	var err error
 	switcher.showHeaders = showHeaders
 
@@ -212,7 +212,7 @@ func (mv *MessageViewer) SelectedAccount() *AccountView {
 	return mv.acct
 }
 
-func (mv *MessageViewer) SelectedMessage() *types.MessageInfo {
+func (mv *MessageViewer) SelectedMessage() *models.MessageInfo {
 	return mv.msg
 }
 
@@ -321,7 +321,7 @@ type PartViewer struct {
 	fetched     bool
 	filter      *exec.Cmd
 	index       []int
-	msg         *types.MessageInfo
+	msg         *models.MessageInfo
 	pager       *exec.Cmd
 	pagerin     io.WriteCloser
 	part        *imap.BodyStructure
@@ -333,7 +333,7 @@ type PartViewer struct {
 }
 
 func NewPartViewer(conf *config.AercConfig,
-	store *lib.MessageStore, msg *types.MessageInfo,
+	store *lib.MessageStore, msg *models.MessageInfo,
 	part *imap.BodyStructure, showHeaders bool,
 	index []int) (*PartViewer, error) {
 
in&id=1f3bb2eda188f04271d318c36b57f69fd61552ef'>^
9e751bb8 ^
672e3e50 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

672e3e50 ^
e5c11a51 ^
a654e4ec ^
201458e3 ^
1c2d788b ^

204dae92 ^

201458e3 ^
1c2d788b ^



204dae92 ^

201458e3 ^
1c2d788b ^
201458e3 ^

204dae92 ^

201458e3 ^
1c2d788b ^


204dae92 ^

201458e3 ^
1c2d788b ^


204dae92 ^

201458e3 ^
1c2d788b ^

204dae92 ^

201458e3 ^
1c2d788b ^

204dae92 ^

201458e3 ^
1c2d788b ^



204dae92 ^

201458e3 ^
1c2d788b ^

201458e3 ^
204dae92 ^

201458e3 ^
1c2d788b ^

201458e3 ^
204dae92 ^

201458e3 ^
1c2d788b ^
201458e3 ^
204dae92 ^











201458e3 ^
1c2d788b ^
201458e3 ^

204dae92 ^

201458e3 ^
1c2d788b ^
201458e3 ^

204dae92 ^

201458e3 ^
1c2d788b ^
201458e3 ^


204dae92 ^

201458e3 ^
1c2d788b ^
201458e3 ^



204dae92 ^

201458e3 ^
1c2d788b ^
201458e3 ^



204dae92 ^

201458e3 ^
1c2d788b ^












204dae92 ^
672e3e50 ^


a654e4ec ^
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186