aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2009-10-04 19:28:41 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2009-10-04 19:28:41 +0100
commitbdad4079b4bbc8209bf17c81cafbf699f8c6d90d (patch)
tree7a9e633e5a42e56c3ca74c7327a6d3a456d66344
parentc3e349e0847b5b936d1040c56ea427a7f2ce0d7c (diff)
Fixing a crash bug that causes crashes only with buggy Jabber conference
servers, sending a "you left this chat" without first acknowledging you entering it.
-rw-r--r--protocols/jabber/conference.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c
index 08bef4f5..f434c58a 100644
--- a/protocols/jabber/conference.c
+++ b/protocols/jabber/conference.c
@@ -284,12 +284,15 @@ void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bu
}
else if( type ) /* type can only be NULL or "unavailable" in this function */
{
- s = strchr( bud->ext_jid, '/' );
- if( s ) *s = 0;
- imcb_chat_remove_buddy( chat, bud->ext_jid, NULL );
- if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS )
- imcb_remove_buddy( ic, bud->ext_jid, NULL );
- if( s ) *s = '/';
+ if( ( bud->flags & JBFLAG_IS_CHATROOM ) && bud->ext_jid )
+ {
+ s = strchr( bud->ext_jid, '/' );
+ if( s ) *s = 0;
+ imcb_chat_remove_buddy( chat, bud->ext_jid, NULL );
+ if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS )
+ imcb_remove_buddy( ic, bud->ext_jid, NULL );
+ if( s ) *s = '/';
+ }
if( bud == jc->me )
jabber_chat_free( chat );