From 716f2a9489f0586f8f13c94a3c3149668800b95d Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Sat, 3 Mar 2018 21:39:11 +0100 Subject: implement replied and passed tags maildir knows R and P flags which denote messages that have been replied to resp. passed on (fowarded, bounced). They correspond to IMAP flags \Replied and $Forwarded which are used by many clients and by synchronisation software. E.g., mbsync syncs \Replied to R, a patch for P is pending. Implement replied_tags and passed_tags for alot which work similar to sent_tags: sent_tags tags the sent message; replied_tags (resp. passed_tags) tags the message being replied to (resp. being fowarded). Basically, setting the replied_tags config to `replied` and replying to a message has the same effect as doing `tag replied; reply`, but the latter would tag even sending the reply is aborted or fails. The implementation in this patch makes sure that the tagging is done only if and when the reply resp. forward has been sent successfully. --- alot/account.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'alot/account.py') diff --git a/alot/account.py b/alot/account.py index c672686d..00c65753 100644 --- a/alot/account.py +++ b/alot/account.py @@ -208,7 +208,8 @@ class Account(object): realname=None, gpg_key=None, signature=None, signature_filename=None, signature_as_attachment=False, sent_box=None, sent_tags=None, draft_box=None, - draft_tags=None, abook=None, sign_by_default=False, + draft_tags=None, replied_tags=None, passed_tags=None, + abook=None, sign_by_default=False, encrypt_by_default=u"none", encrypt_to_self=None, case_sensitive_username=False, **_): sent_tags = sent_tags or [] @@ -217,6 +218,8 @@ class Account(object): draft_tags = draft_tags or [] if 'draft' not in draft_tags: draft_tags.append('draft') + replied_tags = replied_tags or [] + passed_tags = passed_tags or [] self.address = Address.from_string(address, case_sensitive=case_sensitive_username) self.aliases = [Address.from_string(a, case_sensitive=case_sensitive_username) @@ -233,6 +236,8 @@ class Account(object): self.sent_tags = sent_tags self.draft_box = draft_box self.draft_tags = draft_tags + self.replied_tags = replied_tags + self.passed_tags = passed_tags self.abook = abook # Handle encrypt_by_default in an backwards compatible way. The # logging info call can later be upgraded to warning or error. -- cgit v1.2.3