mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-03-06 18:23:44 +01:00
forward: allow forwarded flag to be set
Usually, a MUA sets a flag for messages that have been forwarded, but this is currently not the case for aerc. Consider the forwarded flag and prepare aerc to set it everytime the :forward command is called and ends successfully. Changelog-added: The :forward command now sets the forwarded flag. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
@@ -45,7 +45,7 @@ func GetAddress(search string) []string {
|
||||
|
||||
// GetFlagList returns a list of available flags for completion
|
||||
func GetFlagList() []string {
|
||||
return []string{"Seen", "Answered", "Flagged", "Draft"}
|
||||
return []string{"Seen", "Answered", "Forwarded", "Flagged", "Draft"}
|
||||
}
|
||||
|
||||
// GetDateList returns a list of date terms for completion
|
||||
|
||||
@@ -162,7 +162,10 @@ func (f forward) Execute(args []string) error {
|
||||
return
|
||||
}
|
||||
composer.AddAttachment(tmpFileName)
|
||||
composer.OnClose(func(_ *app.Composer) {
|
||||
composer.OnClose(func(c *app.Composer) {
|
||||
if c.Sent() {
|
||||
store.Forwarded([]uint32{msg.Uid}, true, nil)
|
||||
}
|
||||
os.RemoveAll(tmpDir)
|
||||
})
|
||||
})
|
||||
@@ -211,6 +214,12 @@ func (f forward) Execute(args []string) error {
|
||||
return
|
||||
}
|
||||
|
||||
composer.OnClose(func(c *app.Composer) {
|
||||
if c.Sent() {
|
||||
store.Forwarded([]uint32{msg.Uid}, true, nil)
|
||||
}
|
||||
})
|
||||
|
||||
// add attachments
|
||||
if f.AttachAll {
|
||||
var mu sync.Mutex
|
||||
|
||||
@@ -56,6 +56,7 @@ type UIConfig struct {
|
||||
IconInvalid string `ini:"icon-invalid" default:"[s!]"`
|
||||
IconAttachment string `ini:"icon-attachment" default:"a"`
|
||||
IconReplied string `ini:"icon-replied" default:"r"`
|
||||
IconForwarded string `ini:"icon-forwarded" default:"f"`
|
||||
IconNew string `ini:"icon-new" default:"N"`
|
||||
IconOld string `ini:"icon-old" default:"O"`
|
||||
IconDraft string `ini:"icon-draft" default:"d"`
|
||||
|
||||
@@ -428,6 +428,11 @@ These options are configured in the *[ui]* section of _aerc.conf_.
|
||||
|
||||
Default: _r_
|
||||
|
||||
*icon-forwarded* = _<string>_
|
||||
The icon to display in *column-flags* when the message has been forwarded.
|
||||
|
||||
Default: _f_
|
||||
|
||||
*icon-flagged* = _<string>_
|
||||
The icon to display in *column-flags* when the message is flagged.
|
||||
|
||||
|
||||
@@ -475,6 +475,8 @@ message list, the message in the message viewer, etc).
|
||||
Message has been read
|
||||
_Answered_
|
||||
Message has been answered
|
||||
_Forwarded_
|
||||
Message has been forwarded
|
||||
_Flagged_
|
||||
Message is flagged for urgent/special attention
|
||||
_Draft_
|
||||
|
||||
@@ -711,6 +711,8 @@ func (store *MessageStore) Flag(uids []uint32, flags models.Flags,
|
||||
flagName = "seen"
|
||||
case models.AnsweredFlag:
|
||||
flagName = "answered"
|
||||
case models.ForwardedFlag:
|
||||
flagName = "forwarded"
|
||||
case models.FlaggedFlag:
|
||||
flagName = "flagged"
|
||||
case models.DraftFlag:
|
||||
@@ -734,6 +736,15 @@ func (store *MessageStore) Answered(uids []uint32, answered bool,
|
||||
}, cb)
|
||||
}
|
||||
|
||||
func (store *MessageStore) Forwarded(uids []uint32, forwarded bool,
|
||||
cb func(msg types.WorkerMessage),
|
||||
) {
|
||||
store.worker.PostAction(&types.ForwardedMessages{
|
||||
Forwarded: forwarded,
|
||||
Uids: uids,
|
||||
}, cb)
|
||||
}
|
||||
|
||||
func (store *MessageStore) Uids() []uint32 {
|
||||
if store.ThreadedView() && store.builder != nil {
|
||||
if uids := store.builder.Uids(); len(uids) > 0 {
|
||||
|
||||
@@ -25,6 +25,9 @@ const (
|
||||
// AnsweredFlag marks a message as having been replied to
|
||||
AnsweredFlag
|
||||
|
||||
// ForwardedFlag marks a message as having been forwarded
|
||||
ForwardedFlag
|
||||
|
||||
// DeletedFlag marks a message as having been deleted
|
||||
DeletedFlag
|
||||
|
||||
|
||||
@@ -186,6 +186,12 @@ type AnsweredMessages struct {
|
||||
Uids []uint32
|
||||
}
|
||||
|
||||
type ForwardedMessages struct {
|
||||
Message
|
||||
Forwarded bool
|
||||
Uids []uint32
|
||||
}
|
||||
|
||||
type CopyMessages struct {
|
||||
Message
|
||||
Destination string
|
||||
|
||||
Reference in New Issue
Block a user