# HG changeset patch # User Luke Schierer # Date 1077947281 0 # Node ID 1f56ea865926e88422f7da37201e96dc890c0bba # Parent 8f2667524c06ebcfa3f222b593cc8781011d1576 [gaim-migrate @ 9081] " This fixes some bugs in joining a yahoo chat after you've already joined a yahoo chat. these bugs were introduced by me of course. Well, they're half my changes I made in CVS, and half the odd way I coded yahoo chat support to begin with. So yeah, all my fault... This also adds a pos++ like nosnilmot was saying." --Tim (marv) Ringenbach committer: Tailor Script diff -r 8f2667524c06 -r 1f56ea865926 src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Sat Feb 28 05:45:59 2004 +0000 +++ b/src/protocols/yahoo/yahoo.c Sat Feb 28 05:48:01 2004 +0000 @@ -134,6 +134,7 @@ break; if (x >= sizeof(key)-1) { x++; + pos++; continue; } key[x++] = data[pos++]; diff -r 8f2667524c06 -r 1f56ea865926 src/protocols/yahoo/yahoochat.c --- a/src/protocols/yahoo/yahoochat.c Sat Feb 28 05:45:59 2004 +0000 +++ b/src/protocols/yahoo/yahoochat.c Sat Feb 28 05:48:01 2004 +0000 @@ -407,15 +407,33 @@ c = gaim_find_chat(gc, YAHOO_CHAT_ID); - if (!c && members && ((g_list_length(members) > 1) || - !g_ascii_strcasecmp(members->data, - gaim_connection_get_display_name(gc)))) { - c = serv_got_joined_chat(gc, YAHOO_CHAT_ID, room); - if (topic) - gaim_conv_chat_set_topic(GAIM_CONV_CHAT(c), NULL, topic); - yd->in_chat = 1; - yd->chat_name = g_strdup(room); - gaim_conv_chat_add_users(GAIM_CONV_CHAT(c), members); + if ((!c || gaim_conv_chat_has_left(GAIM_CONV_CHAT(c))) && members && + ((g_list_length(members) > 1) || + !g_ascii_strcasecmp(members->data, gaim_connection_get_display_name(gc)))) { + if (c && gaim_conv_chat_has_left(GAIM_CONV_CHAT(c))) { + /* this might be a hack, but oh well, it should nicely */ + char *tmpmsg; + + gaim_conversation_set_name(c, room); + + c = serv_got_joined_chat(gc, YAHOO_CHAT_ID, room); + if (topic) + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(c), NULL, topic); + yd->in_chat = 1; + yd->chat_name = g_strdup(room); + gaim_conv_chat_add_users(GAIM_CONV_CHAT(c), members); + + tmpmsg = g_strdup_printf(_("You are now chatting in %s."), room); + gaim_conv_chat_write(GAIM_CONV_CHAT(c), "", tmpmsg, GAIM_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } else { + c = serv_got_joined_chat(gc, YAHOO_CHAT_ID, room); + if (topic) + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(c), NULL, topic); + yd->in_chat = 1; + yd->chat_name = g_strdup(room); + gaim_conv_chat_add_users(GAIM_CONV_CHAT(c), members); + } } else if (c) { yahoo_chat_add_users(GAIM_CONV_CHAT(c), members); }