about summary refs log tree commit diff stats
path: root/commands/account
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-29 22:35:53 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-29 22:36:15 -0400
commit77ede6eb5a22a5407541ac587736189fcca0037f (patch)
tree45627c15f7087f91ed9881e776a566d440bd878e /commands/account
parent84e9853c1613f43f76bd46f0c1eb143d1db16ac2 (diff)
downloadaerc-77ede6eb5a22a5407541ac587736189fcca0037f.tar.gz
Add body fetching support code
Diffstat (limited to 'commands/account')
-rw-r--r--commands/account/fetch-msg.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/commands/account/fetch-msg.go b/commands/account/fetch-msg.go
new file mode 100644
index 0000000..631a8ee
--- /dev/null
+++ b/commands/account/fetch-msg.go
@@ -0,0 +1,29 @@
+package account
+
+import (
+	"errors"
+
+	"github.com/mohamedattahri/mail"
+
+	"git.sr.ht/~sircmpwn/aerc2/widgets"
+)
+
+func init() {
+	register("fetch-message", FetchMessage)
+}
+
+func FetchMessage(aerc *widgets.Aerc, args []string) error {
+	if len(args) != 1 {
+		return errors.New("Usage: :fetch-message")
+	}
+	acct := aerc.SelectedAccount()
+	if acct == nil {
+		return errors.New("No account selected")
+	}
+	store := acct.Messages().Store()
+	msg := acct.Messages().Selected()
+	store.FetchBodies([]uint32{msg.Uid}, func(msg *mail.Message) {
+		aerc.SetStatus("got message body, woohoo")
+	})
+	return nil
+}
626e7ab335d9af2c75510f08e9019e75c9'>6acea762 ^
a232af2f ^
93569d9d ^
a232af2f ^




6acea762 ^
a232af2f ^

6acea762 ^
a232af2f ^

9397c4c2 ^






e35c2d68 ^
9397c4c2 ^












a232af2f ^




6acea762 ^
a232af2f ^


79cb6ea5 ^


e35c2d68 ^
79cb6ea5 ^
e35c2d68 ^




79cb6ea5 ^


a232af2f ^
eed2f30e ^
22d93b76 ^
46a3b11c ^

22d93b76 ^
a232af2f ^
6acea762 ^
a232af2f ^



20037b7c ^
e35c2d68 ^

20037b7c ^


3315a7d3 ^
a232af2f ^

e35c2d68 ^
a232af2f ^

e35c2d68 ^
a232af2f ^



6acea762 ^
a232af2f ^

6acea762 ^
a232af2f ^

6acea762 ^
a232af2f ^


38b80618 ^
a232af2f ^




e35c2d68 ^

6acea762 ^

89fd0bf2 ^

49559e00 ^
89fd0bf2 ^
e3a53f3a ^

46a3b11c ^
89fd0bf2 ^
48f6d48a ^
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