aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-04-05 23:35:38 +0200
committerlookshe <github@lookshe.org>2016-04-05 23:35:38 +0200
commit0beb3ca30b31f07e374b870e6a659256f6960170 (patch)
tree82a389561691afa508433d338e3f87aa6c8a5c7b /src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java
parent6899b9b01e416da95b9006d9f23bf1e1214f607d (diff)
parentd6a076e11281d4c3fb6b9504fe99d799b04ebbbb (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java
index 3446bfbd..51fe92bb 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/ShareWithActivity.java
@@ -28,8 +28,10 @@ import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.entities.Conversation;
import de.thedevstack.conversationsplus.entities.Message;
+import de.thedevstack.conversationsplus.persistance.FileBackend;
import de.thedevstack.conversationsplus.services.XmppConnectionService;
import de.thedevstack.conversationsplus.ui.adapter.ConversationAdapter;
+import de.thedevstack.conversationsplus.utils.FileUtils;
import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException;
import de.thedevstack.conversationsplus.xmpp.jid.Jid;
@@ -263,6 +265,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
}
private void share(final Conversation conversation) {
+ final Account account = conversation.getAccount();
mListView.setEnabled(false);
if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP && !hasPgp()) {
if (share.uuid == null) {
@@ -274,6 +277,9 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
return;
}
if (share.uris.size() != 0) {
+ final long max = account.getXmppConnection()
+ .getFeatures()
+ .getMaxHttpUploadSize();
OnPresenceSelected callback;
if (this.share.image) {
// TODO: attachementCounter should be set and decremented correctly
@@ -299,7 +305,11 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
}
};
}
- if (conversation.getAccount().httpUploadAvailable()) {
+ if (account.httpUploadAvailable()
+ && ((share.image && !neverCompressPictures())
+ || conversation.getMode() == Conversation.MODE_MULTI
+ || FileUtils.allFilesUnderSize(this, share.uris, max))
+ && conversation.getNextEncryption() != Message.ENCRYPTION_OTR) {
callback.onPresenceSelected();
} else {
selectPresence(conversation, callback);