changeset 15242:1b5cd588c1ee

[gaim-migrate @ 18031] * Improved gaim_plugin_oscar_decode_im_part()'s error message; "the buddy you are talking to" is awkward and wrong, and "the buddy to whom you are talking" is just silly. Use the buddy's screenname instead. * Pass the screen name to gaim_plugin_oscar_decode_im_part() in incomingim_chan4() as is done elsewhere rather than passing "1" as the name. committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 20 Dec 2006 20:06:47 +0000
parents 7ce73985115a
children 3a13e7e2ed33
files libgaim/protocols/oscar/oscar.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/oscar/oscar.c	Wed Dec 20 09:35:24 2006 +0000
+++ b/libgaim/protocols/oscar/oscar.c	Wed Dec 20 20:06:47 2006 +0000
@@ -427,17 +427,19 @@
 	if (ret == NULL)
 		ret = gaim_plugin_oscar_convert_to_utf8(data, datalen, charsetstr2, TRUE);
 	if (ret == NULL) {
-		char *str, *salvage;
+		char *str, *salvage, tmp;
 
 		str = g_malloc(datalen + 1);
 		strncpy(str, data, datalen);
 		str[datalen] = '\0';
 		salvage = gaim_utf8_salvage(str);
-		ret = g_strdup_printf("%s %s", salvage,
-		                      _("(There was an error receiving this message.  Either you and the buddy you are speaking to have a different encoding selected, or the buddy has a buggy client.)"));
+		tmp = g_strdup_printf(_("(There was an error receiving this message.  Either you and %s have different encodings selected, or %s has a buggy client.)"),
+					  sourcesn, sourcesn);
+		ret = g_strdup_printf("%s %s", salvage, tmp);
+		g_free(tmp);
 		g_free(str);
 		g_free(salvage);
-        }
+	}
 
 	return ret;
 }
@@ -2295,9 +2297,12 @@
 	for (numtoks=0; msg1[numtoks]; numtoks++);
 	msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *));
 	for (i=0; msg1[i]; i++) {
+		gchar *uin = g_strdup_printf("%u", args->uin);
+
 		gaim_str_strip_char(msg1[i], '\r');
 		/* TODO: Should use an encoding other than ASCII? */
-		msg2[i] = gaim_plugin_oscar_decode_im_part(account, "1", AIM_CHARSET_ASCII, 0x0000, msg1[i], strlen(msg1[i]));
+		msg2[i] = gaim_plugin_oscar_decode_im_part(account, uin, AIM_CHARSET_ASCII, 0x0000, msg1[i], strlen(msg1[i]));
+		g_free(uin);
 	}
 	msg2[i] = NULL;