diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-06-22 00:34:11 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-06-22 00:34:11 +0100 |
commit | 3e6764ab9c8ebd99683fd3c153161d96b32e05de (patch) | |
tree | 1e22cd39243eb1f497c37822ea5458836ff8672a /protocols/jabber/jabber_util.c | |
parent | edc767b8781d7c56ab3cfe67e2c816694722f5d0 (diff) |
Added jabber_util unittests (buddy_add/_by_jid only ATM).
Diffstat (limited to 'protocols/jabber/jabber_util.c')
-rw-r--r-- | protocols/jabber/jabber_util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index 518624f6..78d1009c 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -524,7 +524,9 @@ int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ ) /* If there's only one item in the list (and if the resource matches), removing it is simple. (And the hash reference should be removed too!) */ - if( bud->next == NULL && ( ( s == NULL || bud->resource == NULL ) || g_strcasecmp( bud->resource, s + 1 ) == 0 ) ) + if( bud->next == NULL && + ( ( s == NULL && bud->resource == NULL ) || + ( bud->resource && s && g_strcasecmp( bud->resource, s + 1 ) == 0 ) ) ) { g_hash_table_remove( jd->buddies, bud->bare_jid ); g_free( bud->bare_jid ); |