summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-09-17 17:40:09 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-09-17 17:40:09 +0100
commitfca437cfda167e62edd9234f73c61ad45ccfb05e (patch)
treece7ca8177aa3de74f72718950a27fa9bc49f7579
parent098577ab640e387069b2c2546581ed677fc810a8 (diff)
fix: forwarding
-rw-r--r--alot/command.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/alot/command.py b/alot/command.py
index 57f7d617..393aafdc 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -387,10 +387,15 @@ class ComposeCommand(Command):
#get To header
if 'To' not in self.mail:
- allbooks = settings.config.getboolean('general',
+ name, addr = email.Utils.parseaddr(unicode(self.mail.get('From')))
+ a = ui.accountman.get_account_by_address(addr)
+
+ allbooks = not settings.config.getboolean('general',
'complete_matching_abook_only')
+ ui.logger.debug(allbooks)
abooks = ui.accountman.get_addressbooks(order=[a],
- append_remaining=not allbooks)
+ append_remaining=allbooks)
+ ui.logger.debug(abooks)
to = yield ui.prompt(prefix='To>',
completer=ContactsCompleter(abooks))
if to == None:
@@ -614,10 +619,10 @@ class ForwardCommand(Command):
timestamp = self.message.get_date()
qf = settings.hooks.get('forward_prefix')
if qf:
- quotestring = qf(name, address, timestamp)
+ quote = qf(name, address, timestamp)
else:
- quotestring = 'Forwarded message from %s (%s):\n' % (name, timestamp)
- mailcontent = quotestring
+ quote = 'Forwarded message from %s (%s):\n' % (name, timestamp)
+ mailcontent = quote
for line in self.message.accumulate_body().splitlines():
mailcontent += '>' + line + '\n'