summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-09-16 14:36:00 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-09-16 14:36:00 +0100
commitbabfed1bc6d816d8a220f455530d72b60b71b7ee (patch)
tree91e4d93657f66d18713f4e40ad234fa49dbd9682
parent2e213c05aee22163ff0e6c3b24497d14364cb79a (diff)
add envelope.tags
that contains tagstrings to add to message after successful sendout
-rw-r--r--alot/commands/envelope.py2
-rw-r--r--alot/db/envelope.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index b0490b6a..2a041165 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -181,7 +181,7 @@ class SendCommand(Command):
# add mail to index if maildir path available
if path is not None:
logging.debug('adding new mail to index')
- ui.dbman.add_message(path, account.sent_tags)
+ ui.dbman.add_message(path, account.sent_tags + envelope.tags)
ui.apply_command(globals.FlushCommand())
def send_errb(failure):
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 041b26d6..783cb369 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -26,7 +26,7 @@ from utils import encode_header
class Envelope(object):
"""a message that is not yet sent and still editable"""
def __init__(self, template=None, bodytext=u'', headers={}, attachments=[],
- sign=False, sign_key=None, encrypt=False):
+ sign=False, sign_key=None, encrypt=False, tags=[]):
"""
:param template: if not None, the envelope will be initialised by
:meth:`parsing <parse_template>` this string before
@@ -38,6 +38,8 @@ class Envelope(object):
:type headers: dict (str -> unicode)
:param attachments: file attachments to include
:type attachments: list of :class:`~alot.db.attachment.Attachment`
+ :param tags: tags to add after successful sendout and saving this message
+ :type tags: list of str
"""
assert isinstance(bodytext, unicode)
self.headers = {}
@@ -55,6 +57,7 @@ class Envelope(object):
self.sign = sign
self.sign_key = sign_key
self.encrypt = encrypt
+ self.tags = tags # tags to add after successful sendout
self.sent_time = None
self.modified_since_sent = False
self.sending = False # semaphore to avoid accidental double sendout