summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-05-13 10:04:07 +0200
committerAnton Khirnov <anton@khirnov.net>2021-05-13 10:04:07 +0200
commitbff3f4050be4e015c99d1bae7fcf1289d026e5ad (patch)
treee4e5b911ce084d8a8d06c5dfdb9b390213fb59e3
parent4b5e28054c73dbfee3714ad16f2f7ae692fb175e (diff)
commands/thread: use the headers object for building reply subject
-rw-r--r--alot/commands/thread.py2
-rw-r--r--alot/db/message.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index aba49eae..b00cbd68 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -178,7 +178,7 @@ class ReplyCommand(Command):
envelope = Envelope(bodytext = mailcontent, replied = message)
# copy subject
- subject = mail.get('Subject', '')
+ subject = message.headers.get('Subject') or ''
reply_subject_hook = settings.get_hook('reply_subject')
if reply_subject_hook:
subject = reply_subject_hook(subject)
diff --git a/alot/db/message.py b/alot/db/message.py
index 9d5bb958..d849c91b 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -67,6 +67,13 @@ class _MessageHeaders:
raise KeyError(key)
return self._msg.get_all(key)
+ def get(self, key):
+ """
+ Get the value of the first header with the name equal to key,
+ None if the header is not present.
+ """
+ return self._msg.get(key)
+
def keys(self):
return self._msg.keys()