From 4ab8fe13dea85e23f856bbe853fbf81af908edea Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 9 Jan 2016 16:17:39 +0100 Subject: let the user decide on whether or not to compress pictures --- .../eu/siacs/conversations/services/XmppConnectionService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/eu/siacs') 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 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; -- cgit v1.2.3