summaryrefslogtreecommitdiff
path: root/alot/db/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/db/message.py')
-rw-r--r--alot/db/message.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/alot/db/message.py b/alot/db/message.py
index 97ab991f..01d7c7f1 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -119,6 +119,20 @@ class _MessageHeaders:
return []
raise
+ def pick_addrlist_header(self, *args):
+ """
+ Given a list of "address-list" header names as positional arguments,
+ return the addresses from the first one that is present.
+
+ :returns: addresses from the first existing header, or an empty tuple
+ :rtype: tuple(headerregistry.Address)
+ """
+ for h in args:
+ if h in self:
+ return self.get(h).addresses
+
+ return ()
+
class _MimeTree:
_part = None