diff options
author | phsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-07 16:15:39 +0000 |
---|---|---|
committer | phsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-07 16:15:39 +0000 |
commit | a93ef7d5e6573961c453ac6b9bd51a669dca34ce (patch) | |
tree | 29b05e28f48808ced34d63e6a222e1695ed4eaaa /res | |
parent | 78c2fc93f28a4d9fbc114a53abe390d73c7f093b (diff) |
Presence packets from a client who's connected with our Jabber ID are
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: http://svn.digium.com/svn/asterisk/branches/1.4@84902 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_jabber.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c index 25f741d15..35ed4b283 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -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"); |