diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2009-11-19 18:50:53 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2009-11-19 18:50:53 +0000 |
commit | 08e5bb2bb2fcc7125f837be4f225d3a9ebf320ed (patch) | |
tree | 5fd1e10b069b6515365ed08042f9ed4b9c419327 | |
parent | 20e830b641638bc580e1a58b68fc3c5837e76807 (diff) |
Restoring some logic that seemed broken but was important with handling
of chatrooms (and likely more things). The restored version is somewhat
less confusing.
-rw-r--r-- | protocols/jabber/jabber_util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index ec23919e..120a56b6 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -419,9 +419,13 @@ struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid_, if( ( s = strchr( jid, '/' ) ) ) { + int bare_exists = 0; + *s = 0; if( ( bud = g_hash_table_lookup( jd->buddies, jid ) ) ) { + bare_exists = 1; + if( bud->next ) bud = bud->next; @@ -447,7 +451,8 @@ struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid_, break; } - if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && imcb_find_buddy( ic, jid ) ) + if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && + ( imcb_find_buddy( ic, jid ) || bare_exists ) ) { *s = '/'; bud = jabber_buddy_add( ic, jid ); |