diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-22 15:36:41 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-28 10:41:55 +0200 |
commit | fd4897e1a5a843c8b55b28b00afa6778b345c9a5 (patch) | |
tree | 9e7ee33bbcf36a99c9dc77c45baa26bda5c75dc8 /src/eu/siacs/conversations/ui/ConversationFragment.java | |
parent | f4ce5082b9743743b8d2623401898ce9516acbd4 (diff) |
first tries on crypto muc
Diffstat (limited to 'src/eu/siacs/conversations/ui/ConversationFragment.java')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationFragment.java | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index 44d1848f..a3cecfd4 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -678,37 +678,41 @@ public class ConversationFragment extends Fragment { final XmppConnectionService xmppService = activity.xmppConnectionService; final Contact contact = message.getConversation().getContact(); if (activity.hasPgp()) { - if (contact.getPgpKeyId() != 0) { - xmppService.getPgpEngine().hasKey(contact, new UiCallback() { - - @Override - public void userInputRequried(PendingIntent pi) { - activity.runIntent(pi, - ConversationActivity.REQUEST_ENCRYPT_MESSAGE); - } - - @Override - public void success() { - activity.encryptTextMessage(); - } - - @Override - public void error(int error) { - - } - }); - + if (conversation.getMode() == Conversation.MODE_SINGLE) { + if (contact.getPgpKeyId() != 0) { + xmppService.getPgpEngine().hasKey(contact, new UiCallback() { + + @Override + public void userInputRequried(PendingIntent pi) { + activity.runIntent(pi, + ConversationActivity.REQUEST_ENCRYPT_MESSAGE); + } + + @Override + public void success() { + activity.encryptTextMessage(); + } + + @Override + public void error(int error) { + + } + }); + + } else { + showNoPGPKeyDialog(new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + conversation.setNextEncryption(Message.ENCRYPTION_NONE); + message.setEncryption(Message.ENCRYPTION_NONE); + xmppService.sendMessage(message, null); + chatMsg.setText(""); + } + }); + } } else { - showNoPGPKeyDialog(new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - conversation.setNextEncryption(Message.ENCRYPTION_NONE); - message.setEncryption(Message.ENCRYPTION_NONE); - xmppService.sendMessage(message, null); - chatMsg.setText(""); - } - }); + activity.encryptTextMessage(); } } } |