diff options
author | Johannes Kulick <kulick@hildensia.de> | 2012-12-13 12:16:18 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-02-19 10:10:07 +0000 |
commit | 8448de9d8a81225ac43f625c4bd99358e4329546 (patch) | |
tree | 46f778d0db1b6bcae9de551a828244efd118d6f4 /alot/buffers.py | |
parent | 88e73d066982018fdd666e49ec33c3f81419098c (diff) |
support multiple recipients in encryption
Multiple recipient-keys can be specified. They are shown in the envelope buffer.
A new command is introduced: 'rmencrypt' do remove a key from the encryption
lsit. Unfortunately pygpgme doesn't implement __cmp__() so we have to either
write something similar on our own or use this solution (index of the key in
encryption list)
Diffstat (limited to 'alot/buffers.py')
-rw-r--r-- | alot/buffers.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/alot/buffers.py b/alot/buffers.py index 117eecce..8f344081 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -154,9 +154,20 @@ class EnvelopeBuffer(Buffer): if self.envelope.encrypt: description = 'Yes' - encrypt_key = self.envelope.encrypt_key - if encrypt_key is not None and len(encrypt_key.subkeys) > 0: - description += ', with key ' + encrypt_key.subkeys[0].keyid + encrypt_keys = self.envelope.encrypt_keys + if len(encrypt_keys) == 1: + description += ', with key ' + elif len(encrypt_keys) > 1: + description += ', with keys ' + first_key = True + for key in encrypt_keys: + if key is not None: + if first_key: + first_key = False + else: + description += ', ' + if len(key.subkeys) > 0: + description += key.subkeys[0].keyid lines.append(('GPG encrypt', description)) # add header list widget iff header values exists |