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
 }
m> 2020-05-29 16:24:31 -0700 6437 - check screen/window dimensions' href='/akkartik/mu/commit/apps/browse.mu?h=main&id=cb0caab25c66170266a2ad6ad60c077b863aac43'>cb0caab2 ^
99558d26 ^
7bdd25fa ^
1a147cc0 ^






166668a1 ^
42ee204a ^

1a147cc0 ^


99558d26 ^
166668a1 ^
8bd3c2b5 ^
1a147cc0 ^


42ee204a ^
1a147cc0 ^


166668a1 ^
1a147cc0 ^



42ee204a ^


2fb656b4 ^
32ada0e1 ^
2fb656b4 ^


8bd3c2b5 ^
42ee204a ^
2fb656b4 ^




42ee204a ^
2f16a747 ^

6c7f7abd ^
2fb656b4 ^





2fb656b4 ^

42ee204a ^










8bd3c2b5 ^
42ee204a ^






8bd3c2b5 ^
42ee204a ^










8bd3c2b5 ^
42ee204a ^






8bd3c2b5 ^
42ee204a ^







2fb656b4 ^





8bd3c2b5 ^
2fb656b4 ^


22254896 ^
2fb656b4 ^







dac00bd9 ^
0a80e66f ^


6c7f7abd ^
0a80e66f ^
dac00bd9 ^
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