summaryrefslogtreecommitdiff
path: root/alot/account.py
diff options
context:
space:
mode:
authorMichael J Gruber <github@grubix.eu>2018-03-03 21:39:11 +0100
committerMichael J Gruber <github@grubix.eu>2018-03-05 13:51:40 +0100
commit716f2a9489f0586f8f13c94a3c3149668800b95d (patch)
tree6394510008d0d9e2d2e81c8f740c73e128d79f41 /alot/account.py
parentce5aab2c3d77cf5a0da5eb31508f564139072600 (diff)
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.
Diffstat (limited to 'alot/account.py')
-rw-r--r--alot/account.py7
1 files changed, 6 insertions, 1 deletions
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.