From 655565ecccc722ad72e2dbad247d67dbc1b2a911 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 22 May 2014 20:54:54 +0200 Subject: display pgp key id in muc details and use keys to encrypt groupchat --- src/eu/siacs/conversations/crypto/PgpEngine.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/eu/siacs/conversations/crypto') diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java index 0f2aeff4..b10275f6 100644 --- a/src/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/eu/siacs/conversations/crypto/PgpEngine.java @@ -17,6 +17,7 @@ import org.openintents.openpgp.util.OpenPgpApi.IOpenPgpCallback; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; +import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.ui.UiCallback; @@ -114,10 +115,15 @@ public class PgpEngine { } public void encrypt(final Message message,final UiCallback callback) { - long[] keys = { message.getConversation().getContact().getPgpKeyId() }; + Intent params = new Intent(); params.setAction(OpenPgpApi.ACTION_ENCRYPT); - params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys); + if (message.getConversation().getMode() == Conversation.MODE_SINGLE) { + long[] keys = { message.getConversation().getContact().getPgpKeyId() }; + params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys); + } else { + params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, message.getConversation().getMucOptions().getPgpKeyIds()); + } params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, message.getConversation().getAccount().getJid()); if (message.getType() == Message.TYPE_TEXT) { -- cgit v1.2.3