diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-06-13 15:05:35 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-06-13 15:05:35 +0200 |
commit | 76f3894107e2d2513a48ac66a9c4a76d9d75554a (patch) | |
tree | e4f9faea95f4cc32fe00b18bff5ee4cb10c52962 /src/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | eb7ed786055a45401dc2f688fc0fbcec5da0f89e (diff) |
status waiting for images sent offline
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 154b317e..026f212b 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -650,7 +650,13 @@ public class XmppConnectionService extends Service { boolean send = false; if (account.getStatus() == Account.STATUS_ONLINE) { if (message.getType() == Message.TYPE_IMAGE) { - mJingleConnectionManager.createNewConnection(message); + if (message.getPresence() !=null ) { + mJingleConnectionManager.createNewConnection(message); + } else { + message.setStatus(Message.STATUS_WAITING); + saveInDb = true; + addToConversation = true; + } } else { if (message.getEncryption() == Message.ENCRYPTION_OTR) { if (!conv.hasValidOtrSession()&&(message.getPresence() != null)) { @@ -693,29 +699,35 @@ public class XmppConnectionService extends Service { } } } else { - if (message.getEncryption() == Message.ENCRYPTION_PGP) { - String pgpBody = message.getEncryptedBody(); - String decryptedBody = message.getBody(); - message.setBody(pgpBody); - databaseBackend.createMessage(message); - message.setEncryption(Message.ENCRYPTION_DECRYPTED); - message.setBody(decryptedBody); - addToConversation = true; - } else if (message.getEncryption() == Message.ENCRYPTION_OTR) { - if (conv.hasValidOtrSession()) { - message.setPresence(conv.getOtrSession().getSessionID() - .getUserID()); - } else if (!conv.hasValidOtrSession() && message.getPresence() != null) { - conv.startOtrSession(getApplicationContext(), - message.getPresence(), false); - } else if (message.getPresence() == null) { - message.setStatus(Message.STATUS_WAITING); - } + if (message.getType() == Message.TYPE_IMAGE) { + message.setStatus(Message.STATUS_WAITING); saveInDb = true; addToConversation = true; } else { - saveInDb = true; - addToConversation = true; + if (message.getEncryption() == Message.ENCRYPTION_PGP) { + String pgpBody = message.getEncryptedBody(); + String decryptedBody = message.getBody(); + message.setBody(pgpBody); + databaseBackend.createMessage(message); + message.setEncryption(Message.ENCRYPTION_DECRYPTED); + message.setBody(decryptedBody); + addToConversation = true; + } else if (message.getEncryption() == Message.ENCRYPTION_OTR) { + if (conv.hasValidOtrSession()) { + message.setPresence(conv.getOtrSession().getSessionID() + .getUserID()); + } else if (!conv.hasValidOtrSession() && message.getPresence() != null) { + conv.startOtrSession(getApplicationContext(), + message.getPresence(), false); + } else if (message.getPresence() == null) { + message.setStatus(Message.STATUS_WAITING); + } + saveInDb = true; + addToConversation = true; + } else { + saveInDb = true; + addToConversation = true; + } } } |