aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-08 02:06:00 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-08 02:06:00 +0100
commit905a79fca8c0770276c3ee68f88883c7140c6cf6 (patch)
tree7dbf0be3e9de318c9ff8b0cc15f37e0dd431a731 /src/eu/siacs/conversations/services
parenta1b72313d7858a69c794d706e7ebb00a50a7000a (diff)
fixed #3
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index d0a879b4..63f52a8e 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -175,11 +175,12 @@ public class XmppConnectionService extends Service {
@Override
public void onStatusChanged(Account account) {
- Log.d(LOGTAG,account.getJid()+" status switched to " + account.getStatus());
if (accountChangedListener != null) {
- Log.d(LOGTAG,"notifiy ui");
accountChangedListener.onAccountListChangedListener();
}
+ if (account.getXmppConnection().hasFeatureRosterManagment()) {
+ updateRoster(account, null);
+ }
if (account.getStatus() == Account.STATUS_ONLINE) {
databaseBackend.clearPresences(account);
connectMultiModeConversations(account);
@@ -612,7 +613,12 @@ public class XmppConnectionService extends Service {
IqPacket iqPacket = new IqPacket(IqPacket.TYPE_GET);
Element query = new Element("query");
query.setAttribute("xmlns", "jabber:iq:roster");
- query.setAttribute("ver", account.getRosterVersion());
+ if (!"".equals(account.getRosterVersion())) {
+ Log.d(LOGTAG,account.getJid()+ ": fetching roster version "+account.getRosterVersion());
+ query.setAttribute("ver", account.getRosterVersion());
+ } else {
+ Log.d(LOGTAG,account.getJid()+": fetching roster");
+ }
iqPacket.addChild(query);
account.getXmppConnection().sendIqPacket(iqPacket,
new OnIqPacketReceived() {
@@ -622,6 +628,7 @@ public class XmppConnectionService extends Service {
IqPacket packet) {
Element roster = packet.findChild("query");
if (roster != null) {
+ Log.d(LOGTAG,account.getJid()+": processing roster");
processRosterItems(account, roster);
StringBuilder mWhere = new StringBuilder();
mWhere.append("jid NOT IN(");
@@ -645,6 +652,8 @@ public class XmppConnectionService extends Service {
null);
}
+ } else {
+ Log.d(LOGTAG,account.getJid()+": empty roster returend");
}
mergePhoneContactsWithRoster(new OnPhoneContactsMerged() {