# HG changeset patch # User Eric Warmenhoven # Date 1001570699 0 # Node ID 84823e04dcf770102ae4fb065bb7e3647de52fb8 # Parent 6c4ec021c9986d2750b523e4405df1a3a974a1f1 [gaim-migrate @ 2381] i finally fixed this. committer: Tailor Script diff -r 6c4ec021c998 -r 84823e04dcf7 src/buddy_chat.c --- a/src/buddy_chat.c Thu Sep 27 04:12:56 2001 +0000 +++ b/src/buddy_chat.c Thu Sep 27 06:04:59 2001 +0000 @@ -1110,6 +1110,9 @@ void chat_set_topic(struct conversation *b, char* who, char* topic) { gtk_entry_set_text(GTK_ENTRY(b->topic_text), topic); + if (b->topic) + g_free(b->topic); + b->topic = g_strdup(topic); } @@ -1125,6 +1128,8 @@ b->ignored = g_list_remove(b->ignored, b->ignored->data); } g_string_free(b->history, TRUE); + if (b->topic) + g_free(b->topic); g_free(b); } @@ -1219,12 +1224,14 @@ void chat_tabize() { + int pos = 0; /* evil, evil i tell you! evil! */ if (chat_options & OPT_CHAT_ONE_WINDOW) { GList *x = chats; while (x) { struct conversation *c = x->data; GtkWidget *imhtml, *win; + GList *r = c->in_room; imhtml = c->text; win = c->window; @@ -1236,6 +1243,38 @@ GTK_SIGNAL_FUNC(close_callback), c); gtk_widget_destroy(win); + if (c->topic) + gtk_entry_set_text(GTK_ENTRY(c->topic_text), c->topic); + + while (r) { + char *name = r->data; + GtkWidget *list_item; + GList *ignored = c->ignored; + char tmp[BUF_LONG]; + + while (ignored) { + if (!g_strcasecmp(name, ignored->data)) + break; + ignored = ignored->next; + } + + if (ignored) { + g_snprintf(tmp, sizeof(tmp), "X %s", name); + list_item = gtk_list_item_new_with_label(tmp); + } else + list_item = gtk_list_item_new_with_label(name); + + gtk_object_set_user_data(GTK_OBJECT(list_item), name); + gtk_signal_connect(GTK_OBJECT(list_item), "button_press_event", + GTK_SIGNAL_FUNC(right_click_chat), c); + gtk_list_insert_items(GTK_LIST(c->list), + g_list_append(NULL, list_item), pos); + gtk_widget_show(list_item); + + r = r->next; + pos++; + } + x = x->next; } } else { @@ -1245,6 +1284,7 @@ while (x) { struct conversation *c = x->data; GtkWidget *imhtml; + GList *r = c->in_room; imhtml = c->text; show_new_buddy_chat(c); @@ -1252,6 +1292,38 @@ gtk_widget_reparent(imhtml, c->sw); c->text = imhtml; + if (c->topic) + gtk_entry_set_text(GTK_ENTRY(c->topic_text), c->topic); + + while (r) { + char *name = r->data; + GtkWidget *list_item; + GList *ignored = c->ignored; + char tmp[BUF_LONG]; + + while (ignored) { + if (!g_strcasecmp(name, ignored->data)) + break; + ignored = ignored->next; + } + + if (ignored) { + g_snprintf(tmp, sizeof(tmp), "X %s", name); + list_item = gtk_list_item_new_with_label(tmp); + } else + list_item = gtk_list_item_new_with_label(name); + + gtk_object_set_user_data(GTK_OBJECT(list_item), name); + gtk_signal_connect(GTK_OBJECT(list_item), "button_press_event", + GTK_SIGNAL_FUNC(right_click_chat), c); + gtk_list_insert_items(GTK_LIST(c->list), + g_list_append(NULL, list_item), pos); + gtk_widget_show(list_item); + + r = r->next; + pos++; + } + x = x->next; } if (all_chats) diff -r 6c4ec021c998 -r 84823e04dcf7 src/gaim.h --- a/src/gaim.h Thu Sep 27 04:12:56 2001 +0000 +++ b/src/gaim.h Thu Sep 27 06:04:59 2001 +0000 @@ -393,6 +393,7 @@ /* stuff used just for chat */ GList *in_room; GList *ignored; + char *topic; int id; GtkWidget *count; GtkWidget *list;