From: Eric W. <war...@us...> - 2001-09-27 06:05:02
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv15276 Modified Files: buddy_chat.c gaim.h Log Message: i finally fixed this. Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- buddy_chat.c 2001/09/22 11:35:00 1.113 +++ buddy_chat.c 2001/09/27 06:04:59 1.114 @@ -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,12 +1284,45 @@ while (x) { struct conversation *c = x->data; GtkWidget *imhtml; + GList *r = c->in_room; imhtml = c->text; show_new_buddy_chat(c); gtk_widget_destroy(c->text); 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; } Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.261 retrieving revision 1.262 diff -u -d -r1.261 -r1.262 --- gaim.h 2001/09/22 09:14:27 1.261 +++ gaim.h 2001/09/27 06:04:59 1.262 @@ -393,6 +393,7 @@ /* stuff used just for chat */ GList *in_room; GList *ignored; + char *topic; int id; GtkWidget *count; GtkWidget *list; |