diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-05-08 11:53:00 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-05-08 11:53:00 +0200 |
commit | dc73a25ae4c0729052f858af830707411463e43f (patch) | |
tree | 527f26da9e9e328c5dadacfba2c2f207e9af07ee /src/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | 0d8bf660db579c863459d2409175d9d9d8baacf0 (diff) |
code cleanup
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 6b67c419b..3581d189a 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -451,18 +451,14 @@ public class XmppConnectionService extends Service { final Message message = new Message(conversation, "",Message.ENCRYPTION_NONE); message.setPresence(presence); message.setType(Message.TYPE_IMAGE); - message.setStatus(Message.STATUS_PREPARING); - conversation.getMessages().add(message); - if (convChangedListener != null) { - convChangedListener.onConversationListChanged(); - } + message.setStatus(Message.STATUS_OFFERED); new Thread(new Runnable() { @Override public void run() { getFileBackend().copyImageToPrivateStorage(message, uri); - message.setStatus(Message.STATUS_OFFERED); databaseBackend.createMessage(message); + conversation.getMessages().add(message); if (convChangedListener != null) { convChangedListener.onConversationListChanged(); } @@ -477,14 +473,13 @@ public class XmppConnectionService extends Service { final Message message = new Message(conversation, "",Message.ENCRYPTION_DECRYPTED); message.setPresence(presence); message.setType(Message.TYPE_IMAGE); - message.setStatus(Message.STATUS_PREPARING); + message.setStatus(Message.STATUS_OFFERED); new Thread(new Runnable() { @Override public void run() { getFileBackend().copyImageToPrivateStorage(message, uri); getPgpEngine().encrypt(message, callback); - message.setStatus(Message.STATUS_OFFERED); } }).start(); return message; |