aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-01-09 16:17:39 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-01-09 16:17:39 +0100
commit4ab8fe13dea85e23f856bbe853fbf81af908edea (patch)
treefedba70c6363b0ff228dfd7940da7b29240d812a /src/main/java
parent708d7c5b98e71c5b5b02a2d4c721b70cea0db906 (diff)
let the user decide on whether or not to compress pictures
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 5c7cceb3..e707fc98 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -414,8 +414,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
}
public void attachImageToConversation(final Conversation conversation, final Uri uri, final UiCallback<Message> callback) {
- if (getFileBackend().useImageAsIs(uri)) {
- Log.d(Config.LOGTAG, "using image as is");
+ final String compressPictures = getCompressPicturesPreference();
+ if ("never".equals(compressPictures)
+ || ("auto".equals(compressPictures) && getFileBackend().useImageAsIs(uri))) {
+ Log.d(Config.LOGTAG,conversation.getAccount().getJid().toBareJid()+ ": not compressing picture. sending as file");
attachFileToConversation(conversation, uri, callback);
return;
}
@@ -590,6 +592,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
return getPreferences().getBoolean("away_when_screen_off", false);
}
+ private String getCompressPicturesPreference() {
+ return getPreferences().getString("picture_compression", "auto");
+ }
+
private int getTargetPresence() {
if (xaOnSilentMode() && isPhoneSilenced()) {
return Presences.XA;