summaryrefslogtreecommitdiff
path: root/alot/commands
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-12-06 21:02:48 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2011-12-06 21:02:48 +0000
commit7dbf4f0b27e7adf0ed517ccbdd98c39838ed2fed (patch)
treed5d91f3850a2f0920ef4286d4dba3ad72c5f3335 /alot/commands
parent6de43181363be70c4ba9093604df6297e87c5c80 (diff)
parent9a26e91d4731b40d75842ad979bfd93934a32419 (diff)
Merge branch 'master' into docs
Diffstat (limited to 'alot/commands')
-rw-r--r--alot/commands/envelope.py3
-rw-r--r--alot/commands/thread.py20
2 files changed, 10 insertions, 13 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 07e5b576..4ebe9d5d 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -11,7 +11,6 @@ from alot.commands import Command, registerCommand
from alot import settings
from alot import helper
from alot.message import decode_header
-from alot.message import encode_header
from alot.commands import globals
from alot.helper import string_decode
@@ -203,7 +202,7 @@ class EditCommand(Command):
class SetCommand(Command):
def __init__(self, key, value, append=False, **kwargs):
self.key = key
- self.value = encode_header(key, ' '.join(value))
+ self.value = ' '.join(value)
self.append = append
Command.__init__(self, **kwargs)
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index 19a235bf..fb0d9268 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -13,7 +13,6 @@ from alot import settings
from alot import widgets
from alot import completion
from alot import helper
-from alot.message import encode_header
from alot.message import decode_header
from alot.message import extract_headers
from alot.message import extract_body
@@ -61,7 +60,7 @@ class ReplyCommand(Command):
subject = decode_header(mail.get('Subject', ''))
if not subject.startswith('Re:'):
subject = 'Re: ' + subject
- envelope['Subject'] = Header(subject.encode('utf-8'), 'UTF-8').encode()
+ envelope['Subject'] = subject
# set From
my_addresses = ui.accountman.get_addresses()
@@ -77,7 +76,7 @@ class ReplyCommand(Command):
if matched_address:
account = ui.accountman.get_account_by_address(matched_address)
fromstring = '%s <%s>' % (account.realname, account.address)
- envelope['From'] = encode_header('From', fromstring)
+ envelope['From'] = fromstring
# set To
if self.groupreply:
@@ -85,19 +84,18 @@ class ReplyCommand(Command):
if cleared:
logging.info(mail['From'] + ', ' + cleared)
to = mail['From'] + ', ' + cleared
- envelope['To'] = encode_header('To', to)
- logging.info(envelope['To'])
+ envelope['To'] = to
else:
- envelope['To'] = encode_header('To', mail['From'])
+ envelope['To'] = mail['From']
# copy cc and bcc for group-replies
if 'Cc' in mail:
cc = self.clear_my_address(my_addresses, mail['Cc'])
- envelope['Cc'] = encode_header('Cc', cc)
+ envelope['Cc'] = cc
if 'Bcc' in mail:
bcc = self.clear_my_address(my_addresses, mail['Bcc'])
- envelope['Bcc'] = encode_header('Bcc', bcc)
+ envelope['Bcc'] = bcc
else:
- envelope['To'] = encode_header('To', mail['From'])
+ envelope['To'] = mail['From']
# set In-Reply-To header
envelope['In-Reply-To'] = '<%s>' % self.message.get_message_id()
@@ -172,7 +170,7 @@ class ForwardCommand(Command):
# copy subject
subject = decode_header(mail.get('Subject', ''))
subject = 'Fwd: ' + subject
- envelope['Subject'] = Header(subject.encode('utf-8'), 'UTF-8').encode()
+ envelope['Subject'] = subject
# set From
my_addresses = ui.accountman.get_addresses()
@@ -188,7 +186,7 @@ class ForwardCommand(Command):
if matched_address:
account = ui.accountman.get_account_by_address(matched_address)
fromstring = '%s <%s>' % (account.realname, account.address)
- envelope['From'] = encode_header('From', fromstring)
+ envelope['From'] = fromstring
ui.apply_command(ComposeCommand(envelope=envelope))