aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/services/AbstractConnectionManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services/AbstractConnectionManager.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/services/AbstractConnectionManager.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/AbstractConnectionManager.java b/src/main/java/de/thedevstack/conversationsplus/services/AbstractConnectionManager.java
new file mode 100644
index 00000000..0dedc01d
--- /dev/null
+++ b/src/main/java/de/thedevstack/conversationsplus/services/AbstractConnectionManager.java
@@ -0,0 +1,23 @@
+package de.thedevstack.conversationsplus.services;
+
+public class AbstractConnectionManager {
+ protected XmppConnectionService mXmppConnectionService;
+
+ public AbstractConnectionManager(XmppConnectionService service) {
+ this.mXmppConnectionService = service;
+ }
+
+ public XmppConnectionService getXmppConnectionService() {
+ return this.mXmppConnectionService;
+ }
+
+ public long getAutoAcceptFileSize() {
+ String config = this.mXmppConnectionService.getPreferences().getString(
+ "auto_accept_file_size", "524288");
+ try {
+ return Long.parseLong(config);
+ } catch (NumberFormatException e) {
+ return 524288;
+ }
+ }
+}