| 171 } |
171 } |
| 172 |
172 |
| 173 static void |
173 static void |
| 174 create_joinchat_menu(GtkWidget *box) |
174 create_joinchat_menu(GtkWidget *box) |
| 175 { |
175 { |
| |
176 GaimAccount *account; |
| 176 GtkWidget *optmenu; |
177 GtkWidget *optmenu; |
| 177 GtkWidget *menu; |
178 GtkWidget *menu; |
| 178 GtkWidget *opt; |
179 GtkWidget *opt; |
| 179 GSList *c; |
180 GList *c; |
| 180 struct gaim_connection *g; |
181 GaimConnection *g; |
| 181 char buf[2048]; |
182 char buf[2048]; |
| 182 |
183 |
| 183 optmenu = gtk_option_menu_new(); |
184 optmenu = gtk_option_menu_new(); |
| 184 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 0); |
185 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 0); |
| 185 |
186 |
| 186 menu = gtk_menu_new(); |
187 menu = gtk_menu_new(); |
| 187 joinchatgc = NULL; |
188 joinchatgc = NULL; |
| 188 |
189 |
| 189 for (c = connections; c != NULL; c = c->next) { |
190 for (c = gaim_connections_get_all(); c != NULL; c = c->next) { |
| 190 g = (struct gaim_connection *)c->data; |
191 g = (GaimConnection *)c->data; |
| 191 |
192 |
| 192 if (!GAIM_PLUGIN_PROTOCOL_INFO(g->prpl)->join_chat) |
193 if (!GAIM_PLUGIN_PROTOCOL_INFO(g->prpl)->join_chat) |
| 193 continue; |
194 continue; |
| 194 |
195 |
| 195 if (!joinchatgc) |
196 if (!joinchatgc) |
| 196 joinchatgc = g; |
197 joinchatgc = g; |
| 197 |
198 |
| |
199 account = gaim_connection_get_account(g); |
| |
200 |
| 198 g_snprintf(buf, sizeof(buf), "%s (%s)", |
201 g_snprintf(buf, sizeof(buf), "%s (%s)", |
| 199 g->username, g->prpl->info->name); |
202 gaim_account_get_username(account), g->prpl->info->name); |
| 200 opt = gtk_menu_item_new_with_label(buf); |
203 opt = gtk_menu_item_new_with_label(buf); |
| 201 |
204 |
| 202 g_object_set_data(G_OBJECT(opt), "gaim_connection", g); |
205 g_object_set_data(G_OBJECT(opt), "gaim_connection", g); |
| 203 |
206 |
| 204 g_signal_connect(G_OBJECT(opt), "activate", |
207 g_signal_connect(G_OBJECT(opt), "activate", |