diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-22 20:54:54 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-28 10:41:55 +0200 |
commit | 655565ecccc722ad72e2dbad247d67dbc1b2a911 (patch) | |
tree | c57fb50694b885949190f8c67b132ccc12accf4e /src/eu/siacs/conversations/crypto/PgpEngine.java | |
parent | b605577cd912e9974263b53f65d0614821403680 (diff) |
display pgp key id in muc details and use keys to encrypt groupchat
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/crypto/PgpEngine.java | 10 |
1 files changed, 8 insertions, 2 deletions
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) { |