about summary refs log tree commit diff stats
path: root/widgets/compose.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/compose.go')
-rw-r--r--widgets/compose.go44
1 files changed, 25 insertions, 19 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 9ceabf6..66877cc 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -32,9 +32,10 @@ import (
 type Composer struct {
 	editors map[string]*headerEditor
 
-	acct   *config.AccountConfig
-	config *config.AercConfig
-	aerc   *Aerc
+	acctConfig *config.AccountConfig
+	config     *config.AercConfig
+	acct       *AccountView
+	aerc       *Aerc
 
 	attachments []string
 	date        time.Time
@@ -57,7 +58,7 @@ type Composer struct {
 	width int
 }
 
-func NewComposer(aerc *Aerc, conf *config.AercConfig,
+func NewComposer(aerc *Aerc, acct *AccountView, conf *config.AercConfig,
 	acct *config.AccountConfig, worker *types.Worker, template string,
 	defaults map[string]string, original models.OriginalMail) (*Composer, error) {
 
@@ -65,7 +66,7 @@ func NewComposer(aerc *Aerc, conf *config.AercConfig,
 		defaults = make(map[string]string)
 	}
 	if from := defaults["From"]; from == "" {
-		defaults["From"] = acct.From
+		defaults["From"] = acctConfig.From
 	}
 
 	templateData := templates.ParseTemplateData(defaults, original)
@@ -82,16 +83,17 @@ func NewComposer(aerc *Aerc, conf *config.AercConfig,
 	}
 
 	c := &Composer{
-		acct:     acct,
-		aerc:     aerc,
-		config:   conf,
-		date:     time.Now(),
-		defaults: defaults,
-		editors:  editors,
-		email:    email,
-		layout:   layout,
-		msgId:    mail.GenerateMessageID(),
-		worker:   worker,
+		acct:       acct,
+		acctConfig: acctConfig,
+		aerc:       aerc,
+		config:     conf,
+		date:       time.Now(),
+		defaults:   defaults,
+		editors:    editors,
+		email:      email,
+		layout:     layout,
+		msgId:      mail.GenerateMessageID(),
+		worker:     worker,
 		// You have to backtab to get to "From", since you usually don't edit it
 		focused:   1,
 		focusable: focusable,
@@ -215,7 +217,7 @@ func (c *Composer) AddTemplate(template string, data interface{}) error {
 
 func (c *Composer) AddSignature() {
 	var signature []byte
-	if c.acct.SignatureCmd != "" {
+	if c.acctConfig.SignatureCmd != "" {
 		var err error
 		signature, err = c.readSignatureFromCmd()
 		if err != nil {
@@ -228,7 +230,7 @@ func (c *Composer) AddSignature() {
 }
 
 func (c *Composer) readSignatureFromCmd() ([]byte, error) {
-	sigCmd := c.acct.SignatureCmd
+	sigCmd := c.acctConfig.SignatureCmd
 	cmd := exec.Command("sh", "-c", sigCmd)
 	signature, err := cmd.Output()
 	if err != nil {
@@ -238,7 +240,7 @@ func (c *Composer) readSignatureFromCmd() ([]byte, error) {
 }
 
 func (c *Composer) readSignatureFromFile() []byte {
-	sigFile := c.acct.SignatureFile
+	sigFile := c.acctConfig.SignatureFile
 	if sigFile == "" {
 		return nil
 	}
@@ -354,6 +356,10 @@ func (c *Composer) Focus(focus bool) {
 }
 
 func (c *Composer) Config() *config.AccountConfig {
+	return c.acctConfig
+}
+
+func (c *Composer) Account() *AccountView {
 	return c.acct
 }
 
@@ -771,7 +777,7 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage {
 	} else {
 		// TODO: source this from actual keybindings?
 		grid.AddChild(ui.NewText(
-			"Send this email? [y]es/[n]o/[e]dit/[a]ttach")).At(0, 0)
+			"Send this email? [y]es/[n]o/[p]ostpone/[e]dit/[a]ttach")).At(0, 0)
 		grid.AddChild(ui.NewText("Attachments:").
 			Reverse(true)).At(1, 0)
 		if len(composer.attachments) == 0 {
t <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 ^


753adb9 ^
5d0402a ^

fa04a1e ^
10dd23f ^


8126d82 ^





dc4c36a ^
2a09617 ^




















c6b776a ^


2a09617 ^



f42724c ^
f42724c ^
74af57b ^
f42724c ^

d43684c ^
66a9052 ^
d43684c ^

aeb7005
74af57b ^

d43684c ^

66a9052 ^
74af57b ^







f15811a ^
66a9052 ^

d43684c ^
66a9052 ^

f15811a ^













74af57b ^

648ca98 ^



a21afda ^



ec0e0f9 ^
a21afda ^
1767e4f ^
a21afda ^

d85f671 ^
a0be5e8 ^
b812257 ^
b275a39 ^
39c93d2 ^
60b351b ^
f406bf5 ^



2a09617 ^
dc4c36a ^



8635c70 ^
b60999c ^
0847464 ^
77a0f68 ^


1418e1b ^
60b351b ^
0847464 ^



f3158b3 ^



7a489cb ^








f15811a ^

de122b1 ^
a15ea01 ^


1418e1b ^
661e3ec ^

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