# HG changeset patch # User Eric Warmenhoven # Date 999740271 0 # Node ID 20a4d5da0b952d39ce821a3b80107e200117cb9d # Parent 6d5f7cbf1882ced89bfc5d5d63fb71c2ec76cff8 [gaim-migrate @ 2229] thanks to Ryan Speed for pointing this out. I hope this doesn't break things. I'm sure Ryan'll let me know ;) committer: Tailor Script diff -r 6d5f7cbf1882 -r 20a4d5da0b95 src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Thu Sep 06 00:27:11 2001 +0000 +++ b/src/protocols/msn/msn.c Thu Sep 06 01:37:51 2001 +0000 @@ -112,6 +112,25 @@ return buf; } +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 (isalnum(msg[i])) + buf[j++] = msg[i]; + else { + sprintf(buf + j, "%%%02x", (unsigned char)msg[i]); + j += 3; + } + } + buf[j] = 0; + + return buf; +} + static char *handle_errcode(char *buf, gboolean show) { int errcode; @@ -811,7 +830,7 @@ GET_NEXT(tmp); GET_NEXT(tmp); GET_NEXT(tmp); - friend = tmp; + friend = url_decode(tmp); g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", friend); } else if (!g_strncasecmp(buf, "REM", 3)) { @@ -998,6 +1017,7 @@ GET_NEXT(tmp); friend = tmp; GET_NEXT(tmp); + friend = url_decode(friend); /* so here, we're either getting the challenge or the OK */ if (!g_strcasecmp(resp, "OK")) { @@ -1399,7 +1419,7 @@ struct msn_data *md = gc->proto_data; char buf[MSN_BUF_LEN]; - g_snprintf(buf, sizeof(buf), "REA %d %s %s\n", ++md->trId, gc->username, entry); + g_snprintf(buf, sizeof(buf), "REA %d %s %s\n", ++md->trId, gc->username, url_encode(entry)); if (msn_write(md->fd, buf, strlen(buf)) < 0) { hide_login_progress(gc, "Write error"); signoff(gc);