changeset 8410:3c07b7d0084c

[gaim-migrate @ 9140] quoth marv: " This makes joining those chats with the arabic script in their names actually work, and lets you see people typing in arabic in UTF-8, instead of parsing it as ISO-8859-1. It probably fixes similiar problems with other languages, but the arabic text standed out the most in the room list. It's pretty simple, and doesn't change any strings. It's against yahoochat.c, you'll probably have to patch the file specificly since I diffed it specificly. If you need an example to test again, look through the room list. That's how I noticed this didn't already work." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 08 Mar 2004 19:06:17 +0000
parents 6f30052c31dc
children 34896b4a0da3
files src/protocols/yahoo/yahoochat.c
diffstat 1 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoochat.c	Mon Mar 08 17:57:32 2004 +0000
+++ b/src/protocols/yahoo/yahoochat.c	Mon Mar 08 19:06:17 2004 +0000
@@ -357,10 +357,10 @@
 		switch (pair->key) {
 
 		case 104:
-			room = yahoo_string_decode(gc, pair->value, FALSE);
+			room = yahoo_string_decode(gc, pair->value, TRUE);
 			break;
 		case 105:
-			topic = yahoo_string_decode(gc, pair->value, FALSE);
+			topic = yahoo_string_decode(gc, pair->value, TRUE);
 			break;
 		case 128:
 			someid = pair->value;
@@ -457,7 +457,7 @@
 		struct yahoo_pair *pair = l->data;
 
 		if (pair->key == 104)
-			room = yahoo_string_decode(gc, pair->value, FALSE);
+			room = yahoo_string_decode(gc, pair->value, TRUE);
 		if (pair->key == 109)
 			who = pair->value;
 	}
@@ -476,7 +476,7 @@
 void yahoo_process_chat_message(GaimConnection *gc, struct yahoo_packet *pkt)
 {
 	char *room = NULL, *who = NULL, *msg = NULL, *msg2;
-	int msgtype = 1, utf8 = 0;
+	int msgtype = 1, utf8 = 1; /* default to utf8 */
 	GaimConversation *c = NULL;
 	GSList *l;
 
@@ -489,7 +489,7 @@
 			utf8 = strtol(pair->value, NULL, 10);
 			break;
 		case 104:
-			room = yahoo_string_decode(gc, pair->value, FALSE);
+			room = yahoo_string_decode(gc, pair->value, TRUE);
 			break;
 		case 109:
 			who = pair->value;
@@ -544,7 +544,7 @@
 
 		switch (pair->key) {
 		case 104:
-			room = yahoo_string_decode(gc, pair->value, FALSE);
+			room = yahoo_string_decode(gc, pair->value, TRUE);
 			break;
 		case 129: /* room id? */
 			break;
@@ -714,8 +714,9 @@
 	struct yahoo_packet *pkt;
 	GaimConversation *c;
 	char *eroom;
+	gboolean utf8 = 1;
 
-	eroom = yahoo_string_encode(gc, room, NULL);
+	eroom = yahoo_string_encode(gc, room, &utf8);
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATEXIT, YAHOO_STATUS_AVAILABLE, 0);
 
@@ -834,8 +835,11 @@
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt;
 	char *room2;
+	gboolean utf8 = TRUE;
 
-	room2 = yahoo_string_encode(gc, room, NULL);
+	/* apparently room names are always utf8, or else always not utf8,
+	 * so we don't have to actually pass the flag in the packet. Or something. */
+	room2 = yahoo_string_encode(gc, room, &utf8);
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATJOIN, YAHOO_STATUS_AVAILABLE, 0);
 
@@ -856,8 +860,9 @@
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt;
 	char *room2, *msg2 = NULL;
+	gboolean utf8 = TRUE;
 
-	room2 = yahoo_string_encode(gc, room, NULL);
+	room2 = yahoo_string_encode(gc, room, &utf8);
 	if (msg)
 		msg2 = yahoo_string_encode(gc, msg, NULL);
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATADDINVITE, YAHOO_STATUS_AVAILABLE, 0);