summaryrefslogtreecommitdiff
path: root/alot/commands/thread.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-04-18 18:20:01 +0200
committerAnton Khirnov <anton@khirnov.net>2020-04-18 18:26:38 +0200
commit09eb3dd5f8465299e75fad5900614614e62bd537 (patch)
tree8dc4f6727394306233ca336cbfea5311d7cd75b2 /alot/commands/thread.py
parenta06b892704982f3bc65ee7d6176efa22c24a4fb4 (diff)
db/message: restructure message body handling
Instead of allowing the callers to access the email part directly, introduce a new class for representing the MIME tree structure. All interaction with the message content should now happen through this class (some instances of direct access still remain and will be removed later). Encrypted/signed parts are now also handled through this structure rather than using a fragile hack of attaching the decrypted message to the encrypted one and using fake headers to signal encryption/signatures. Message body rendering is now done by walking through the whole MIME tree and considering all the parts for rendering rather than picking one specific part.
Diffstat (limited to 'alot/commands/thread.py')
-rw-r--r--alot/commands/thread.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index c302aad0..4fdc5c27 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -358,7 +358,7 @@ class ForwardCommand(Command):
envelope.body = mailcontent
- for a in self.message.get_attachments():
+ for a in self.message.iter_attachments():
envelope.attach(a)
else: # attach original mode
@@ -497,7 +497,7 @@ class EditNewCommand(Command):
envelope.add(key, value)
# copy attachments
- for b in self.message.get_attachments():
+ for b in self.message.iter_attachments():
envelope.attach(b)
await ui.apply_command(ComposeCommand(envelope=envelope,
@@ -822,7 +822,7 @@ class SaveAttachmentCommand(Command):
completer=pcomplete)
if self.path:
if os.path.isdir(os.path.expanduser(self.path)):
- for a in msg.get_attachments():
+ for a in msg.iter_attachments():
dest = a.save(self.path)
name = a.get_filename()
if name: