From e5abfd413a797b268db0b107d0748eb7e40da431 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 9 May 2010 12:26:57 +0100 Subject: Safety check for yesterday's fixes: Double-check that a groupchat struct isn't claimed already. --- protocols/msn/sb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 626cc83e..bfdbfe64 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -232,13 +232,16 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ) struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb ) { struct im_connection *ic = sb->ic; + struct groupchat *c = NULL; char buf[1024]; /* Create the groupchat structure. */ g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); if( sb->who ) - sb->chat = bee_chat_by_title( ic->bee, ic, sb->who ); - if( sb->chat == NULL ) + c = bee_chat_by_title( ic->bee, ic, sb->who ); + if( c && !msn_sb_by_chat( c ) ) + sb->chat = c; + else sb->chat = imcb_chat_new( ic, buf ); /* Populate the channel. */ -- cgit v1.2.3