summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
authorBen Fiedler <git@services.bfiedler.ch>2020-04-24 22:31:39 +0200
committerDrew DeVault <sir@cmpwn.com>2020-05-01 11:10:08 -0400
commit05fa79eb8efa02e39962c08231ec0e40cafe0020 (patch)
tree90cc60bbc6ec1829021abbb219ba9e49d7b653a2 /commands
parentb650bb30a2d3ebd527c66dc7f7b229ca238fe297 (diff)
downloadaerc-05fa79eb8efa02e39962c08231ec0e40cafe0020.tar.gz
store.FetchFull: Change callback type to expose entire message
This is a prerequisite for allowing the FetchFull message to return both
the message content and the message headers.
Diffstat (limited to 'commands')
-rw-r--r--commands/msg/forward.go6
-rw-r--r--commands/msg/pipe.go7
2 files changed, 8 insertions, 5 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index 35a65d8..0b81e52 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -12,6 +12,8 @@ import (
 
 	"git.sr.ht/~sircmpwn/aerc/models"
 	"git.sr.ht/~sircmpwn/aerc/widgets"
+	"git.sr.ht/~sircmpwn/aerc/worker/types"
+
 	"git.sr.ht/~sircmpwn/getopt"
 )
 
@@ -109,7 +111,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
 		}
 		tmpFileName := path.Join(tmpDir,
 			strings.ReplaceAll(fmt.Sprintf("%s.eml", msg.Envelope.Subject), "/", "-"))
-		store.FetchFull([]uint32{msg.Uid}, func(reader io.Reader) {
+		store.FetchFull([]uint32{msg.Uid}, func(fm *types.FullMessage) {
 			tmpFile, err := os.Create(tmpFileName)
 			if err != nil {
 				println(err)
@@ -119,7 +121,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
 			}
 
 			defer tmpFile.Close()
-			io.Copy(tmpFile, reader)
+			io.Copy(tmpFile, fm.Content.Reader)
 			composer, err := addTab()
 			if err != nil {
 				return
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go
index 9fbc3ac..44b0067 100644
--- a/commands/msg/pipe.go
+++ b/commands/msg/pipe.go
@@ -9,6 +9,7 @@ import (
 
 	"git.sr.ht/~sircmpwn/aerc/commands"
 	"git.sr.ht/~sircmpwn/aerc/widgets"
+	"git.sr.ht/~sircmpwn/aerc/worker/types"
 
 	"git.sr.ht/~sircmpwn/getopt"
 	"github.com/gdamore/tcell"
@@ -115,11 +116,11 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
 		if err != nil {
 			return err
 		}
-		store.FetchFull([]uint32{msg.Uid}, func(reader io.Reader) {
+		store.FetchFull([]uint32{msg.Uid}, func(fm *types.FullMessage) {
 			if background {
-				doExec(reader)
+				doExec(fm.Content.Reader)
 			} else {
-				doTerm(reader, fmt.Sprintf(
+				doTerm(fm.Content.Reader, fmt.Sprintf(
 					"%s <%s", cmd[0], msg.Envelope.Subject))
 			}
 		})
Kartik K. Agaram <vc@akkartik.com> 2022-05-14 13:08:33 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2022-05-14 13:08:33 -0700 beginnings of support for multiple shapes' href='/akkartik/lines.love/commit/main.lua?id=eaa3820241476cd485c02ee20703bb0a65477db6'>eaa3820 ^
58ce23d ^

eaa3820 ^








45eee7a ^
c0df6f8 ^












eaa3820 ^
7fd3c92 ^

de495ae ^

eaa3820 ^
9ade4d2 ^
6809990 ^
5d139f4 ^
64072bf ^
fa103ca ^
















442133f ^



254ae7a ^
34f9670 ^
9ade4d2 ^
34f9670 ^
9ade4d2 ^
45eee7a ^
cfdd563 ^
c0df6f8 ^
b586c73 ^
cfdd563 ^

9ade4d2 ^
f421e1d ^
254ae7a ^
51eb86c ^
f421e1d ^
9ade4d2 ^
8f06b74 ^
45eee7a ^
662096d ^
45eee7a ^
cfdd563 ^
c0df6f8 ^
b586c73 ^
cfdd563 ^

9ade4d2 ^
8f06b74 ^

f421e1d ^
dc618a4 ^
51eb86c ^
8aa72be ^
51eb86c ^
f91e520 ^


6a5864e ^
e581a2b ^
40b1780 ^
e581a2b ^
8aa72be ^
e0b2c2d ^
c0df6f8 ^

f91e520 ^
6a5864e ^
f91e520 ^



c0df6f8 ^

f91e520 ^

c0df6f8 ^
5f2ef2f ^
f91e520 ^
5816956 ^
f91e520 ^
6a5864e ^

d482694 ^
6a5864e ^
f91e520 ^
e581a2b ^
6a5864e ^
1e63bf0 ^
5816956 ^
e581a2b ^
f91e520 ^
475bbd7 ^
51eb86c ^
1e63bf0 ^
a9398e4 ^
51eb86c ^

f421e1d ^
c1ba40a ^
475bbd7 ^

f421e1d ^
6e152a9 ^
3a9f02c ^
40b1780 ^
e2d4edb ^
92bd683 ^
d4daac4 ^
e2d4edb ^

92bd683 ^

3a9f02c ^


e83f219 ^

f421e1d ^
4818672 ^
eaa3820 ^

f421e1d ^
bb9e23a ^









f421e1d ^
222a11a ^

b544e8c ^




9a18b09 ^





bb9e23a ^















f91e520 ^
c0df6f8 ^
1e63bf0 ^
8d5ac5d ^
c0df6f8 ^

ec410d5 ^
6b10c94 ^
f91e520 ^

b3251b2 ^









f91e520 ^
b3251b2 ^
f91e520 ^
b3251b2 ^
c0df6f8 ^
b3251b2 ^
ec410d5 ^
b3251b2 ^
222a11a ^

ccf7ecc ^


f421e1d ^
4aa2003 ^
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266