changeset 6855:4146b836ba0a

[gaim-migrate @ 7400] I did a little work on i18n for toc. I don't know why. Someone should finish this, it'll be one thousand, three hundred and thirty-seven. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 16 Sep 2003 02:20:49 +0000
parents 9e1bd25afa88
children a14200b24371
files src/protocols/toc/toc.c
diffstat 1 files changed, 28 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/toc/toc.c	Mon Sep 15 22:18:32 2003 +0000
+++ b/src/protocols/toc/toc.c	Tue Sep 16 02:20:49 2003 +0000
@@ -1067,18 +1067,42 @@
 {
 	char *buf1, *buf2;
 
-gaim_debug(GAIM_DEBUG_ERROR, "xxx", "1 - Sending message %s\n", message);
+#if 1
+	/* This is the old, non-i18n way */
 	buf1 = escape_text(message);
 	if (strlen(buf1) + 52 > MSG_LEN) {
 		g_free(buf1);
 		return -E2BIG;
 	}
-
-gaim_debug(GAIM_DEBUG_ERROR, "xxx", "1 - Sending message %s\n", buf1);
 	buf2 = g_strdup_printf("toc_send_im %s \"%s\"%s", normalize(name), buf1, 
 						   ((flags & GAIM_IM_AUTO_RESP) ? " auto" : ""));
 	g_free(buf1);
-gaim_debug(GAIM_DEBUG_ERROR, "xxx", "1 - Sending message %s\n", buf2);
+#else
+	/* This doesn't work yet.  See the comments below for details */
+	buf1 = gaim_strreplace(message, "\"", "\\\"");
+
+	/*
+	 * We still need to determine what encoding should be used and send the 
+	 * message in that encoding.  This should be done the same as in 
+	 * oscar_encoding_check() in oscar.c.  There is no encoding flag sent 
+	 * along with the message--the TOC to OSCAR proxy server must just 
+	 * use a lil' algorithm to determine what the actual encoding is.
+	 *
+	 * After that, you need to convert buf1 to that encoding, and keep track 
+	 * of the length of the resulting string.  Then you need to make sure 
+	 * that length is passed to sflap_send().
+	 */
+
+	if (len + 52 > MSG_LEN) {
+		g_free(buf1);
+		return -E2BIG;
+	}
+
+	buf2 = g_strdup_printf("toc2_send_im_enc %s F U en \"%s\" %s", normalize(name), buf1, 
+						   ((flags & GAIM_IM_AUTO_RESP) ? "auto" : ""));
+	g_free(buf1);
+#endif
+
 	sflap_send(gc, buf2, -1, TYPE_DATA);
 	g_free(buf2);