summary refs log tree commit diff stats
path: root/commands/msg/reply.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msg/reply.go')
-rw-r--r--commands/msg/reply.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index bde9194..8503979 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -13,6 +13,7 @@ import (
 	"git.sr.ht/~sircmpwn/aerc/lib/format"
 	"git.sr.ht/~sircmpwn/aerc/models"
 	"git.sr.ht/~sircmpwn/aerc/widgets"
+	"github.com/emersion/go-message/mail"
 )
 
 type reply struct{}
@@ -97,8 +98,8 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
 	}
 
 	var (
-		to []*models.Address
-		cc []*models.Address
+		to []*mail.Address
+		cc []*mail.Address
 	)
 
 	recSet := newAddrSet() // used for de-duping
@@ -117,7 +118,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
 		// we add our from address, so that we don't self address ourselves
 		recSet.Add(from)
 
-		envTos := make([]*models.Address, 0, len(msg.Envelope.To))
+		envTos := make([]*mail.Address, 0, len(msg.Envelope.To))
 		for _, addr := range msg.Envelope.To {
 			if recSet.Contains(addr) {
 				continue
@@ -147,7 +148,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
 	defaults := map[string]string{
 		"To":          format.FormatAddresses(to),
 		"Cc":          format.FormatAddresses(cc),
-		"From":        from.Format(),
+		"From":        format.AddressForHumans(from),
 		"Subject":     subject,
 		"In-Reply-To": msg.Envelope.MessageId,
 	}
@@ -231,17 +232,17 @@ func newAddrSet() addrSet {
 	return addrSet(s)
 }
 
-func (s addrSet) Add(a *models.Address) {
+func (s addrSet) Add(a *mail.Address) {
 	s[a.Address] = struct{}{}
 }
 
-func (s addrSet) AddList(al []*models.Address) {
+func (s addrSet) AddList(al []*mail.Address) {
 	for _, a := range al {
 		s[a.Address] = struct{}{}
 	}
 }
 
-func (s addrSet) Contains(a *models.Address) bool {
+func (s addrSet) Contains(a *mail.Address) bool {
 	_, ok := s[a.Address]
 	return ok
 }
re>
1d80538b ^
e6ba2a01 ^


1d80538b ^

aa3258c6 ^
97d3287a ^




b6d1143c ^
97d3287a ^






57bfc74f ^











1d80538b ^





e087f6d4
1d80538b ^







e087f6d4


e087f6d4







62e34428 ^
e087f6d4





443226a5 ^
e087f6d4






















































97d3287a ^
e47cfd56 ^
97d3287a ^
e087f6d4
02f28514 ^
b5ffa7c0 ^


62e34428 ^

















1d80538b ^











e087f6d4





02f28514 ^
e087f6d4






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