annotate plugins/chatlist.c @ 4327:da5e1b57adb0

[gaim-migrate @ 4583] the chatlist plugin didn't get the memo about the new grab_url parameter. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 17 Jan 2003 16:52:32 +0000
parents 59751fe608c5
children 2427d847e39c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4165
diff changeset
1 #include "config.h"
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4165
diff changeset
2
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4165
diff changeset
3 #ifndef GAIM_PLUGINS
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 #define GAIM_PLUGINS
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4165
diff changeset
5 #endif
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 #include "pixmaps/refresh.xpm"
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 #include "pixmaps/gnome_add.xpm"
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 #include "pixmaps/gnome_remove.xpm"
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 #include "proxy.h"
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 #include "gaim.h"
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 #include <stdlib.h>
2272
4ecc9a9a75d8 [gaim-migrate @ 2282]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2241
diff changeset
15 #include <string.h>
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
16 #ifdef _WIN32
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
17 #include "win32dep.h"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
18 #endif
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19
2993
7239a392486c [gaim-migrate @ 3006]
Rob Flynn <gaim@robflynn.com>
parents: 2900
diff changeset
20 #define AOL_SRCHSTR "aim:GoChat?RoomName="
2417
5473c8c5378d [gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2356
diff changeset
21
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 struct chat_page {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 GtkWidget *list1;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 GtkWidget *list2;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 };
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 struct chat_room {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 char name[80];
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 int exchange;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 };
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 static GtkWidget *item = NULL; /* this is the parent tree */
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 static GList *chat_rooms = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 static struct chat_page *cp = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 static void des_item()
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 if (item)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 gtk_widget_destroy(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 item = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 static void handle_click_chat(GtkWidget *widget, GdkEventButton * event, struct chat_room *cr)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 GList *m = g_list_append(NULL, cr->name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48 int *x = g_new0(int, 1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 *x = cr->exchange;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 m = g_list_append(m, x);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 serv_join_chat(connections->data, m);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 g_free(x);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 g_list_free(m);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 static void setup_buddy_chats()
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 GList *crs = chat_rooms;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 GtkWidget *tree;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 if (!blist)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 if (item)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 gtk_tree_remove_item(GTK_TREE(buddies), item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 item = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 if (!chat_rooms)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 item = gtk_tree_item_new_with_label(_("Buddy Chat"));
4165
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 4164
diff changeset
73 g_signal_connect(GTK_OBJECT(item), "destroy", G_CALLBACK(des_item), NULL);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 gtk_tree_append(GTK_TREE(buddies), item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 gtk_tree_item_expand(GTK_TREE_ITEM(item));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 tree = gtk_tree_new();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), tree);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 gtk_widget_show(tree);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 while (crs) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 struct chat_room *cr = (struct chat_room *)crs->data;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 GtkWidget *titem = gtk_tree_item_new_with_label(cr->name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 gtk_object_set_user_data(GTK_OBJECT(titem), cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 gtk_tree_append(GTK_TREE(tree), titem);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 gtk_widget_show(titem);
4165
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 4164
diff changeset
88 g_signal_connect(GTK_OBJECT(titem), "button_press_event",
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 4164
diff changeset
89 G_CALLBACK(handle_click_chat), cr);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 crs = crs->next;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 }
2900
aaaca46b507b [gaim-migrate @ 2913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2892
diff changeset
92
aaaca46b507b [gaim-migrate @ 2913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2892
diff changeset
93 gtk_tree_item_expand(GTK_TREE_ITEM(item));
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 static void save_chat_prefs()
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 FILE *f;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 char path[1024];
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100 char *x = gaim_user_dir();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 GList *crs = chat_rooms;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103 g_snprintf(path, sizeof(path), "%s/%s", x, "chats");
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 f = fopen(path, "w");
3930
22e3bbbd9a32 [gaim-migrate @ 4102]
Mark Doliner <mark@kingant.net>
parents: 3867
diff changeset
105 if (!f)
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 while (crs) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 struct chat_room *cr = crs->data;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 crs = crs->next;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 fprintf(f, "%s\n%d\n", cr->name, cr->exchange);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 fclose(f);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 static void restore_chat_prefs()
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 FILE *f;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118 char path[1024];
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 char *x = gaim_user_dir();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 char buf[1024];
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 g_snprintf(path, sizeof(path), "%s/%s", x, "chats");
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 f = fopen(path, "r");
3930
22e3bbbd9a32 [gaim-migrate @ 4102]
Mark Doliner <mark@kingant.net>
parents: 3867
diff changeset
124 if (!f)
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126 while (fgets(buf, 1024, f)) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 struct chat_room *cr = g_new0(struct chat_room, 1);
2356
ddf404cd9757 [gaim-migrate @ 2369]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2272
diff changeset
128 g_snprintf(cr->name, sizeof(cr->name), "%s", g_strchomp(buf));
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 if (!fgets(buf, 1024, f)) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130 g_free(cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 break;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133 cr->exchange = atoi(buf);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 chat_rooms = g_list_append(chat_rooms, cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 fclose(f);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 setup_buddy_chats();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139
4327
da5e1b57adb0 [gaim-migrate @ 4583]
Nathan Walp <nwalp@pidgin.im>
parents: 4202
diff changeset
140 static void ref_list_callback(gpointer data, char *text, unsigned long len)
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 char *c;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 GtkWidget *item;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 GList *items = GTK_LIST(cp->list1)->children;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 struct chat_room *cr;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146 c = text;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 if (!text)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151 while (items) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 g_free(gtk_object_get_user_data(GTK_OBJECT(items->data)));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153 items = items->next;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 items = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158 gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
160 item = gtk_list_item_new_with_label(_("Gaim Chat"));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161 cr = g_new0(struct chat_room, 1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 strcpy(cr->name, _("Gaim Chat"));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 cr->exchange = 4;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164 gtk_object_set_user_data(GTK_OBJECT(item), cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 items = g_list_append(NULL, item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 while (c) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 if (c - text > len - 30)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
171 break; /* assume no chat rooms 30 from end, padding */
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
172 if (!g_strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 char *t;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
174 int len = 0;
3000
6d95285533df [gaim-migrate @ 3013]
Sean Egan <seanegan@gmail.com>
parents: 2993
diff changeset
175 int exchange = 5;
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176 char *name = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178 c += strlen(AOL_SRCHSTR);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
179 t = c;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180 while (t) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181 len++;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 name = g_realloc(name, len);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 if (*t == '+')
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184 name[len - 1] = ' ';
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 else if (*t == '&') {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
186 name[len - 1] = 0;
3000
6d95285533df [gaim-migrate @ 3013]
Sean Egan <seanegan@gmail.com>
parents: 2993
diff changeset
187 sscanf(t, "&Exchange=%d", &exchange);
6d95285533df [gaim-migrate @ 3013]
Sean Egan <seanegan@gmail.com>
parents: 2993
diff changeset
188 c = t + strlen("&Exchange=x");
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
189 break;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190 } else
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191 name[len - 1] = *t;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192 t++;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
194 cr = g_new0(struct chat_room, 1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
195 strcpy(cr->name, name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
196 cr->exchange = exchange;
4164
a55c2a0ddcd4 [gaim-migrate @ 4393]
Christian Hammond <chipx86@chipx86.com>
parents: 3930
diff changeset
197 printf("Adding '%s'\n", name);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198 item = gtk_list_item_new_with_label(name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
200 items = g_list_append(items, item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
201 gtk_object_set_user_data(GTK_OBJECT(item), cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
202 g_free(name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
203 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
204 c++;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
205 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
206 gtk_list_append_items(GTK_LIST(cp->list1), items);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
207 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
208
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209 static void refresh_list(GtkWidget *w, gpointer *m)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210 {
2872
30828b83143d [gaim-migrate @ 2885]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2692
diff changeset
211 grab_url("http://www.aim.com/community/chats.adp", FALSE, ref_list_callback, NULL);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
213
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 static void add_chat(GtkWidget *w, gpointer *m)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
215 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216 GList *sel = GTK_LIST(cp->list1)->selection;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
217 struct chat_room *cr, *cr2;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
218 GList *crs = chat_rooms;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
219 GtkWidget *item;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
220
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
221 if (sel) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(sel->data));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
223 } else
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
226 while (crs) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227 cr2 = (struct chat_room *)crs->data;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
228 if (!g_strcasecmp(cr->name, cr2->name))
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
230 crs = crs->next;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
231 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
232 item = gtk_list_item_new_with_label(cr->name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
233 cr2 = g_new0(struct chat_room, 1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
234 strcpy(cr2->name, cr->name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
235 cr2->exchange = cr->exchange;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
236 gtk_object_set_user_data(GTK_OBJECT(item), cr2);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
237 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
238 sel = g_list_append(NULL, item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
239 gtk_list_append_items(GTK_LIST(cp->list2), sel);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
240 chat_rooms = g_list_append(chat_rooms, cr2);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
242 setup_buddy_chats();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
243 save_chat_prefs();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
244 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
245
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
246 static void remove_chat(GtkWidget *w, gpointer *m)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
247 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
248 GList *sel = GTK_LIST(cp->list2)->selection;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
249 struct chat_room *cr;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
250 GList *crs;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
251 GtkWidget *item;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
252
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
253 if (sel) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
254 item = (GtkWidget *)sel->data;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
255 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(item));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
256 } else
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
257 return;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
258
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
259 chat_rooms = g_list_remove(chat_rooms, cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
260
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
261
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
262 gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
263
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
264 if (g_list_length(chat_rooms) == 0)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
265 chat_rooms = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
266
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
267 crs = chat_rooms;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
268
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
269 while (crs) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
270 cr = (struct chat_room *)crs->data;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
271 item = gtk_list_item_new_with_label(cr->name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
272 gtk_object_set_user_data(GTK_OBJECT(item), cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
273 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
274 gtk_list_append_items(GTK_LIST(cp->list2), g_list_append(NULL, item));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
275
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
276
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
277 crs = crs->next;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
278 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
279
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
280 setup_buddy_chats();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
281 save_chat_prefs();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
282 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
283
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
284 G_MODULE_EXPORT GtkWidget *gaim_plugin_config_gtk()
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
285 {
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
286 GtkWidget *ret, *vbox;
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
287 GtkWidget *list1, *list2;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
288 GtkWidget *sw1, *sw2;
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
289 GtkWidget *ref_button, *add_button, *rem_button;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
290 GtkWidget *table, *label;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
291 struct chat_room *cr = NULL;
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
292 GList *items = NULL;
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
293 GList *crs = chat_rooms;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
294
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
295 if (cp)
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
296 g_free(cp);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
297 cp = g_new0(struct chat_page, 1);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
298
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
299
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
300 ret = gtk_vbox_new(FALSE, 18);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
301 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
302
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
303 vbox = make_frame(ret, _("Chat Rooms"));
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
304
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
305 table = gtk_table_new(4, 2, FALSE);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
306 gtk_widget_show(table);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
307
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
308 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
309
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
310 list1 = gtk_list_new();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
311 list2 = gtk_list_new();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
312 sw1 = gtk_scrolled_window_new(NULL, NULL);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
313 sw2 = gtk_scrolled_window_new(NULL, NULL);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
314
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
315 ref_button = picture_button(prefs, _("Refresh"), refresh_xpm);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
316 add_button = picture_button(prefs, _("Add"), gnome_add_xpm);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
317 rem_button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
318 gtk_widget_show(list1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
319 gtk_widget_show(sw1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
320 gtk_widget_show(list2);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
321 gtk_widget_show(sw2);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
322
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
323 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
324 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
325
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
326 cp->list1 = list1;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
327 cp->list2 = list2;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
328
4165
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 4164
diff changeset
329 g_signal_connect(GTK_OBJECT(ref_button), "clicked", G_CALLBACK(refresh_list), cp);
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 4164
diff changeset
330 g_signal_connect(GTK_OBJECT(rem_button), "clicked", G_CALLBACK(remove_chat), cp);
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 4164
diff changeset
331 g_signal_connect(GTK_OBJECT(add_button), "clicked", G_CALLBACK(add_chat), cp);
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
332
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
333 label = gtk_label_new(_("List of available chats"));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
334 gtk_widget_show(label);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
335
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
336 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
337 gtk_table_attach(GTK_TABLE(table), ref_button, 0, 1, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
338 gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3,
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
339 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
340 gtk_table_attach(GTK_TABLE(table), add_button, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, 0, 0);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
341
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
342
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
343 label = gtk_label_new(_("List of subscribed chats"));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
344 gtk_widget_show(label);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
345
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
346 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
347 gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3,
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
348 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
349 gtk_table_attach(GTK_TABLE(table), rem_button, 1, 2, 3, 4, GTK_SHRINK, GTK_SHRINK, 0, 0);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
350
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
351
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
352 item = gtk_list_item_new_with_label(_("Gaim Chat"));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
353 cr = g_new0(struct chat_room, 1);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
354 strcpy(cr->name, _("Gaim Chat"));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
355 cr->exchange = 4;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
356 gtk_object_set_user_data(GTK_OBJECT(item), cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
357 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
358 gtk_list_append_items(GTK_LIST(list1), g_list_append(NULL, item));
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
359
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
360
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
361 while (crs) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
362 cr = (struct chat_room *)crs->data;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
363 item = gtk_list_item_new_with_label(cr->name);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
364 gtk_object_set_user_data(GTK_OBJECT(item), cr);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
365 gtk_widget_show(item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
366 items = g_list_append(items, item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
367
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
368 crs = crs->next;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
369 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
370
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
371 gtk_list_append_items(GTK_LIST(list2), items);
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
372 gtk_widget_show_all(ret);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
373 return ret;
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
374 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
375
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
376 static void handle_signon(struct gaim_connection *gc)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
377 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
378 setup_buddy_chats();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
379 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
380
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
381 G_MODULE_EXPORT char *gaim_plugin_init(GModule *m)
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
382 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
383 restore_chat_prefs();
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
384 gaim_signal_connect(m, event_signon, handle_signon, NULL);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
385 return NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
386 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
387
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
388 G_MODULE_EXPORT void gaim_plugin_remove()
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
389 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
390 if (item)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
391 gtk_tree_remove_item(GTK_TREE(buddies), item);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
392 item = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
393
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
394 while (chat_rooms) {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
395 g_free(chat_rooms->data);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
396 chat_rooms = g_list_remove(chat_rooms, chat_rooms->data);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
397 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
398
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
399 if (cp)
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
400 g_free(cp);
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
401 cp = NULL;
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
402 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
403
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
404 struct gaim_plugin_description desc;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
405 struct gaim_plugin_description *gaim_plugin_desc() {
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
406 desc.api_version = PLUGIN_API_VERSION;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
407 desc.name = g_strdup("Chat List");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
408 desc.version = g_strdup(VERSION);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
409 desc.description = g_strdup("Allows you to add chat rooms to your buddy list.");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
410 desc.authors = g_strdup("Eric Warmenhoven &lt;eric@warmenhoven.org>");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
411 desc.url = g_strdup(WEBSITE);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
412 return &desc;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
413 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3475
diff changeset
414
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
415 G_MODULE_EXPORT char *name()
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
416 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
417 return "Chat List";
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
418 }
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
419
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
420 G_MODULE_EXPORT char *description()
2241
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
421 {
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
422 return "Allows you to add chat rooms to your buddy list. Click the configure button to choose"
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
423 " which rooms.";
a0ee02e861b9 [gaim-migrate @ 2251]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
424 }