aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-13 18:09:40 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-13 18:09:40 +0200
commit7dfe4ae0823238da216088f80de40b9ff6b1446d (patch)
tree59bbc5457190b465ff9b5f653cec139198f37faa /src/eu/siacs/conversations/services
parent27d5966ac356fd10365d848332b127b0b8f417da (diff)
some code cleanup. added setting to auto accept files. socks5 connections are now threaded
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 986087d2..63ab0897 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -124,9 +124,7 @@ public class XmppConnectionService extends Service {
MessagePacket packet) {
Message message = null;
boolean notify = true;
- if(PreferenceManager
- .getDefaultSharedPreferences(getApplicationContext())
- .getBoolean("notification_grace_period_after_carbon_received", true)){
+ if(getPreferences().getBoolean("notification_grace_period_after_carbon_received", true)){
notify=(SystemClock.elapsedRealtime() - lastCarbonMessageReceived) > CARBON_GRACE_PERIOD;
}
@@ -625,8 +623,7 @@ public class XmppConnectionService extends Service {
}
public XmppConnection createConnection(Account account) {
- SharedPreferences sharedPref = PreferenceManager
- .getDefaultSharedPreferences(getApplicationContext());
+ SharedPreferences sharedPref = getPreferences();
account.setResource(sharedPref.getString("resource", "mobile").toLowerCase(Locale.getDefault()));
XmppConnection connection = new XmppConnection(account, this.pm);
connection.setOnMessagePacketReceivedListener(this.messageListener);
@@ -1204,8 +1201,7 @@ public class XmppConnectionService extends Service {
}
public void createContact(Contact contact) {
- SharedPreferences sharedPref = PreferenceManager
- .getDefaultSharedPreferences(getApplicationContext());
+ SharedPreferences sharedPref = getPreferences();
boolean autoGrant = sharedPref.getBoolean("grant_new_contacts", true);
if (autoGrant) {
contact.setSubscriptionOption(Contact.Subscription.PREEMPTIVE_GRANT);
@@ -1396,4 +1392,8 @@ public class XmppConnectionService extends Service {
convChangedListener.onConversationListChanged();
}
}
+
+ public SharedPreferences getPreferences() {
+ return PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ }
}