about summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-07-05 12:21:12 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-05 12:21:12 -0400
commit363aab5cc19135599cae93f6c9c7abcd23c111c9 (patch)
tree80cfeaf367bd1ac3077ec9dfb549a9dfc3b1f62f /widgets
parentf9f523ad59491eda08003ce2ccc6d57d7f19ea1e (diff)
downloadaerc-363aab5cc19135599cae93f6c9c7abcd23c111c9.tar.gz
Make :pipe command more generic
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account.go8
-rw-r--r--widgets/msgviewer.go9
-rw-r--r--widgets/providesmessage.go12
3 files changed, 18 insertions, 11 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 824f958..0948c5c 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -165,12 +165,16 @@ func (acct *AccountView) Store() *lib.MessageStore {
 	return acct.msglist.Store()
 }
 
+func (acct *AccountView) SelectedAccount() *AccountView {
+	return acct
+}
+
 func (acct *AccountView) SelectedMessage() *types.MessageInfo {
 	return acct.msglist.Selected()
 }
 
-func (acct *AccountView) SelectedAccount() *AccountView {
-	return acct
+func (acct *AccountView) SelectedMessagePart() *PartInfo {
+	return nil
 }
 
 func (acct *AccountView) onMessage(msg types.WorkerMessage) {
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 10c2182..b0ae79e 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -227,7 +227,7 @@ func (mv *MessageViewer) ToggleHeaders() {
 	switcher.Invalidate()
 }
 
-func (mv *MessageViewer) CurrentPart() *PartInfo {
+func (mv *MessageViewer) SelectedMessagePart() *PartInfo {
 	switcher := mv.switcher
 	part := switcher.parts[switcher.selected]
 
@@ -332,13 +332,6 @@ type PartViewer struct {
 	term        *Terminal
 }
 
-type PartInfo struct {
-	Index []int
-	Msg   *types.MessageInfo
-	Part  *imap.BodyStructure
-	Store *lib.MessageStore
-}
-
 func NewPartViewer(conf *config.AercConfig,
 	store *lib.MessageStore, msg *types.MessageInfo,
 	part *imap.BodyStructure, showHeaders bool,
diff --git a/widgets/providesmessage.go b/widgets/providesmessage.go
index 7be8e7e..4b71637 100644
--- a/widgets/providesmessage.go
+++ b/widgets/providesmessage.go
@@ -1,14 +1,24 @@
 package widgets
 
 import (
+	"github.com/emersion/go-imap"
+
 	"git.sr.ht/~sircmpwn/aerc/lib"
 	"git.sr.ht/~sircmpwn/aerc/lib/ui"
 	"git.sr.ht/~sircmpwn/aerc/worker/types"
 )
 
+type PartInfo struct {
+	Index []int
+	Msg   *types.MessageInfo
+	Part  *imap.BodyStructure
+	Store *lib.MessageStore
+}
+
 type ProvidesMessage interface {
 	ui.Drawable
 	Store() *lib.MessageStore
-	SelectedMessage() *types.MessageInfo
 	SelectedAccount() *AccountView
+	SelectedMessage() *types.MessageInfo
+	SelectedMessagePart() *PartInfo
 }
5896adf2f63f5af41c7'>^
33352536 ^



bc20cc3d ^
33352536 ^
bc20cc3d ^


33352536 ^
bc20cc3d ^

33352536 ^
bc20cc3d ^
33352536 ^

bc20cc3d ^




3a044623 ^
bc20cc3d ^



33352536 ^
bc20cc3d ^
33352536 ^

bc20cc3d ^




33352536 ^


c88b9e31 ^

33352536 ^
c88b9e31 ^
bc20cc3d ^
33352536 ^
bc20cc3d ^
bc20cc3d ^
c88b9e31 ^
bc20cc3d ^
33352536 ^



bc20cc3d ^


33352536 ^
bc20cc3d ^


33352536 ^

bc20cc3d ^

33352536 ^

bc20cc3d ^


33352536 ^

bc20cc3d ^


33352536 ^
bc20cc3d ^


33352536 ^
bc20cc3d ^

33352536 ^

bc20cc3d ^


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