Mercurial > pidgin.yaz
changeset 2199:e8e2a72a37b7
[gaim-migrate @ 2209]
no more buddy chat things in the buddy list. we'll see how many people this pisses off before committing part 2.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 30 Aug 2001 23:48:56 +0000 |
parents | 196e23ddd8bf |
children | 53981aae4f8b |
files | src/aim.c src/buddy_chat.c src/gaim.h src/gaimrc.c src/multi.c src/prefs.c |
diffstat | 6 files changed, 2 insertions(+), 404 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aim.c Thu Aug 30 21:24:13 2001 +0000 +++ b/src/aim.c Thu Aug 30 23:48:56 2001 +0000 @@ -67,7 +67,6 @@ GList *buddy_pounces = NULL; GSList *away_messages = NULL; GList *conversations = NULL; -GList *chat_rooms = NULL; GSList *message_queue = NULL; GSList *away_time_queue = NULL;
--- a/src/buddy_chat.c Thu Aug 30 21:24:13 2001 +0000 +++ b/src/buddy_chat.c Thu Aug 30 23:48:56 2001 +0000 @@ -1016,14 +1016,6 @@ -void handle_click_chat(GtkWidget *widget, GdkEventButton * event, struct chat_room *cr) -{ - if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { - /* FIXME : double click on chat in buddy list */ - serv_join_chat(connections->data, cr->exchange, cr->name); - } -} - void delete_chat(struct conversation *b) { while (b->in_room) { @@ -1038,58 +1030,6 @@ g_free(b); } -void setup_buddy_chats() -{ - GList *list; - struct chat_room *cr; - GList *crs = chat_rooms; - GtkWidget *w; - GtkWidget *item; - GtkWidget *tree; - - if (buddies == NULL) - return; - - list = GTK_TREE(buddies)->children; - - while (list) { - w = (GtkWidget *)list->data; - if (!strcmp(GTK_LABEL(GTK_BIN(w)->child)->label, _("Buddy Chat"))) { - gtk_tree_remove_items(GTK_TREE(buddies), list); - list = GTK_TREE(buddies)->children; - if (!list) - break; - } - list = list->next; - } - - if (crs == NULL) - return; - - item = gtk_tree_item_new_with_label(_("Buddy Chat")); - tree = gtk_tree_new(); - gtk_widget_show(item); - gtk_widget_show(tree); - gtk_tree_append(GTK_TREE(buddies), item); - gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), tree); - gtk_tree_item_expand(GTK_TREE_ITEM(item)); - - while (crs) { - cr = (struct chat_room *)crs->data; - - item = gtk_tree_item_new_with_label(cr->name); - gtk_object_set_user_data(GTK_OBJECT(item), cr); - gtk_tree_append(GTK_TREE(tree), item); - gtk_widget_show(item); - gtk_signal_connect(GTK_OBJECT(item), "button_press_event", - GTK_SIGNAL_FUNC(handle_click_chat), cr); - - crs = crs->next; - - } - -} - static GtkWidget *change_text(GtkWidget *win, char *text, GtkWidget *button, char **xpm, int chat) { int dispstyle = set_dispstyle(chat);
--- a/src/gaim.h Thu Aug 30 21:24:13 2001 +0000 +++ b/src/gaim.h Thu Aug 30 23:48:56 2001 +0000 @@ -312,11 +312,6 @@ struct gaim_connection *gc; /* the connection it belongs to */ }; -struct chat_room { - char name[128]; - int exchange; -}; - struct debug_window { GtkWidget *window; GtkWidget *entry; @@ -447,7 +442,6 @@ extern GList *buddy_pounces; extern GSList *away_messages; extern GList *conversations; -extern GList *chat_rooms; extern GtkWidget *mainwindow; extern int opt_away; extern char *opt_away_arg; @@ -605,7 +599,6 @@ 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(); extern void update_chat_button_pix();
--- a/src/gaimrc.c Thu Aug 30 21:24:13 2001 +0000 +++ b/src/gaimrc.c Thu Aug 30 23:48:56 2001 +0000 @@ -153,8 +153,6 @@ return 3; } else if (!strcmp(tag, "pounce")) { return 4; - } else if (!strcmp(tag, "chat")) { - return 5; } else if (!strcmp(tag, "sound_files")) { return 6; } else if (!strcmp(tag, "proxy")) { @@ -345,62 +343,6 @@ fprintf(f, "}\n"); } -static void gaimrc_read_chat(FILE *f) -{ - struct parse *p; - char buf[4096]; - struct chat_room *b; - - buf[0] = 0; - - while (buf[0] != '}') { - if (!fgets(buf, sizeof(buf), f)) - return; - - if (buf[0] == '}') - return; - - p = parse_line(buf); - if (!strcmp(p->option, "entry")) { - b = g_new0(struct chat_room, 1); - - g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]); - filter_break(b->name); - - b->exchange = atoi(p->value[1]); - - chat_rooms = g_list_append(chat_rooms, b); - } - } -} - -static void gaimrc_write_chat(FILE *f) -{ - GList *pnc = chat_rooms; - struct chat_room *b; - - fprintf(f, "chat {\n"); - - if (pnc) { - while (pnc) { - char *str1; - - b = (struct chat_room *)pnc->data; - - str1 = escape_text2(b->name); - - fprintf(f, "\tentry { %s } { %d }\n", str1, b->exchange); - - /* escape_text2 uses malloc(), so we don't want to g_free these */ - free(str1); - - pnc = pnc->next; - } - } - - fprintf(f, "}\n"); -} - #ifdef GAIM_PLUGINS static void gaimrc_write_plugins(FILE *f) { @@ -968,9 +910,6 @@ case 4: gaimrc_read_pounce(f); break; - case 5: - gaimrc_read_chat(f); - break; case 6: gaimrc_read_sounds(f); break; @@ -1012,7 +951,6 @@ gaimrc_write_sounds(f); gaimrc_write_away(f); gaimrc_write_pounce(f); - gaimrc_write_chat(f); #ifdef GAIM_PLUGINS gaimrc_write_plugins(f); #endif
--- a/src/multi.c Thu Aug 30 21:24:13 2001 +0000 +++ b/src/multi.c Thu Aug 30 23:48:56 2001 +0000 @@ -73,6 +73,8 @@ gc->permit = NULL; gc->deny = NULL; + gc->iconfile = "/home/ewarmenhoven/peng.gif"; + connections = g_slist_append(connections, gc); user->gc = gc; @@ -917,7 +919,6 @@ show_buddy_list(); refresh_buddy_window(); #endif - setup_buddy_chats(); update_connection_dependent_prefs(); do_away_menu();
--- a/src/prefs.c Thu Aug 30 21:24:13 2001 +0000 +++ b/src/prefs.c Thu Aug 30 23:48:56 2001 +0000 @@ -38,7 +38,6 @@ #include "prpl.h" #include "pixmaps/cancel.xpm" #include "pixmaps/fontface2.xpm" -#include "pixmaps/refresh.xpm" #include "pixmaps/gnome_add.xpm" #include "pixmaps/gnome_remove.xpm" #include "pixmaps/gnome_preferences.xpm" @@ -999,269 +998,6 @@ gtk_widget_show(prefdialog); } -struct chat_page { - GtkWidget *list1; - GtkWidget *list2; -}; - -static struct chat_page *cp = NULL; - -static void ref_list_callback(gpointer data, char *text) { - char *c; - int len; - GtkWidget *item; - GList *items = GTK_LIST(cp->list1)->children; - struct chat_room *cr; - c = text; - - if (!text) - return; - - len = strlen(text); - - while (items) { - g_free(gtk_object_get_user_data(GTK_OBJECT(items->data))); - items = items->next; - } - - items = NULL; - - gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1); - - item = gtk_list_item_new_with_label(_("Gaim Chat")); - cr = g_new0(struct chat_room, 1); - strcpy(cr->name, _("Gaim Chat")); - cr->exchange = 4; - gtk_object_set_user_data(GTK_OBJECT(item), cr); - gtk_widget_show(item); - - items = g_list_append(NULL, item); - - while (c) { - if (c - text > len - 30) - break; /* assume no chat rooms 30 from end, padding */ - if (!g_strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) { - char *t; - int len = 0; - int exchange; - char *name = NULL; - - c += strlen(AOL_SRCHSTR); - t = c; - while (t) { - len++; - name = g_realloc(name, len); - if (*t == '+') - name[len - 1] = ' '; - else if (*t == '&') { - name[len - 1] = 0; - sscanf(t, "&Exchange=%d", &exchange); - c = t + strlen("&Exchange=x"); - break; - } else - name[len - 1] = *t; - t++; - } - cr = g_new0(struct chat_room, 1); - strcpy(cr->name, name); - cr->exchange = exchange; - item = gtk_list_item_new_with_label(name); - gtk_widget_show(item); - items = g_list_append(items, item); - gtk_object_set_user_data(GTK_OBJECT(item), cr); - g_free(name); - } - c++; - } - gtk_list_append_items(GTK_LIST(cp->list1), items); - g_free(text); -} - -static void refresh_list(GtkWidget *w, gpointer *m) -{ - grab_url("http://www.aol.com/community/chat/allchats.html", ref_list_callback, NULL); -} - -static void add_chat(GtkWidget *w, gpointer *m) -{ - GList *sel = GTK_LIST(cp->list1)->selection; - struct chat_room *cr, *cr2; - GList *crs = chat_rooms; - GtkWidget *item; - - if (sel) { - cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(sel->data)); - } else - return; - - while (crs) { - cr2 = (struct chat_room *)crs->data; - if (!g_strcasecmp(cr->name, cr2->name)) - return; - crs = crs->next; - } - item = gtk_list_item_new_with_label(cr->name); - cr2 = g_new0(struct chat_room, 1); - strcpy(cr2->name, cr->name); - cr2->exchange = cr->exchange; - gtk_object_set_user_data(GTK_OBJECT(item), cr2); - gtk_widget_show(item); - sel = g_list_append(NULL, item); - gtk_list_append_items(GTK_LIST(cp->list2), sel); - chat_rooms = g_list_append(chat_rooms, cr2); - - setup_buddy_chats(); - save_prefs(); - - -} - -static void remove_chat(GtkWidget *w, gpointer *m) -{ - GList *sel = GTK_LIST(cp->list2)->selection; - struct chat_room *cr; - GList *crs; - GtkWidget *item; - - if (sel) { - item = (GtkWidget *)sel->data; - cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(item)); - } else - return; - - chat_rooms = g_list_remove(chat_rooms, cr); - - - gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1); - - if (g_list_length(chat_rooms) == 0) - chat_rooms = NULL; - - crs = chat_rooms; - - while (crs) { - cr = (struct chat_room *)crs->data; - item = gtk_list_item_new_with_label(cr->name); - gtk_object_set_user_data(GTK_OBJECT(item), cr); - gtk_widget_show(item); - gtk_list_append_items(GTK_LIST(cp->list2), g_list_append(NULL, item)); - - - crs = crs->next; - } - - setup_buddy_chats(); - save_prefs(); -} - -static void room_page() -{ - GtkWidget *table; - GtkWidget *rem_button, *add_button, *ref_button; - GtkWidget *list1, *list2; - GtkWidget *label; - GtkWidget *sw1, *sw2; - GtkWidget *item; - GList *crs = chat_rooms; - GList *items = NULL; - struct chat_room *cr; - - GtkWidget *parent; - GtkWidget *box; - - if (!cp) - g_free(cp); - cp = g_new0(struct chat_page, 1); - - parent = prefdialog->parent; - gtk_widget_destroy(prefdialog); - - prefdialog = gtk_frame_new(_("Chat Rooms")); - gtk_container_add(GTK_CONTAINER(parent), prefdialog); - - box = gtk_vbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(box), 5); - gtk_container_add(GTK_CONTAINER(prefdialog), box); - gtk_widget_show(box); - - table = gtk_table_new(4, 2, FALSE); - gtk_widget_show(table); - - gtk_box_pack_start(GTK_BOX(box), table, TRUE, TRUE, 0); - - list1 = gtk_list_new(); - list2 = gtk_list_new(); - sw1 = gtk_scrolled_window_new(NULL, NULL); - sw2 = gtk_scrolled_window_new(NULL, NULL); - - ref_button = picture_button(prefs, _("Refresh"), refresh_xpm); - add_button = picture_button(prefs, _("Add"), gnome_add_xpm); - rem_button = picture_button(prefs, _("Remove"), gnome_remove_xpm); - gtk_widget_show(list1); - gtk_widget_show(sw1); - gtk_widget_show(list2); - gtk_widget_show(sw2); - - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2); - - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - - cp->list1 = list1; - cp->list2 = list2; - - gtk_signal_connect(GTK_OBJECT(ref_button), "clicked", GTK_SIGNAL_FUNC(refresh_list), cp); - gtk_signal_connect(GTK_OBJECT(rem_button), "clicked", GTK_SIGNAL_FUNC(remove_chat), cp); - gtk_signal_connect(GTK_OBJECT(add_button), "clicked", GTK_SIGNAL_FUNC(add_chat), cp); - - - - label = gtk_label_new(_("List of available chats")); - gtk_widget_show(label); - - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_table_attach(GTK_TABLE(table), ref_button, 0, 1, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); - gtk_table_attach(GTK_TABLE(table), add_button, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, 0, 0); - - - label = gtk_label_new(_("List of subscribed chats")); - gtk_widget_show(label); - - gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); - gtk_table_attach(GTK_TABLE(table), rem_button, 1, 2, 3, 4, GTK_SHRINK, GTK_SHRINK, 0, 0); - - - item = gtk_list_item_new_with_label(_("Gaim Chat")); - cr = g_new0(struct chat_room, 1); - strcpy(cr->name, _("Gaim Chat")); - cr->exchange = 4; - gtk_object_set_user_data(GTK_OBJECT(item), cr); - gtk_widget_show(item); - gtk_list_append_items(GTK_LIST(list1), g_list_append(NULL, item)); - - - while (crs) { - cr = (struct chat_room *)crs->data; - item = gtk_list_item_new_with_label(cr->name); - gtk_object_set_user_data(GTK_OBJECT(item), cr); - gtk_widget_show(item); - items = g_list_append(items, item); - - crs = crs->next; - } - - gtk_list_append_items(GTK_LIST(list2), items); - - gtk_widget_show(prefdialog); -} - static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) { /* more stuff stolen from X-Chat */ @@ -2531,10 +2267,6 @@ { save_prefs(); - if (cp) - g_free(cp); - cp = NULL; - if (event == NULL) gtk_widget_destroy(prefs); prefs = NULL; @@ -2716,11 +2448,6 @@ node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL, text, 5, NULL, NULL, NULL, NULL, 0, 1); gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, font_page); - - text[0] = _("Chat Rooms"); - node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL, - text, 5, NULL, NULL, NULL, NULL, 0, 1); - gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, room_page); } void prefs_build_sound()