aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-11-26 17:44:11 +0100
committerDaniel Gultsch <daniel@gultsch.de>2015-11-26 17:44:11 +0100
commit23ef1c660a828c58e12a9134e0de2d012496cdc2 (patch)
tree5aa9e8e135d9020ff6f7291345219d00aa6bc47d /src/main/java/eu/siacs
parentfd6ed5b98984fa09f98b78cbe3e782a497c62c19 (diff)
encrypt pgp messages to self
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/PgpEngine.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
index 797a75b01..624d1b139 100644
--- a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
+++ b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
@@ -130,18 +130,18 @@ public class PgpEngine {
}
}
- public void encrypt(final Message message,
- final UiCallback<Message> callback) {
-
+ public void encrypt(final Message message, final UiCallback<Message> callback) {
Intent params = new Intent();
params.setAction(OpenPgpApi.ACTION_ENCRYPT);
- if (message.getConversation().getMode() == Conversation.MODE_SINGLE) {
- long[] keys = { message.getConversation().getContact()
- .getPgpKeyId() };
+ final Conversation conversation = message.getConversation();
+ if (conversation.getMode() == Conversation.MODE_SINGLE) {
+ long[] keys = {
+ conversation.getContact().getPgpKeyId(),
+ conversation.getAccount().getPgpId()
+ };
params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys);
} else {
- params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, message.getConversation()
- .getMucOptions().getPgpKeyIds());
+ params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, conversation.getMucOptions().getPgpKeyIds());
}
if (!message.needsUploading()) {