aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-21 22:14:52 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-21 22:14:52 +0100
commita9e34d34926d7df3fb01143d6733b481c31c292d (patch)
tree964a4baba3106f775692d4aec7c674f04be38cfb /src/eu/siacs/conversations/services/XmppConnectionService.java
parent079712060c2a61515867e97ffb98c7c4e88e0d5a (diff)
tryed to fix more otr bugs. new resource setting
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 2c905fec..8bc1b389 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -7,6 +7,7 @@ import java.util.Comparator;
import java.util.Date;
import java.util.Hashtable;
import java.util.List;
+import java.util.Locale;
import java.util.Random;
import org.openintents.openpgp.util.OpenPgpApi;
@@ -550,6 +551,9 @@ public class XmppConnectionService extends Service {
}
public XmppConnection createConnection(Account account) {
+ SharedPreferences sharedPref = PreferenceManager
+ .getDefaultSharedPreferences(getApplicationContext());
+ account.setResource(sharedPref.getString("resource", "mobile").toLowerCase(Locale.getDefault()));
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
XmppConnection connection = new XmppConnection(account, pm);
connection.setOnMessagePacketReceivedListener(this.messageListener);
@@ -588,7 +592,7 @@ public class XmppConnectionService extends Service {
return connection;
}
- public void sendMessage(Message message, String presence) {
+ synchronized public void sendMessage(Message message, String presence) {
Account account = message.getConversation().getAccount();
Conversation conv = message.getConversation();
boolean saveInDb = false;