aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-02 21:45:19 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-02 21:45:19 +0200
commit95521e80c1c029b02eddf5799cd23d0268ae4a1c (patch)
treed1bf1fdca1cf9bf9465d639d50c8ce10817422f6 /src/main
parenta6aa3be7a4f658350254e86f84391534c0502653 (diff)
fixed duplicate file sending
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java1
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShareWithActivity.java3
3 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
index 780be831b..49fa0f572 100644
--- a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
+++ b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
@@ -139,7 +139,6 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
if (message.getEncryption() == Message.ENCRYPTION_DECRYPTED) {
mXmppConnectionService.getPgpEngine().encrypt(message, callback);
} else {
- mXmppConnectionService.sendMessage(message);
callback.success(message);
}
}
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index afed51f85..85ad64206 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -521,6 +521,7 @@ public class XmppConnectionService extends Service {
}
final String mimeType = MimeUtils.guessMimeTypeFromUri(this, uri);
final String compressPictures = getCompressPicturesPreference();
+
if ("never".equals(compressPictures)
|| ("auto".equals(compressPictures) && getFileBackend().useImageAsIs(uri))
|| (mimeType != null && mimeType.endsWith("/gif"))) {
diff --git a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
index ad0ed109d..cbd2ca0eb 100644
--- a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
@@ -84,7 +84,6 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
@Override
public void success(final Message message) {
- xmppConnectionService.sendMessage(message);
runOnUiThread(() -> {
if (attachmentCounter.decrementAndGet() <= 0) {
int resId;
@@ -366,6 +365,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
} else {
if (mReturnToPrevious && this.share.text != null && !this.share.text.isEmpty()) {
final PresenceSelector.OnPresenceSelected callback = new PresenceSelector.OnPresenceSelected() {
+
private void finishAndSend(Message message) {
replaceToast(getString(R.string.shared_text_with_x, conversation.getName()));
finish();
@@ -374,7 +374,6 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
private UiCallback<Message> messageEncryptionCallback = new UiCallback<Message>() {
@Override
public void success(final Message message) {
- message.setEncryption(Message.ENCRYPTION_DECRYPTED);
runOnUiThread(() -> finishAndSend(message));
}