aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java11
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;