comparison src/protocols/msn/msn.c @ 3456:b48065e52337

[gaim-migrate @ 3503] A few patches. Brian--tell me what your last name is, and I'll put it in. ;) committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 28 Aug 2002 02:38:19 +0000
parents 0a0cc45267d4
children 7a3f16a375a5
comparison
equal deleted inserted replaced
3455:8de4f34a1bd7 3456:b48065e52337
842 { 842 {
843 struct msn_data *md = map->gc->proto_data; 843 struct msn_data *md = map->gc->proto_data;
844 char buf[MSN_BUF_LEN]; 844 char buf[MSN_BUF_LEN];
845 char *srvfriend; 845 char *srvfriend;
846 846
847 srvfriend = str_to_utf8(url_encode(map->friend)); 847 srvfriend = str_to_utf8(map->friend);
848 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, map->user, srvfriend); 848 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, map->user, url_encode(srvfriend));
849 g_free(srvfriend); 849 g_free(srvfriend);
850 850
851 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 851 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
852 hide_login_progress(map->gc, "Write error"); 852 hide_login_progress(map->gc, "Write error");
853 signoff(map->gc); 853 signoff(map->gc);
861 861
862 static void msn_cancel_add(gpointer w, struct msn_add_permit *map) 862 static void msn_cancel_add(gpointer w, struct msn_add_permit *map)
863 { 863 {
864 struct msn_data *md = map->gc->proto_data; 864 struct msn_data *md = map->gc->proto_data;
865 char buf[MSN_BUF_LEN]; 865 char buf[MSN_BUF_LEN];
866 char *srvfriend = str_to_utf8(url_encode(map->friend)); 866 char *srvfriend = str_to_utf8(map->friend);
867 867
868 if (*(map->user)) { 868 if (*(map->user)) {
869 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, map->user, srvfriend); 869 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, map->user, url_encode(srvfriend));
870 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 870 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
871 hide_login_progress(map->gc, "Write error"); 871 hide_login_progress(map->gc, "Write error");
872 signoff(map->gc); 872 signoff(map->gc);
873 return; 873 return;
874 } 874 }
1189 1189
1190 GET_NEXT(tmp); 1190 GET_NEXT(tmp);
1191 GET_NEXT(tmp); 1191 GET_NEXT(tmp);
1192 GET_NEXT(tmp); 1192 GET_NEXT(tmp);
1193 GET_NEXT(tmp); 1193 GET_NEXT(tmp);
1194 friend = utf8_to_str(tmp); 1194
1195 friend = url_decode(tmp);
1196 friend = utf8_to_str(friend);
1195 1197
1196 g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", friend); 1198 g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", friend);
1197 g_free(friend); 1199 g_free(friend);
1198 } else if (!g_strncasecmp(buf, "REM", 3)) { 1200 } else if (!g_strncasecmp(buf, "REM", 3)) {
1199 } else if (!g_strncasecmp(buf, "RNG", 3)) { 1201 } else if (!g_strncasecmp(buf, "RNG", 3)) {
2113 char *alias; 2115 char *alias;
2114 2116
2115 if (!entry || *entry == NULL) 2117 if (!entry || *entry == NULL)
2116 alias = g_strdup(""); 2118 alias = g_strdup("");
2117 else 2119 else
2118 alias = str_to_utf8(url_encode(entry)); 2120 alias = str_to_utf8(entry);
2119 2121
2120 if (strlen(alias) >= BUDDY_ALIAS_MAXLEN) { 2122 if (strlen(alias) >= BUDDY_ALIAS_MAXLEN) {
2121 do_error_dialog(_("New MSN friendly name too long."), NULL, GAIM_ERROR); 2123 do_error_dialog(_("New MSN friendly name too long."), NULL, GAIM_ERROR);
2122 return; 2124 return;
2123 } 2125 }
2124 2126
2125 g_snprintf(buf, sizeof(buf), "REA %d %s %s\r\n", ++md->trId, gc->username, alias); 2127 g_snprintf(buf, sizeof(buf), "REA %d %s %s\r\n", ++md->trId, gc->username, url_encode(alias));
2126 g_free(alias); 2128 g_free(alias);
2127 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2129 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2128 hide_login_progress(gc, "Write error"); 2130 hide_login_progress(gc, "Write error");
2129 signoff(gc); 2131 signoff(gc);
2130 return; 2132 return;