From f7c5b841568886be64695a14f341c4c7c58b3fba Mon Sep 17 00:00:00 2001 From: vrs Date: Sat, 8 Dec 2018 23:11:24 +0100 Subject: match addresses against accounts, not address lists fixes #1230, fixes an unfiled bug in clear_my_address() --- alot/db/thread.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'alot/db') diff --git a/alot/db/thread.py b/alot/db/thread.py index fe7ea10f..0943d815 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -174,14 +174,14 @@ class Thread(object): return self._authors - def get_authors_string(self, own_addrs=None, replace_own=None): + def get_authors_string(self, own_accts=None, replace_own=None): """ returns a string of comma-separated authors Depending on settings, it will substitute "me" for author name if address is user's own. - :param own_addrs: list of own email addresses to replace - :type own_addrs: list of str + :param own_accts: list of own accounts to replace + :type own_accts: list of :class:`Account` :param replace_own: whether or not to actually do replacement :type replace_own: bool :rtype: str @@ -189,12 +189,14 @@ class Thread(object): if replace_own is None: replace_own = settings.get('thread_authors_replace_me') if replace_own: - if own_addrs is None: - own_addrs = settings.get_addresses() + if own_accts is None: + own_accts = settings.get_accounts() authorslist = [] for aname, aaddress in self.get_authors(): - if aaddress in own_addrs: - aname = settings.get('thread_authors_me') + for account in own_accts: + if account.matches_address(aaddress): + aname = settings.get('thread_authors_me') + break if not aname: aname = aaddress if aname not in authorslist: -- cgit v1.2.3