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.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 81ac77c2..1d59692c 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -356,7 +356,7 @@ public class XmppConnectionService extends Service {
}
public Message attachImageToConversation(final Conversation conversation,
- final Uri uri, final UiCallback callback) {
+ final Uri uri, final UiCallback<Message> callback) {
final Message message;
if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP) {
message = new Message(conversation, "",
@@ -376,10 +376,11 @@ public class XmppConnectionService extends Service {
if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP) {
getPgpEngine().encrypt(message, callback);
} else {
- callback.success();
+ message.ready = true;
+ callback.success(message);
}
} catch (FileBackend.ImageCopyException e) {
- callback.error(e.getResId());
+ callback.error(e.getResId(),message);
}
}
}).start();