From 8448de9d8a81225ac43f625c4bd99358e4329546 Mon Sep 17 00:00:00 2001 From: Johannes Kulick Date: Thu, 13 Dec 2012 12:16:18 +0100 Subject: 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) --- alot/buffers.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'alot/buffers.py') 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 -- cgit v1.2.3