summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
authorKevin Kuehler <kkuehler@brave.com>2019-06-10 22:27:54 -0700
committerDrew DeVault <sir@cmpwn.com>2019-06-11 09:18:51 -0400
commitd1df7103280ef488434b103e5e9e3129c407e5b6 (patch)
tree8226b3c4bde8208c544a39fe9aedb41a845d3c6e /commands
parentd22a9140cdd34960cc2a50b2ae9011091f39118b (diff)
downloadaerc-d1df7103280ef488434b103e5e9e3129c407e5b6.tar.gz
commands/msg/archive: Work with msgviwer
Inside the generic msg command we cannot use aerc.SelectedAccount()
because the method naively assumes the current tab is an AccountView.
Use the ProvidesMessage interface instead.

Signed-off-by: Kevin Kuehler <kkuehler@brave.com>
Diffstat (limited to 'commands')
-rw-r--r--commands/msg/archive.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/commands/msg/archive.go b/commands/msg/archive.go
index 11752f7..da4c421 100644
--- a/commands/msg/archive.go
+++ b/commands/msg/archive.go
@@ -26,12 +26,13 @@ func Archive(aerc *widgets.Aerc, args []string) error {
 	if len(args) != 2 {
 		return errors.New("Usage: archive <flat|year|month>")
 	}
-	acct := aerc.SelectedAccount()
+	widget := aerc.SelectedTab().(widgets.ProvidesMessage)
+	acct := widget.SelectedAccount()
 	if acct == nil {
 		return errors.New("No account selected")
 	}
-	msg := acct.Messages().Selected()
-	store := acct.Messages().Store()
+	msg := widget.SelectedMessage()
+	store := widget.Store()
 	archiveDir := acct.AccountConfig().Archive
 	acct.Messages().Next()
 
r@cmpwn.com> 2019-05-26 15:48:29 -0400 committer Drew DeVault <sir@cmpwn.com> 2019-05-26 15:48:29 -0400 Update terminal color handling per vterm changes' href='/akspecs/aerc/commit/go.sum?h=0.6.0&id=62cd0b08aa82fe19e6d5d96b0341f7cffbb4cb7b'>62cd0b0 ^
43dba93 ^






0911cd5 ^

43dba93 ^

29de329 ^

bbdf9df ^

62862d8 ^
648ca98 ^
56b84d3 ^

62862d8 ^
648ca98 ^
8d20e92 ^

d394fd1 ^

072bc26 ^



62862d8 ^
648ca98 ^
62862d8 ^
648ca98 ^
56b84d3 ^

475b697 ^

648ca98 ^

1170893 ^

62862d8 ^
648ca98 ^
56b84d3 ^

b0bf09b ^

513e8aa ^

cef784b ^

8d20e92 ^

16c3f0a ^

072bc26 ^



8d20e92 ^


072bc26 ^
855362d ^
072bc26 ^

43dba93 ^

648ca98 ^

072bc26 ^





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