diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/tzur/conversations/Settings.java | 18 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/MessageParser.java | 3 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/de/tzur/conversations/Settings.java b/src/main/java/de/tzur/conversations/Settings.java index cc2ac045..ff253e40 100644 --- a/src/main/java/de/tzur/conversations/Settings.java +++ b/src/main/java/de/tzur/conversations/Settings.java @@ -38,20 +38,34 @@ public final class Settings { case "led_notify_color": Settings.LED_COLOR = preferences.getInt(name, Settings.LED_COLOR); break; + case "auto_download_file_wlan": + Settings.DOWNLOAD_ONLY_WLAN = preferences.getBoolean(name, Settings.DOWNLOAD_ONLY_WLAN); + break; + case "auto_download_file_link": + Settings.DOWNLOAD_IMAGE_LINKS = preferences.getBoolean(name, Settings.DOWNLOAD_IMAGE_LINKS); + break; } } /** * Boolean if emoticons should be parsed to emoticons or not. */ - public static boolean PARSE_EMOTICONS = false; + public static boolean PARSE_EMOTICONS = true; /** * Boolean if online status should be shown or not. */ - public static boolean SHOW_ONLINE_STATUS = false; + public static boolean SHOW_ONLINE_STATUS = true; /** * LED Color */ public static int LED_COLOR = 0xffffffff; + /** + * Boolean if image-links should be downloaded or not. + */ + public static boolean DOWNLOAD_IMAGE_LINKS = true; + /** + * Boolean if automatic downloads should be done only jif connected to WLAN. + */ + public static boolean DOWNLOAD_ONLY_WLAN = true; /** * This is a utility class - private constructor avoids any instantiation. diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 8ae9b642..076de66f 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -3,6 +3,7 @@ package eu.siacs.conversations.parser; import net.java.otr4j.session.Session; import net.java.otr4j.session.SessionStatus; +import de.tzur.conversations.Settings; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; @@ -618,7 +619,7 @@ public class MessageParser extends AbstractParser implements } } final HttpConnectionManager manager = this.mXmppConnectionService.getHttpConnectionManager(); - if (message.trusted() && message.bodyContainsDownloadable() && manager.getAutoAcceptFileSize() > 0) { + if (message.trusted() && Settings.DOWNLOAD_IMAGE_LINKS && message.bodyContainsDownloadable() && manager.getAutoAcceptFileSize() > 0) { manager.createNewConnection(message); } else if (!message.isRead()) { mXmppConnectionService.getNotificationService().push(message); |