diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-06-23 21:48:48 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-06-23 21:48:48 +0200 |
commit | d7656dd420d2215de776b3665760f867aee6bea4 (patch) | |
tree | 895913dd40dbf431e7a7878897fc4e988bff73f7 /src | |
parent | 43e276e3250ced19d7bd2d45d99ecbf6debce6a3 (diff) |
fix for not being able to send otr encrypted images to offline contacts. unconfirmed
Diffstat (limited to 'src')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 356342b4..f71a6d78 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -760,29 +760,29 @@ public class XmppConnectionService extends Service { private void resendMessage(Message message) { Account account = message.getConversation().getAccount(); - if (message.getType() == Message.TYPE_TEXT) { + if (message.getEncryption() == Message.ENCRYPTION_OTR) { + Presences presences = message.getConversation().getContact() + .getPresences(); + if (!message.getConversation().hasValidOtrSession()) { + if ((message.getPresence() != null) + && (presences.has(message.getPresence()))) { + message.getConversation().startOtrSession( + getApplicationContext(), message.getPresence(), + true); + } else { + if (presences.size() == 1) { + String presence = presences.asStringArray()[0]; + message.getConversation().startOtrSession( + getApplicationContext(), presence, true); + } + } + } + } else if (message.getType() == Message.TYPE_TEXT) { MessagePacket packet = null; if (message.getEncryption() == Message.ENCRYPTION_NONE) { packet = mMessageGenerator.generateChat(message,true); } else if ((message.getEncryption() == Message.ENCRYPTION_DECRYPTED)||(message.getEncryption() == Message.ENCRYPTION_PGP)) { packet = mMessageGenerator.generatePgpChat(message,true); - } else if (message.getEncryption() == Message.ENCRYPTION_OTR) { - Presences presences = message.getConversation().getContact() - .getPresences(); - if (!message.getConversation().hasValidOtrSession()) { - if ((message.getPresence() != null) - && (presences.has(message.getPresence()))) { - message.getConversation().startOtrSession( - getApplicationContext(), message.getPresence(), - true); - } else { - if (presences.size() == 1) { - String presence = presences.asStringArray()[0]; - message.getConversation().startOtrSession( - getApplicationContext(), presence, true); - } - } - } } if (packet != null) { account.getXmppConnection().sendMessagePacket(packet); |