summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-09-18 21:53:24 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-09-22 10:30:37 +0100
commitcd049ac737157392956dc5c4c097f513a08f5635 (patch)
treeb525e3537f3802e87fbcaceb521d15f43337e1b0 /alot
parent37f4e4faaed9643bda6cb5e5000b3455a7a39898 (diff)
directly use "realname <address>" in AccountCompleter
instead of only completing addresses and afterwards looking up a matching account
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/globals.py7
-rw-r--r--alot/completion.py3
2 files changed, 3 insertions, 7 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 3f57faa4..5ff72c7f 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -668,12 +668,7 @@ class ComposeCommand(Command):
if fromaddress is None:
ui.notify('canceled')
return
- a = settings.get_account_by_address(fromaddress)
- if a is not None:
- fromstring = "%s <%s>" % (a.realname, a.address)
- self.envelope.add('From', fromstring)
- else:
- self.envelope.add('From', fromaddress)
+ self.envelope.add('From', fromaddress)
# add signature
if not self.omit_signature:
diff --git a/alot/completion.py b/alot/completion.py
index c2b0e18e..c3bc60d6 100644
--- a/alot/completion.py
+++ b/alot/completion.py
@@ -263,7 +263,8 @@ class AccountCompleter(StringlistCompleter):
"""completes users' own mailaddresses"""
def __init__(self, **kwargs):
- resultlist = settings.get_main_addresses()
+ accounts = settings.get_accounts()
+ resultlist = ["%s <%s>" % (a.realname, a.address) for a in accounts]
StringlistCompleter.__init__(self, resultlist, match_anywhere=True,
**kwargs)