aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-11 22:56:58 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-11 22:56:58 +0100
commitd6ebb164d48c86f1662be973c368ebcaa1235115 (patch)
tree5ebe8c4e183ad96bdc4c0e4beeb4326ac120140c /src/main/java/de/pixart/messenger
parent945cea7ce5d7102d35c255e2f09d27ac14fb1620 (diff)
send text automatically via sharewithactivity
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShareWithActivity.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
index 329c03211..d9b0695ef 100644
--- a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
@@ -386,7 +386,23 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
callback.onPresenceSelected();
}
} else {
- switchToConversation(conversation, this.share.text, true);
+ final OnPresenceSelected callback = new OnPresenceSelected() {
+ @Override
+ public void onPresenceSelected() {
+ Message message = new Message(conversation,share.text, conversation.getNextEncryption());
+ if (conversation.getNextEncryption() == Message.ENCRYPTION_OTR) {
+ message.setCounterpart(conversation.getNextCounterpart());
+ }
+ xmppConnectionService.sendMessage(message);
+ replaceToast(getString(R.string.shared_text_with_x, conversation.getName()));
+ switchToConversation(message.getConversation());
+ }
+ };
+ if (conversation.getNextEncryption() == Message.ENCRYPTION_OTR) {
+ selectPresence(conversation, callback);
+ } else {
+ callback.onPresenceSelected();
+ }
}
}