diff options
author | Jakob <jakob@pipefour.org> | 2012-04-02 23:44:56 -0700 |
---|---|---|
committer | Jakob <jakob@pipefour.org> | 2012-04-02 23:44:56 -0700 |
commit | 287884e39e4d220ba78d8aeb1456be5ebd550ccc (patch) | |
tree | 78d2094346bd19f0f84764bc57a5ad3f37b9a227 | |
parent | 2cb5996bc6cea048b981ea26bdfe90d8ae7dcd60 (diff) |
Support multiple emails per abook contact.
Issue #424.
-rw-r--r-- | alot/addressbooks.py | 7 | ||||
-rw-r--r-- | alot/defaults/abook_contacts.spec | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/alot/addressbooks.py b/alot/addressbooks.py index d3d6936c..47e77266 100644 --- a/alot/addressbooks.py +++ b/alot/addressbooks.py @@ -44,8 +44,11 @@ class AbookAddressBook(AddressBook): def get_contacts(self): c = self._config - return [(c[id]['name'], c[id]['email']) for id in c.sections if \ - c[id]['email'] is not None] + res = [] + for id in c.sections: + for email in c[id]['email']: + res.append((c[id]['name'], email)) + return res class MatchSdtoutAddressbook(AddressBook): diff --git a/alot/defaults/abook_contacts.spec b/alot/defaults/abook_contacts.spec index a360c069..bd7922c8 100644 --- a/alot/defaults/abook_contacts.spec +++ b/alot/defaults/abook_contacts.spec @@ -4,4 +4,4 @@ [__many__] name = string(default=None) - email = string(default=None) + email = force_list(default=list()) |