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/oscar/oscar.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 2d07f912..94dd876e 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -786,6 +786,7 @@ static int gaim_parse_logout(aim_session_t *sess, aim_frame_t *fr, ...) { static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) { struct im_connection *ic = sess->aux_data; struct chat_connection *chatcon; + struct groupchat *c = NULL; static int id = 1; aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, gaim_parse_genericerr, 0); @@ -798,8 +799,11 @@ static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) { chatcon = find_oscar_chat_by_conn(ic, fr->conn); chatcon->id = id; - chatcon->cnv = bee_chat_by_title(ic->bee, ic, chatcon->show); - if (chatcon->cnv == NULL) + + c = bee_chat_by_title(ic->bee, ic, chatcon->show); + if (c && !c->data) + chatcon->cnv = c; + else chatcon->cnv = imcb_chat_new(ic, chatcon->show); chatcon->cnv->data = chatcon; -- cgit v1.2.3