Mercurial > pidgin
changeset 2023:3ab2082d125f
[gaim-migrate @ 2033]
better handling of outgoing messages/names. we aren't going to do friendly names for chat because it's too much of a pain to deal with.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 16 Jun 2001 00:16:42 +0000 |
parents | 199ba82faacb |
children | b86f639ff99f |
files | plugins/msn/msn.c |
diffstat | 1 files changed, 11 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/msn/msn.c Fri Jun 15 23:53:57 2001 +0000 +++ b/plugins/msn/msn.c Sat Jun 16 00:16:42 2001 +0000 @@ -50,7 +50,6 @@ int trId; int total; char *user; - char *friend; char *txqueue; }; @@ -339,8 +338,6 @@ g_free(ms->auth); if (ms->user) g_free(ms->user); - if (ms->friend) - g_free(ms->friend); if (ms->txqueue) g_free(ms->txqueue); ms->txqueue = NULL; @@ -376,14 +373,14 @@ add_chat_buddy(ms->chat, gc->username); } else if (!g_strncasecmp(buf, "BYE", 3)) { if (ms->chat) { - char *friend, *tmp = buf; + char *user, *tmp = buf; GET_NEXT(tmp); - friend = url_decode(tmp); - remove_chat_buddy(ms->chat, friend); + user = tmp; + remove_chat_buddy(ms->chat, user); } } else if (!g_strncasecmp(buf, "CAL", 3)) { } else if (!g_strncasecmp(buf, "IRO", 3)) { - char *tot, *friend, *tmp = buf; + char *tot, *user, *tmp = buf; GET_NEXT(tmp); GET_NEXT(tmp); @@ -391,32 +388,29 @@ tot = tmp; GET_NEXT(tmp); ms->total = atoi(tot); + user = tmp; GET_NEXT(tmp); - friend = url_decode(tmp); if (ms->total > 1) { if (!ms->chat) ms->chat = serv_got_joined_chat(gc, ++id, "MSN Chat"); - add_chat_buddy(ms->chat, friend); + add_chat_buddy(ms->chat, user); } } else if (!g_strncasecmp(buf, "JOI", 3)) { - char *user, *friend, *tmp = buf; + char *user, *tmp = buf; GET_NEXT(tmp); user = tmp; GET_NEXT(tmp); - friend = url_decode(tmp); if (ms->total == 1) { ms->chat = serv_got_joined_chat(gc, ++id, "MSN Chat"); - add_chat_buddy(ms->chat, ms->friend); + add_chat_buddy(ms->chat, ms->user); add_chat_buddy(ms->chat, gc->username); g_free(ms->user); ms->user = NULL; - g_free(ms->friend); - ms->friend = NULL; } if (ms->chat) - add_chat_buddy(ms->chat, friend); + add_chat_buddy(ms->chat, user); ms->total++; if (ms->txqueue) { g_snprintf(buf, sizeof(buf), "MSG %d N %d\r\n%s%s", ++ms->trId, @@ -424,7 +418,6 @@ MIME_HEADER, ms->txqueue); g_free(ms->txqueue); ms->txqueue = NULL; - ms->friend = g_strdup(friend); if (msn_write(ms->fd, buf, strlen(buf)) < 0) msn_kill_switch(ms); debug_printf("\n"); @@ -791,7 +784,7 @@ } else if (!g_strncasecmp(buf, "REM", 3)) { } else if (!g_strncasecmp(buf, "RNG", 3)) { struct msn_switchboard *ms; - char *sessid, *ssaddr, *auth, *user, *friend; + char *sessid, *ssaddr, *auth, *user; int port, i = 0; char *tmp = buf; @@ -808,9 +801,7 @@ GET_NEXT(tmp); user = tmp; - GET_NEXT(tmp); - friend = url_decode(tmp); while (ssaddr[i] && ssaddr[i] != ':') i++; if (ssaddr[i] == ':') { @@ -822,7 +813,6 @@ ms = g_new0(struct msn_switchboard, 1); ms->user = g_strdup(user); - ms->friend = g_strdup(friend); ms->sessid = g_strdup(sessid); ms->auth = g_strdup(auth); ms->gc = gc; @@ -1170,6 +1160,7 @@ if (msn_write(ms->fd, buf, strlen(buf)) < 0) msn_kill_switch(ms); debug_printf("\n"); + serv_got_chat_in(gc, id, gc->username, 0, message, time(NULL)); } static void msn_chat_leave(struct gaim_connection *gc, int id)