diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-16 19:48:04 +0200 |
---|---|---|
committer | Andreas Straub <andy@strb.org> | 2014-04-18 00:17:34 +0200 |
commit | e29ce19f202e535f44098f280650ad892c943e52 (patch) | |
tree | 28bc824a5b80c6304dfaf82ee9fa0fed5e9069f4 /src/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | a04d736f75c793dc943c1e0ce7c89e1c20a3a684 (diff) |
fixed #63
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index e9f93a63..07f5a427 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -287,7 +287,11 @@ public class XmppConnectionService extends Service { } else { Contact contact = findContact(account, fromParts[0]); if (contact == null) { - Log.d(LOGTAG,packet.getFrom()+ " could not be found"); + if ("subscribe".equals(type)) { + account.getXmppConnection().addPendingSubscription(fromParts[0]); + } else { + Log.d(LOGTAG,packet.getFrom()+ " could not be found"); + } return; } if (type == null) { @@ -343,7 +347,7 @@ public class XmppConnectionService extends Service { requestPresenceUpdatesFrom(contact); } } else { - // TODO: ask user to handle it maybe + account.getXmppConnection().addPendingSubscription(fromParts[0]); } } else { //Log.d(LOGTAG, packet.toString()); @@ -1232,6 +1236,10 @@ public class XmppConnectionService extends Service { account.getXmppConnection().sendIqPacket(iq, null); if (autoGrant) { requestPresenceUpdatesFrom(contact); + if (account.getXmppConnection().hasPendingSubscription(contact.getJid())) { + Log.d("xmppService","contact had pending subscription"); + sendPresenceUpdatesTo(contact); + } } replaceContactInConversation(contact.getJid(), contact); } |