changeset 8357:1f56ea865926

[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 <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 28 Feb 2004 05:48:01 +0000
parents 8f2667524c06
children bd3c028bff29
files src/protocols/yahoo/yahoo.c src/protocols/yahoo/yahoochat.c
diffstat 2 files changed, 28 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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++];
--- 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);
 	}