Mercurial > pidgin.yaz
changeset 2017:eee309c0de93
[gaim-migrate @ 2027]
this is better. also plugged a mem leak for when you left a chat after you were disconnected.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 14 Jun 2001 21:43:59 +0000 |
parents | 9a2e3902658c |
children | 58d75a0559d3 |
files | src/buddy_chat.c src/conversation.c src/gaim.h src/server.c |
diffstat | 4 files changed, 21 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy_chat.c Thu Jun 14 17:33:25 2001 +0000 +++ b/src/buddy_chat.c Thu Jun 14 21:43:59 2001 +0000 @@ -1009,7 +1009,8 @@ gtk_widget_show(win); } -void chat_set_topic(struct conversation *b, char* who, char* topic) { +void chat_set_topic(struct conversation *b, char* who, char* topic) +{ gtk_entry_set_text(GTK_ENTRY(b->topic_text), topic); } @@ -1023,6 +1024,19 @@ } } +void delete_chat(struct conversation *b) +{ + while (b->in_room) { + g_free(b->in_room->data); + b->in_room = g_list_remove(b->in_room, b->in_room->data); + } + while (b->ignored) { + g_free(b->ignored->data); + b->ignored = g_list_remove(b->ignored, b->ignored->data); + } + g_string_free(b->history, TRUE); + g_free(b); +} void setup_buddy_chats() {
--- a/src/conversation.c Thu Jun 14 17:33:25 2001 +0000 +++ b/src/conversation.c Thu Jun 14 21:43:59 2001 +0000 @@ -468,15 +468,8 @@ chats = g_list_remove(chats, c); if (c->gc) serv_chat_leave(c->gc, c->id); - else { - /* bah */ - while (c->in_room) { - char *tmp = c->in_room->data; - c->in_room = g_list_remove(c->in_room, tmp); - g_free(tmp); - } - g_free(c); - } + else + delete_chat(c); } else { delete_conversation(c); }
--- a/src/gaim.h Thu Jun 14 17:33:25 2001 +0000 +++ b/src/gaim.h Thu Jun 14 21:43:59 2001 +0000 @@ -582,6 +582,7 @@ extern void rename_chat_buddy(struct conversation *, char *, char *); extern void remove_chat_buddy(struct conversation *, char *); extern void show_new_buddy_chat(struct conversation *); +extern void delete_chat(struct conversation *); extern void setup_buddy_chats(); extern void build_imchat_box(gboolean); extern void do_quit();
--- a/src/server.c Thu Jun 14 17:33:25 2001 +0000 +++ b/src/server.c Thu Jun 14 21:43:59 2001 +0000 @@ -61,13 +61,10 @@ void serv_close(struct gaim_connection *gc) { - GSList *bcs = gc->buddy_chats; - struct conversation *b; - while (bcs) { - b = (struct conversation *)bcs->data; + while (gc->buddy_chats) { + struct conversation *b = gc->buddy_chats->data; gc->buddy_chats = g_slist_remove(gc->buddy_chats, b); b->gc = NULL; - bcs = gc->buddy_chats; } if (gc->idle_timer > 0) @@ -870,19 +867,7 @@ g->buddy_chats = g_slist_remove(g->buddy_chats, b); - while (b->in_room) { - char *tmp = b->in_room->data; - b->in_room = g_list_remove(b->in_room, tmp); - g_free(tmp); - } - - while (b->ignored) { - g_free(b->ignored->data); - b->ignored = g_list_remove(b->ignored, b->ignored->data); - } - - g_string_free(b->history, TRUE); - g_free(b); + delete_chat(b); } void serv_got_chat_in(struct gaim_connection *g, int id, char *who, int whisper, char *message, time_t mtime)