summaryrefslogtreecommitdiff
path: root/alot/commands.py
diff options
context:
space:
mode:
authorpazz <patricktotzke@gmail.com>2011-07-19 22:43:52 +0100
committerpazz <patricktotzke@gmail.com>2011-07-19 22:43:52 +0100
commitef2edc0210377f02638eb30ed3f09c67410f6569 (patch)
tree6c11d33f1e4d7dc26582b70f87e373f05c2ee061 /alot/commands.py
parent1e0d2ad1d6ce3ee71e187831faa5cff1a617b852 (diff)
subject & to commands for envelopes + mappings
to overwrite header fields. completes issue #27
Diffstat (limited to 'alot/commands.py')
-rw-r--r--alot/commands.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/alot/commands.py b/alot/commands.py
index b4e5d6b7..2b8d312a 100644
--- a/alot/commands.py
+++ b/alot/commands.py
@@ -514,3 +514,20 @@ class EnvelopeReeditCommand(Command):
on_success=readTmpfile,
refocus=False))
+
+class EnvelopeSetCommand(Command):
+ """sets header fields of mail open in envelope buffer"""
+
+ def __init__(self, key='', value='', **kwargs):
+ self.key = key
+ self.value = value
+ Command.__init__(self, **kwargs)
+
+ def apply(self, ui):
+ envelope = ui.current_buffer
+ mail = envelope.get_email()
+ if self.key in mail:
+ mail.replace_header(self.key, self.value)
+ else:
+ mail[self.key] = self.value
+ envelope.rebuild()