changeset 1988:2bb74a5a574f

[gaim-migrate @ 1998] whoops. don't need to url-encode messages because you specify length of them. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 11 Jun 2001 17:55:40 +0000
parents a47327740514
children 21c595ef11c8
files plugins/msn/msn.c
diffstat 1 files changed, 4 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/msn/msn.c	Mon Jun 11 09:46:35 2001 +0000
+++ b/plugins/msn/msn.c	Mon Jun 11 17:55:40 2001 +0000
@@ -100,28 +100,6 @@
 	return write(fd, data, len);
 }
 
-static char *url_encode(const char *msg)
-{
-	static char buf[MSN_BUF_LEN];
-	int i, j = 0;
-
-	bzero(buf, sizeof(buf));
-	for (i = 0; i < strlen(msg); i++) {
-		if ((msg[i] < 33) || (msg[i] > 126)) {
-			char tmp[5];
-			int k;
-			buf[j++] = '%';
-			g_snprintf(tmp, sizeof(tmp), "%02x", msg[i]);
-			for (k = 0; tmp[k]; k++)
-				buf[j++] = tmp[k];
-		} else
-			buf[j++] = msg[i];
-	}
-	buf[j] = 0;
-
-	return buf;
-}
-
 static char *url_decode(const char *msg)
 {
 	static char buf[MSN_BUF_LEN];
@@ -368,8 +346,8 @@
 	} else if (!g_strncasecmp(buf, "JOI", 3)) {
 		if (ms->txqueue) {
 			g_snprintf(buf, sizeof(buf), "MSG %d N %d\r\n%s%s", ++ms->trId,
-					strlen(MIME_HEADER) + strlen(url_encode(ms->txqueue)),
-					MIME_HEADER, url_encode(ms->txqueue));
+					strlen(MIME_HEADER) + strlen(ms->txqueue),
+					MIME_HEADER, ms->txqueue);
 			g_free(ms->txqueue);
 			ms->txqueue = NULL;
 			if (msn_write(ms->fd, buf, strlen(buf)) < 0)
@@ -1053,8 +1031,8 @@
 
 	if (ms) {
 		g_snprintf(buf, sizeof(buf), "MSG %d N %d\r\n%s%s", ++ms->trId,
-				strlen(MIME_HEADER) + strlen(url_encode(message)),
-				MIME_HEADER, url_encode(message));
+				strlen(MIME_HEADER) + strlen(message),
+				MIME_HEADER, message);
 		if (msn_write(ms->fd, buf, strlen(buf)) < 0)
 			msn_kill_switch(ms);
 	} else {