Mercurial > pidgin
changeset 1182:bab9f3dc07f8
[gaim-migrate @ 1192]
i hope this doesn't break things.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 01 Dec 2000 14:57:56 +0000 |
parents | 2e0e157b49a0 |
children | cda9dfc65693 |
files | src/toc.c |
diffstat | 1 files changed, 41 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/toc.c Fri Dec 01 11:12:39 2000 +0000 +++ b/src/toc.c Fri Dec 01 14:57:56 2000 +0000 @@ -47,7 +47,7 @@ #include "pixmaps/dt_icon.xpm" #include "pixmaps/free_icon.xpm" -#define REVISION "gaim:$Revision: 1163 $" +#define REVISION "gaim:$Revision: 1192 $" #define TYPE_SIGNON 1 #define TYPE_DATA 2 @@ -477,11 +477,30 @@ serv_got_chat_invite(gc, name, id, who, message); } else if (!strcasecmp(c, "CHAT_LEFT")) { + GSList *bcs = gc->buddy_chats; + struct conversation *b = NULL; int id; sscanf(strtok(NULL, ":"), "%d", &id); - serv_got_chat_left(gc, id); + while (bcs) { + b = (struct conversation *)bcs->data; + if (id == b->id) + break; + b = NULL; + bcs = bcs->next; + } + + if (!b) + return; + + if (b->window) { + char error_buf[BUF_LONG]; + b->gc = NULL; + g_snprintf(error_buf, sizeof error_buf, _("You have been disconnected" + " from chat room %s."), b->name); + } else + serv_got_chat_left(gc, id); } else if (!strcasecmp(c, "GOTO_URL")) { char *name, *url, tmp[256]; @@ -881,9 +900,27 @@ } static void toc_chat_leave(struct gaim_connection *g, int id) { + GSList *bcs = g->buddy_chats; + struct conversation *b = NULL; char buf[256]; - g_snprintf(buf, 255, "toc_chat_leave %d", id); - sflap_send(g, buf, -1, TYPE_DATA); + + while (bcs) { + b = (struct conversation *)bcs->data; + if (id == b->id) + break; + b = NULL; + bcs = bcs->next; + } + + if (!b) + return; /* can this happen? */ + + if (!b->gc) /* TOC already kicked us out of this room */ + serv_got_chat_left(g, id); + else { + g_snprintf(buf, 255, "toc_chat_leave %d", id); + sflap_send(g, buf, -1, TYPE_DATA); + } } static void toc_chat_whisper(struct gaim_connection *g, int id, char *who, char *message) {