summaryrefslogtreecommitdiff
path: root/alot/db
diff options
context:
space:
mode:
authorvrs <none>2018-12-08 22:20:05 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-12-10 10:25:49 +0000
commitb981bfe0c61d9aa55652b4b0a01b846aaa9c993a (patch)
treeb16298ac338ef19758af553b845ddc05b6124fc1 /alot/db
parentfdac378674a3e90413fcfba3dd2c9cc0debbb9cc (diff)
attach accounts to envelopes
simplifies a few tests, fixes #1177
Diffstat (limited to 'alot/db')
-rw-r--r--alot/db/envelope.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 44da6f71..b68e683f 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -45,11 +45,13 @@ class Envelope(object):
"""list of :class:`Attachments <alot.db.attachment.Attachment>`"""
tags = []
"""tags to add after successful sendout"""
+ account = None
+ """account to send from"""
def __init__(
self, template=None, bodytext=None, headers=None, attachments=None,
sign=False, sign_key=None, encrypt=False, tags=None, replied=None,
- passed=None):
+ passed=None, account=None):
"""
:param template: if not None, the envelope will be initialised by
:meth:`parsing <parse_template>` this string before
@@ -67,6 +69,8 @@ class Envelope(object):
:type replied: :class:`~alot.db.message.Message`
:param passed: message being passed on
:type replied: :class:`~alot.db.message.Message`
+ :param account: account to send from
+ :type account: :class:`Account`
"""
logging.debug('TEMPLATE: %s', template)
if template:
@@ -88,6 +92,7 @@ class Envelope(object):
self.sent_time = None
self.modified_since_sent = False
self.sending = False # semaphore to avoid accidental double sendout
+ self.account = account
def __str__(self):
return "Envelope (%s)\n%s" % (self.headers, self.body)