about summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-07-05 12:21:12 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-05 12:21:12 -0400
commit363aab5cc19135599cae93f6c9c7abcd23c111c9 (patch)
tree80cfeaf367bd1ac3077ec9dfb549a9dfc3b1f62f /widgets
parentf9f523ad59491eda08003ce2ccc6d57d7f19ea1e (diff)
downloadaerc-363aab5cc19135599cae93f6c9c7abcd23c111c9.tar.gz
Make :pipe command more generic
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account.go8
-rw-r--r--widgets/msgviewer.go9
-rw-r--r--widgets/providesmessage.go12
3 files changed, 18 insertions, 11 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 824f958..0948c5c 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -165,12 +165,16 @@ func (acct *AccountView) Store() *lib.MessageStore {
 	return acct.msglist.Store()
 }
 
+func (acct *AccountView) SelectedAccount() *AccountView {
+	return acct
+}
+
 func (acct *AccountView) SelectedMessage() *types.MessageInfo {
 	return acct.msglist.Selected()
 }
 
-func (acct *AccountView) SelectedAccount() *AccountView {
-	return acct
+func (acct *AccountView) SelectedMessagePart() *PartInfo {
+	return nil
 }
 
 func (acct *AccountView) onMessage(msg types.WorkerMessage) {
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 10c2182..b0ae79e 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -227,7 +227,7 @@ func (mv *MessageViewer) ToggleHeaders() {
 	switcher.Invalidate()
 }
 
-func (mv *MessageViewer) CurrentPart() *PartInfo {
+func (mv *MessageViewer) SelectedMessagePart() *PartInfo {
 	switcher := mv.switcher
 	part := switcher.parts[switcher.selected]
 
@@ -332,13 +332,6 @@ type PartViewer struct {
 	term        *Terminal
 }
 
-type PartInfo struct {
-	Index []int
-	Msg   *types.MessageInfo
-	Part  *imap.BodyStructure
-	Store *lib.MessageStore
-}
-
 func NewPartViewer(conf *config.AercConfig,
 	store *lib.MessageStore, msg *types.MessageInfo,
 	part *imap.BodyStructure, showHeaders bool,
diff --git a/widgets/providesmessage.go b/widgets/providesmessage.go
index 7be8e7e..4b71637 100644
--- a/widgets/providesmessage.go
+++ b/widgets/providesmessage.go
@@ -1,14 +1,24 @@
 package widgets
 
 import (
+	"github.com/emersion/go-imap"
+
 	"git.sr.ht/~sircmpwn/aerc/lib"
 	"git.sr.ht/~sircmpwn/aerc/lib/ui"
 	"git.sr.ht/~sircmpwn/aerc/worker/types"
 )
 
+type PartInfo struct {
+	Index []int
+	Msg   *types.MessageInfo
+	Part  *imap.BodyStructure
+	Store *lib.MessageStore
+}
+
 type ProvidesMessage interface {
 	ui.Drawable
 	Store() *lib.MessageStore
-	SelectedMessage() *types.MessageInfo
 	SelectedAccount() *AccountView
+	SelectedMessage() *types.MessageInfo
+	SelectedMessagePart() *PartInfo
 }
le='author Drew DeVault <sir@cmpwn.com> 2019-05-12 00:06:09 -0400 committer Drew DeVault <sir@cmpwn.com> 2019-05-12 00:06:09 -0400 Add initial compose widget' href='/akspecs/aerc/commit/aerc.go?h=0.5.0&id=577248f5e15d98a9a6522a605acd434059582bfc'>577248f ^
5d0402a ^




fa04a1e ^
10dd23f ^


8126d82 ^





aeb7005
648ca98 ^



a21afda ^




1767e4f ^
a21afda ^

a0be5e8 ^

b275a39 ^

39c93d2 ^
60b351b ^
f406bf5 ^



b60999c ^
8126d82 ^



b275a39 ^
8126d82 ^




de122b1 ^
8126d82 ^





f406bf5 ^
8126d82 ^
b60999c ^

f406bf5 ^
77a0f68 ^


1418e1b ^
60b351b ^
de122b1 ^
1418e1b ^
661e3ec ^

305446a ^
6394e38 ^
aeb7005
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


            
             



                   
              
 

                                    
                                            
                                                    
                                                    
                                                    
                                                     
                                          

                                                

 



                                                                
                                                

                                                

                                            
                                                

                                                




                                                    
                               


                                                  





                                                                    
             



                                  




                                               
                                                   

                                          

                                           

                                                              
         
 



                                  
                                                                     



                                                                      
                                                     




                                                                         
                                         





                                              
                 
                          

          
                                              


                          
                        
 
                              
                               

                                                         
                 
         
 
uthor  Anselm R. Garbe <arg@10kloc.org>  2006-09-12 10:57:28 +0200
committer  Anselm R. Garbe <arg@10kloc.org>  2006-09-12 10:57:28 +0200

removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)' href='/acidbong/suckless/dwm/commit/view.c?h=6.1&id=ca65478c8968434c78aacf4a102ccbbe4a66ad9e'>ca65478 ^
aa13727 ^



aa13727 ^








ca65478 ^
aa13727 ^



aa13727 ^









40bd21c ^
ca65478 ^
40bd21c ^







6499fc4 ^
4b5b3d9 ^
f78c16f ^






5983c00 ^
6499fc4 ^

aa13727 ^
6b25d06 ^
aa13727 ^

67986e8 ^
c60de1a ^

aa13727 ^
c60de1a ^
69b738c ^


aa13727 ^
7225c99 ^




69b738c ^
7225c99 ^

69b738c ^

aa13727 ^
7225c99 ^
aa13727 ^





46d5f9d ^
3aff961 ^
46d5f9d ^





ca65478 ^
b5159df ^
aa13727 ^
5983c00 ^
aa13727 ^




ca65478 ^
aa13727 ^





5983c00 ^
fee8df6 ^


ca65478 ^
aa13727 ^


42fd392 ^
7009ebf ^

5983c00 ^
aa13727 ^


ca65478 ^
ec85fdd ^

d800ec0 ^


d800ec0 ^
346bdea ^
d800ec0 ^

0915da8 ^

ec85fdd ^
cff951c ^
aa13727 ^
0915da8 ^
f18ed61 ^
0d0e8bd ^
d22abee ^




8a6679b ^
5983c00 ^
aa13727 ^
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
267
268