]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Presence packets from a client who's connected with our Jabber ID are
authorPhilippe Sultan <philippe.sultan@gmail.com>
Sun, 7 Oct 2007 16:15:39 +0000 (16:15 +0000)
committerPhilippe Sultan <philippe.sultan@gmail.com>
Sun, 7 Oct 2007 16:15:39 +0000 (16:15 +0000)
valid, therefore, those clients must be considered as buddies. The resource
string helps us make the distinction between clients.

Closes issue #10707, reported by yusufmotiwala.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84902 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_jabber.c

index 25f741d1596525be47264dab037c9a9660f2b690..35ed4b28352e371819ac34c70791f972014893ea 100644 (file)
@@ -1170,8 +1170,12 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak)
                aji_create_buddy(pak->from->partial, client);
 
        buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
-       if (!buddy) {
-               ast_log(LOG_NOTICE, "Got presence packet from %s, someone not in our roster!!!!\n", pak->from->partial);
+       if (!buddy && pak->from->partial) {
+               /* allow our jid to be used to log in with another resource */
+               if (!strcmp((const char *)pak->from->partial, (const char *)client->jid->partial))
+                       aji_create_buddy(pak->from->partial, client);
+               else
+                       ast_log(LOG_NOTICE, "Got presence packet from %s, someone not in our roster!!!!\n", pak->from->partial);
                return;
        }
        type = iks_find_attrib(pak->x, "type");