From 4180da12e3d4244557484eaa271baf604b0baa4e Mon Sep 17 00:00:00 2001 From: vrs Date: Sat, 8 Dec 2018 23:21:20 +0100 Subject: rename get_account_by_address to account_matching_address ... since accounts' addresses can overlap and get_account_by_address promises too much. Also remove now-obsolete get_addresses. --- alot/account.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'alot/account.py') diff --git a/alot/account.py b/alot/account.py index 116c3417..f4a360a4 100644 --- a/alot/account.py +++ b/alot/account.py @@ -250,12 +250,6 @@ class Account(object): u'^' + str(self.alias_regexp) + u'$', flags=0 if case_sensitive_username else re.IGNORECASE) - - def get_addresses(self): - """return all email addresses connected to this account, in order of - their importance""" - return [self.address] + self.aliases - def matches_address(self, address): """returns whether this account knows about an email address @@ -267,9 +261,8 @@ class Account(object): for alias in self.aliases: if alias == address: return True - if self._alias_regexp is not None: - if self._alias_regexp.match(address): - return True + if self._alias_regexp and self._alias_regexp.match(address): + return True return False @staticmethod -- cgit v1.2.3