Mercurial > pidgin.yaz
annotate finch/gntaccount.c @ 18037:e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
the split characters from the beginning of the username
I'm not particularly happy with the name 'reverse' for this, but I'm
not feeling creative enough at the moment to come up with something better.
If someone comes up with something better before 2.1.0, feel free to change it.
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 04 Jun 2007 04:37:07 +0000 |
parents | 8c3a3407af58 |
children | 58e28ccf08e6 |
rev | line source |
---|---|
15818 | 1 /** |
2 * @file gntaccount.c GNT Account API | |
16194
0f0832c13fcb
Rename the Doxygen group from gntui to finch and define the finch group
Richard Laager <rlaager@wiktel.com>
parents:
15871
diff
changeset
|
3 * @ingroup finch |
15818 | 4 * |
15871
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
5 * finch |
15818 | 6 * |
15871
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
7 * Finch is the legal property of its developers, whose names are too numerous |
15818 | 8 * to list here. Please refer to the COPYRIGHT file distributed with this |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 #include <gnt.h> | |
26 #include <gntbox.h> | |
27 #include <gntbutton.h> | |
28 #include <gntcheckbox.h> | |
29 #include <gntcombobox.h> | |
30 #include <gntentry.h> | |
31 #include <gntlabel.h> | |
32 #include <gntline.h> | |
33 #include <gnttree.h> | |
34 | |
35 #include <account.h> | |
36 #include <accountopt.h> | |
37 #include <connection.h> | |
38 #include <notify.h> | |
39 #include <plugin.h> | |
40 #include <request.h> | |
41 | |
42 #include "gntaccount.h" | |
15823 | 43 #include "finch.h" |
15818 | 44 |
45 #include <string.h> | |
46 | |
47 typedef struct | |
48 { | |
49 GntWidget *window; | |
50 GntWidget *tree; | |
51 } FinchAccountList; | |
52 | |
53 static FinchAccountList accounts; | |
54 | |
55 typedef struct | |
56 { | |
15823 | 57 PurpleAccount *account; /* NULL for a new account */ |
15818 | 58 |
59 GntWidget *window; | |
60 | |
61 GntWidget *protocol; | |
62 GntWidget *screenname; | |
63 GntWidget *password; | |
64 GntWidget *alias; | |
65 | |
66 GntWidget *splits; | |
67 GList *split_entries; | |
68 | |
69 GList *prpl_entries; | |
70 GntWidget *prpls; | |
71 | |
72 GntWidget *newmail; | |
73 GntWidget *remember; | |
74 } AccountEditDialog; | |
75 | |
76 /* This is necessary to close an edit-dialog when an account is deleted */ | |
77 static GList *accountdialogs; | |
78 | |
79 static void | |
15823 | 80 account_add(PurpleAccount *account) |
15818 | 81 { |
82 gnt_tree_add_choice(GNT_TREE(accounts.tree), account, | |
83 gnt_tree_create_row(GNT_TREE(accounts.tree), | |
15823 | 84 purple_account_get_username(account), |
85 purple_account_get_protocol_name(account)), | |
15818 | 86 NULL, NULL); |
87 gnt_tree_set_choice(GNT_TREE(accounts.tree), account, | |
15823 | 88 purple_account_get_enabled(account, FINCH_UI)); |
15818 | 89 } |
90 | |
91 static void | |
92 edit_dialog_destroy(AccountEditDialog *dialog) | |
93 { | |
94 accountdialogs = g_list_remove(accountdialogs, dialog); | |
95 g_list_free(dialog->prpl_entries); | |
96 g_list_free(dialog->split_entries); | |
97 g_free(dialog); | |
98 } | |
99 | |
100 static void | |
101 save_account_cb(AccountEditDialog *dialog) | |
102 { | |
15823 | 103 PurpleAccount *account; |
104 PurplePlugin *plugin; | |
105 PurplePluginProtocolInfo *prplinfo; | |
15818 | 106 const char *value; |
107 GString *username; | |
108 | |
109 /* XXX: Do some error checking first. */ | |
110 | |
111 plugin = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(dialog->protocol)); | |
15823 | 112 prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
15818 | 113 |
114 /* Screenname && user-splits */ | |
115 value = gnt_entry_get_text(GNT_ENTRY(dialog->screenname)); | |
116 | |
117 if (value == NULL || *value == '\0') | |
118 { | |
15823 | 119 purple_notify_error(NULL, _("Error"), _("Account was not added"), |
15818 | 120 _("Screenname of an account must be non-empty.")); |
121 return; | |
122 } | |
123 | |
124 username = g_string_new(value); | |
125 | |
126 if (prplinfo != NULL) | |
127 { | |
128 GList *iter, *entries; | |
129 for (iter = prplinfo->user_splits, entries = dialog->split_entries; | |
130 iter && entries; iter = iter->next, entries = entries->next) | |
131 { | |
15823 | 132 PurpleAccountUserSplit *split = iter->data; |
15818 | 133 GntWidget *entry = entries->data; |
134 | |
135 value = gnt_entry_get_text(GNT_ENTRY(entry)); | |
136 if (value == NULL || *value == '\0') | |
15823 | 137 value = purple_account_user_split_get_default_value(split); |
15818 | 138 g_string_append_printf(username, "%c%s", |
15823 | 139 purple_account_user_split_get_separator(split), |
15818 | 140 value); |
141 } | |
142 } | |
143 | |
144 if (dialog->account == NULL) | |
145 { | |
15823 | 146 account = purple_account_new(username->str, purple_plugin_get_id(plugin)); |
147 purple_accounts_add(account); | |
15818 | 148 } |
149 else | |
150 { | |
151 account = dialog->account; | |
152 | |
153 /* Protocol */ | |
15823 | 154 purple_account_set_protocol_id(account, purple_plugin_get_id(plugin)); |
155 purple_account_set_username(account, username->str); | |
15818 | 156 } |
157 g_string_free(username, TRUE); | |
158 | |
159 /* Alias */ | |
160 value = gnt_entry_get_text(GNT_ENTRY(dialog->alias)); | |
161 if (value && *value) | |
15823 | 162 purple_account_set_alias(account, value); |
15818 | 163 |
164 /* Remember password and password */ | |
15823 | 165 purple_account_set_remember_password(account, |
15818 | 166 gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->remember))); |
167 value = gnt_entry_get_text(GNT_ENTRY(dialog->password)); | |
15823 | 168 if (value && *value && purple_account_get_remember_password(account)) |
169 purple_account_set_password(account, value); | |
15818 | 170 else |
15823 | 171 purple_account_set_password(account, NULL); |
15818 | 172 |
173 /* Mail notification */ | |
15823 | 174 purple_account_set_check_mail(account, |
15818 | 175 gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->newmail))); |
176 | |
177 /* Protocol options */ | |
178 if (prplinfo) | |
179 { | |
180 GList *iter, *entries; | |
181 | |
182 for (iter = prplinfo->protocol_options, entries = dialog->prpl_entries; | |
183 iter && entries; iter = iter->next, entries = entries->next) | |
184 { | |
15823 | 185 PurpleAccountOption *option = iter->data; |
15818 | 186 GntWidget *entry = entries->data; |
15823 | 187 PurplePrefType type = purple_account_option_get_type(option); |
188 const char *setting = purple_account_option_get_setting(option); | |
15818 | 189 |
15823 | 190 if (type == PURPLE_PREF_STRING) |
15818 | 191 { |
192 const char *value = gnt_entry_get_text(GNT_ENTRY(entry)); | |
15823 | 193 purple_account_set_string(account, setting, value); |
15818 | 194 } |
15823 | 195 else if (type == PURPLE_PREF_INT) |
15818 | 196 { |
197 const char *str = gnt_entry_get_text(GNT_ENTRY(entry)); | |
198 int value = 0; | |
199 if (str) | |
200 value = atoi(str); | |
15823 | 201 purple_account_set_int(account, setting, value); |
15818 | 202 } |
15823 | 203 else if (type == PURPLE_PREF_BOOLEAN) |
15818 | 204 { |
205 gboolean value = gnt_check_box_get_checked(GNT_CHECK_BOX(entry)); | |
15823 | 206 purple_account_set_bool(account, setting, value); |
15818 | 207 } |
15823 | 208 else if (type == PURPLE_PREF_STRING_LIST) |
15818 | 209 { |
210 /* TODO: */ | |
211 } | |
212 else | |
213 { | |
214 g_assert_not_reached(); | |
215 } | |
216 } | |
217 } | |
218 | |
219 /* XXX: Proxy options */ | |
220 | |
221 gnt_widget_destroy(dialog->window); | |
222 } | |
223 | |
224 static void | |
225 update_user_splits(AccountEditDialog *dialog) | |
226 { | |
227 GntWidget *hbox; | |
15823 | 228 PurplePlugin *plugin; |
229 PurplePluginProtocolInfo *prplinfo; | |
15818 | 230 GList *iter, *entries; |
231 char *username = NULL; | |
232 | |
233 if (dialog->splits) | |
234 { | |
235 gnt_box_remove_all(GNT_BOX(dialog->splits)); | |
236 g_list_free(dialog->split_entries); | |
237 } | |
238 else | |
239 { | |
240 dialog->splits = gnt_vbox_new(FALSE); | |
241 gnt_box_set_pad(GNT_BOX(dialog->splits), 0); | |
242 gnt_box_set_fill(GNT_BOX(dialog->splits), TRUE); | |
243 } | |
244 | |
245 dialog->split_entries = NULL; | |
246 | |
247 plugin = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(dialog->protocol)); | |
248 if (!plugin) | |
249 return; | |
15823 | 250 prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
15818 | 251 |
15823 | 252 username = dialog->account ? g_strdup(purple_account_get_username(dialog->account)) : NULL; |
15818 | 253 |
254 for (iter = prplinfo->user_splits; iter; iter = iter->next) | |
255 { | |
15823 | 256 PurpleAccountUserSplit *split = iter->data; |
15818 | 257 GntWidget *entry; |
258 char *buf; | |
259 | |
260 hbox = gnt_hbox_new(TRUE); | |
261 gnt_box_add_widget(GNT_BOX(dialog->splits), hbox); | |
262 | |
15823 | 263 buf = g_strdup_printf("%s:", purple_account_user_split_get_text(split)); |
15818 | 264 gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(buf)); |
265 | |
266 entry = gnt_entry_new(NULL); | |
267 gnt_box_add_widget(GNT_BOX(hbox), entry); | |
268 | |
269 dialog->split_entries = g_list_append(dialog->split_entries, entry); | |
270 g_free(buf); | |
271 } | |
272 | |
273 for (iter = g_list_last(prplinfo->user_splits), entries = g_list_last(dialog->split_entries); | |
274 iter && entries; iter = iter->prev, entries = entries->prev) | |
275 { | |
276 GntWidget *entry = entries->data; | |
15823 | 277 PurpleAccountUserSplit *split = iter->data; |
15818 | 278 const char *value = NULL; |
279 char *s; | |
280 | |
281 if (dialog->account) | |
282 { | |
18037
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
17419
diff
changeset
|
283 if(purple_account_user_split_get_reverse(split)) |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
17419
diff
changeset
|
284 s = strrchr(username, purple_account_user_split_get_separator(split)); |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
17419
diff
changeset
|
285 else |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
17419
diff
changeset
|
286 s = strchr(username, purple_account_user_split_get_separator(split)); |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
17419
diff
changeset
|
287 |
15818 | 288 if (s != NULL) |
289 { | |
290 *s = '\0'; | |
291 s++; | |
292 value = s; | |
293 } | |
294 } | |
295 if (value == NULL) | |
15823 | 296 value = purple_account_user_split_get_default_value(split); |
15818 | 297 |
298 if (value != NULL) | |
299 gnt_entry_set_text(GNT_ENTRY(entry), value); | |
300 } | |
301 | |
302 if (username != NULL) | |
303 gnt_entry_set_text(GNT_ENTRY(dialog->screenname), username); | |
304 | |
305 g_free(username); | |
306 } | |
307 | |
308 static void | |
309 add_protocol_options(AccountEditDialog *dialog) | |
310 { | |
15823 | 311 PurplePlugin *plugin; |
312 PurplePluginProtocolInfo *prplinfo; | |
15818 | 313 GList *iter; |
314 GntWidget *vbox, *box; | |
15823 | 315 PurpleAccount *account; |
15818 | 316 |
317 if (dialog->prpls) | |
318 gnt_box_remove_all(GNT_BOX(dialog->prpls)); | |
319 else | |
320 { | |
321 dialog->prpls = vbox = gnt_vbox_new(FALSE); | |
322 gnt_box_set_pad(GNT_BOX(vbox), 0); | |
323 gnt_box_set_alignment(GNT_BOX(vbox), GNT_ALIGN_LEFT); | |
324 gnt_box_set_fill(GNT_BOX(vbox), TRUE); | |
325 } | |
326 | |
327 if (dialog->prpl_entries) | |
328 { | |
329 g_list_free(dialog->prpl_entries); | |
330 dialog->prpl_entries = NULL; | |
331 } | |
332 | |
333 vbox = dialog->prpls; | |
334 | |
335 plugin = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(dialog->protocol)); | |
336 if (!plugin) | |
337 return; | |
338 | |
15823 | 339 prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
15818 | 340 |
341 account = dialog->account; | |
342 | |
343 for (iter = prplinfo->protocol_options; iter; iter = iter->next) | |
344 { | |
15823 | 345 PurpleAccountOption *option = iter->data; |
346 PurplePrefType type = purple_account_option_get_type(option); | |
15818 | 347 |
348 box = gnt_hbox_new(TRUE); | |
349 gnt_box_set_pad(GNT_BOX(box), 0); | |
350 gnt_box_add_widget(GNT_BOX(vbox), box); | |
351 | |
15823 | 352 if (type == PURPLE_PREF_BOOLEAN) |
15818 | 353 { |
15823 | 354 GntWidget *widget = gnt_check_box_new(purple_account_option_get_text(option)); |
15818 | 355 gnt_box_add_widget(GNT_BOX(box), widget); |
356 dialog->prpl_entries = g_list_append(dialog->prpl_entries, widget); | |
357 | |
358 if (account) | |
359 gnt_check_box_set_checked(GNT_CHECK_BOX(widget), | |
15823 | 360 purple_account_get_bool(account, |
361 purple_account_option_get_setting(option), | |
362 purple_account_option_get_default_bool(option))); | |
15818 | 363 else |
364 gnt_check_box_set_checked(GNT_CHECK_BOX(widget), | |
15823 | 365 purple_account_option_get_default_bool(option)); |
15818 | 366 } |
367 else | |
368 { | |
369 gnt_box_add_widget(GNT_BOX(box), | |
15823 | 370 gnt_label_new(purple_account_option_get_text(option))); |
15818 | 371 |
15823 | 372 if (type == PURPLE_PREF_STRING_LIST) |
15818 | 373 { |
374 /* TODO: Use a combobox */ | |
375 /* Don't forget to append the widget to prpl_entries */ | |
376 } | |
377 else | |
378 { | |
379 GntWidget *entry = gnt_entry_new(NULL); | |
380 gnt_box_add_widget(GNT_BOX(box), entry); | |
381 dialog->prpl_entries = g_list_append(dialog->prpl_entries, entry); | |
382 | |
15823 | 383 if (type == PURPLE_PREF_STRING) |
15818 | 384 { |
15823 | 385 const char *dv = purple_account_option_get_default_string(option); |
15818 | 386 |
387 if (account) | |
388 gnt_entry_set_text(GNT_ENTRY(entry), | |
15823 | 389 purple_account_get_string(account, |
390 purple_account_option_get_setting(option), dv)); | |
15818 | 391 else |
392 gnt_entry_set_text(GNT_ENTRY(entry), dv); | |
393 } | |
15823 | 394 else if (type == PURPLE_PREF_INT) |
15818 | 395 { |
396 char str[32]; | |
15823 | 397 int value = purple_account_option_get_default_int(option); |
15818 | 398 if (account) |
15823 | 399 value = purple_account_get_int(account, |
400 purple_account_option_get_setting(option), value); | |
15818 | 401 snprintf(str, sizeof(str), "%d", value); |
402 gnt_entry_set_flag(GNT_ENTRY(entry), GNT_ENTRY_FLAG_INT); | |
403 gnt_entry_set_text(GNT_ENTRY(entry), str); | |
404 } | |
405 else | |
406 { | |
407 g_assert_not_reached(); | |
408 } | |
409 } | |
410 } | |
411 } | |
412 } | |
413 | |
414 static void | |
415 update_user_options(AccountEditDialog *dialog) | |
416 { | |
15823 | 417 PurplePlugin *plugin; |
418 PurplePluginProtocolInfo *prplinfo; | |
15818 | 419 |
420 plugin = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(dialog->protocol)); | |
421 if (!plugin) | |
422 return; | |
423 | |
15823 | 424 prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
15818 | 425 |
426 if (dialog->newmail == NULL) | |
427 dialog->newmail = gnt_check_box_new(_("New mail notifications")); | |
428 if (dialog->account) | |
429 gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->newmail), | |
15823 | 430 purple_account_get_check_mail(dialog->account)); |
15818 | 431 if (!prplinfo || !(prplinfo->options & OPT_PROTO_MAIL_CHECK)) |
432 gnt_widget_set_visible(dialog->newmail, FALSE); | |
433 else | |
434 gnt_widget_set_visible(dialog->newmail, TRUE); | |
435 | |
436 if (dialog->remember == NULL) | |
437 dialog->remember = gnt_check_box_new(_("Remember password")); | |
438 if (dialog->account) | |
439 gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->remember), | |
15823 | 440 purple_account_get_remember_password(dialog->account)); |
15818 | 441 } |
442 | |
443 static void | |
15823 | 444 prpl_changed_cb(GntWidget *combo, PurplePlugin *old, PurplePlugin *new, AccountEditDialog *dialog) |
15818 | 445 { |
446 update_user_splits(dialog); | |
447 add_protocol_options(dialog); | |
448 update_user_options(dialog); /* This may not be necessary here */ | |
449 gnt_box_readjust(GNT_BOX(dialog->window)); | |
450 gnt_widget_draw(dialog->window); | |
451 } | |
452 | |
453 static void | |
15823 | 454 edit_account(PurpleAccount *account) |
15818 | 455 { |
456 GntWidget *window, *hbox; | |
457 GntWidget *combo, *button, *entry; | |
458 GList *list, *iter; | |
459 AccountEditDialog *dialog; | |
460 | |
461 if (account) | |
462 { | |
463 GList *iter; | |
464 for (iter = accountdialogs; iter; iter = iter->next) | |
465 { | |
466 AccountEditDialog *dlg = iter->data; | |
467 if (dlg->account == account) | |
468 return; | |
469 } | |
470 } | |
471 | |
472 dialog = g_new0(AccountEditDialog, 1); | |
473 accountdialogs = g_list_prepend(accountdialogs, dialog); | |
474 | |
475 dialog->window = window = gnt_vbox_new(FALSE); | |
476 dialog->account = account; | |
477 gnt_box_set_toplevel(GNT_BOX(window), TRUE); | |
478 gnt_box_set_title(GNT_BOX(window), account ? _("Modify Account") : _("New Account")); | |
479 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); | |
480 gnt_box_set_pad(GNT_BOX(window), 0); | |
481 gnt_widget_set_name(window, "edit-account"); | |
482 gnt_box_set_fill(GNT_BOX(window), TRUE); | |
483 | |
484 hbox = gnt_hbox_new(TRUE); | |
485 gnt_box_set_pad(GNT_BOX(hbox), 0); | |
486 gnt_box_add_widget(GNT_BOX(window), hbox); | |
487 | |
488 dialog->protocol = combo = gnt_combo_box_new(); | |
15823 | 489 list = purple_plugins_get_protocols(); |
15818 | 490 for (iter = list; iter; iter = iter->next) |
491 { | |
492 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), iter->data, | |
15823 | 493 ((PurplePlugin*)iter->data)->info->name); |
15818 | 494 } |
495 | |
496 if (account) | |
497 gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), | |
15823 | 498 purple_plugins_find_with_id(purple_account_get_protocol_id(account))); |
15818 | 499 else |
500 gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), list->data); | |
501 | |
502 g_signal_connect(G_OBJECT(combo), "selection-changed", G_CALLBACK(prpl_changed_cb), dialog); | |
503 | |
504 gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(_("Protocol:"))); | |
505 gnt_box_add_widget(GNT_BOX(hbox), combo); | |
506 | |
507 hbox = gnt_hbox_new(TRUE); | |
508 gnt_box_set_pad(GNT_BOX(hbox), 0); | |
509 gnt_box_add_widget(GNT_BOX(window), hbox); | |
510 | |
511 dialog->screenname = entry = gnt_entry_new(NULL); | |
512 gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(_("Screen name:"))); | |
513 gnt_box_add_widget(GNT_BOX(hbox), entry); | |
514 | |
515 /* User splits */ | |
516 update_user_splits(dialog); | |
517 gnt_box_add_widget(GNT_BOX(window), dialog->splits); | |
518 | |
519 hbox = gnt_hbox_new(TRUE); | |
520 gnt_box_set_pad(GNT_BOX(hbox), 0); | |
521 gnt_box_add_widget(GNT_BOX(window), hbox); | |
522 | |
523 dialog->password = entry = gnt_entry_new(NULL); | |
524 gnt_entry_set_masked(GNT_ENTRY(entry), TRUE); | |
525 gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(_("Password:"))); | |
526 gnt_box_add_widget(GNT_BOX(hbox), entry); | |
527 if (account) | |
15823 | 528 gnt_entry_set_text(GNT_ENTRY(entry), purple_account_get_password(account)); |
15818 | 529 |
530 hbox = gnt_hbox_new(TRUE); | |
531 gnt_box_set_pad(GNT_BOX(hbox), 0); | |
532 gnt_box_add_widget(GNT_BOX(window), hbox); | |
533 | |
534 dialog->alias = entry = gnt_entry_new(NULL); | |
535 gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(_("Alias:"))); | |
536 gnt_box_add_widget(GNT_BOX(hbox), entry); | |
537 if (account) | |
15823 | 538 gnt_entry_set_text(GNT_ENTRY(entry), purple_account_get_alias(account)); |
15818 | 539 |
540 /* User options */ | |
541 update_user_options(dialog); | |
542 gnt_box_add_widget(GNT_BOX(window), dialog->remember); | |
543 gnt_box_add_widget(GNT_BOX(window), dialog->newmail); | |
544 | |
545 gnt_box_add_widget(GNT_BOX(window), gnt_line_new(FALSE)); | |
546 | |
547 /* The advanced box */ | |
548 add_protocol_options(dialog); | |
549 gnt_box_add_widget(GNT_BOX(window), dialog->prpls); | |
550 | |
551 /* TODO: Add proxy options */ | |
552 | |
553 /* The button box */ | |
554 hbox = gnt_hbox_new(FALSE); | |
555 gnt_box_add_widget(GNT_BOX(window), hbox); | |
556 gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); | |
557 | |
558 button = gnt_button_new(_("Cancel")); | |
559 gnt_box_add_widget(GNT_BOX(hbox), button); | |
560 g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), window); | |
561 | |
562 button = gnt_button_new(_("Save")); | |
563 gnt_box_add_widget(GNT_BOX(hbox), button); | |
564 g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(save_account_cb), dialog); | |
565 | |
566 g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(edit_dialog_destroy), dialog); | |
567 | |
568 gnt_widget_show(window); | |
569 gnt_box_readjust(GNT_BOX(window)); | |
570 gnt_widget_draw(window); | |
571 } | |
572 | |
573 static void | |
574 add_account_cb(GntWidget *widget, gpointer null) | |
575 { | |
576 edit_account(NULL); | |
577 } | |
578 | |
579 static void | |
580 modify_account_cb(GntWidget *widget, GntTree *tree) | |
581 { | |
15823 | 582 PurpleAccount *account = gnt_tree_get_selection_data(tree); |
15818 | 583 if (!account) |
584 return; | |
585 edit_account(account); | |
586 } | |
587 | |
588 static void | |
15823 | 589 really_delete_account(PurpleAccount *account) |
15818 | 590 { |
591 GList *iter; | |
592 for (iter = accountdialogs; iter; iter = iter->next) | |
593 { | |
594 AccountEditDialog *dlg = iter->data; | |
595 if (dlg->account == account) | |
596 { | |
597 gnt_widget_destroy(dlg->window); | |
598 break; | |
599 } | |
600 } | |
15823 | 601 purple_request_close_with_handle(account); /* Close any other opened delete window */ |
602 purple_accounts_delete(account); | |
15818 | 603 } |
604 | |
605 static void | |
606 delete_account_cb(GntWidget *widget, GntTree *tree) | |
607 { | |
15823 | 608 PurpleAccount *account; |
15818 | 609 char *prompt; |
610 | |
611 account = gnt_tree_get_selection_data(tree); | |
612 if (!account) | |
613 return; | |
614 | |
615 prompt = g_strdup_printf(_("Are you sure you want to delete %s?"), | |
15823 | 616 purple_account_get_username(account)); |
15818 | 617 |
16465
4b6d81d26b56
Fix a warning introduced with the request api changes.
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
618 purple_request_action(account, _("Delete Account"), prompt, NULL, 0, |
4b6d81d26b56
Fix a warning introduced with the request api changes.
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
619 account, NULL, NULL, account, 2, |
4b6d81d26b56
Fix a warning introduced with the request api changes.
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
620 _("Delete"), really_delete_account, |
4b6d81d26b56
Fix a warning introduced with the request api changes.
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
621 _("Cancel"), NULL); |
15818 | 622 g_free(prompt); |
623 } | |
624 | |
625 static void | |
626 account_toggled(GntWidget *widget, void *key, gpointer null) | |
627 { | |
15823 | 628 PurpleAccount *account = key; |
15818 | 629 |
15823 | 630 purple_account_set_enabled(account, FINCH_UI, gnt_tree_get_choice(GNT_TREE(widget), key)); |
15818 | 631 } |
632 | |
633 static void | |
634 reset_accounts_win(GntWidget *widget, gpointer null) | |
635 { | |
636 accounts.window = NULL; | |
637 accounts.tree = NULL; | |
638 } | |
639 | |
640 void finch_accounts_show_all() | |
641 { | |
642 GList *iter; | |
643 GntWidget *box, *button; | |
644 | |
645 if (accounts.window) | |
646 return; | |
647 | |
648 accounts.window = gnt_vbox_new(FALSE); | |
649 gnt_box_set_toplevel(GNT_BOX(accounts.window), TRUE); | |
650 gnt_box_set_title(GNT_BOX(accounts.window), _("Accounts")); | |
651 gnt_box_set_pad(GNT_BOX(accounts.window), 0); | |
652 gnt_box_set_alignment(GNT_BOX(accounts.window), GNT_ALIGN_MID); | |
653 gnt_widget_set_name(accounts.window, "accounts"); | |
654 | |
655 gnt_box_add_widget(GNT_BOX(accounts.window), | |
656 gnt_label_new(_("You can enable/disable accounts from the following list."))); | |
657 | |
658 gnt_box_add_widget(GNT_BOX(accounts.window), gnt_line_new(FALSE)); | |
659 | |
660 accounts.tree = gnt_tree_new_with_columns(2); | |
661 GNT_WIDGET_SET_FLAGS(accounts.tree, GNT_WIDGET_NO_BORDER); | |
662 | |
15823 | 663 for (iter = purple_accounts_get_all(); iter; iter = iter->next) |
15818 | 664 { |
15823 | 665 PurpleAccount *account = iter->data; |
15818 | 666 account_add(account); |
667 } | |
668 | |
669 g_signal_connect(G_OBJECT(accounts.tree), "toggled", G_CALLBACK(account_toggled), NULL); | |
670 | |
671 gnt_tree_set_col_width(GNT_TREE(accounts.tree), 0, 40); | |
672 gnt_tree_set_col_width(GNT_TREE(accounts.tree), 1, 10); | |
673 gnt_box_add_widget(GNT_BOX(accounts.window), accounts.tree); | |
674 | |
675 gnt_box_add_widget(GNT_BOX(accounts.window), gnt_line_new(FALSE)); | |
676 | |
677 box = gnt_hbox_new(FALSE); | |
678 | |
679 button = gnt_button_new(_("Add")); | |
680 gnt_box_add_widget(GNT_BOX(box), button); | |
681 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(add_account_cb), NULL); | |
682 | |
683 button = gnt_button_new(_("Modify")); | |
684 gnt_box_add_widget(GNT_BOX(box), button); | |
685 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(modify_account_cb), accounts.tree); | |
686 | |
687 button = gnt_button_new(_("Delete")); | |
688 gnt_box_add_widget(GNT_BOX(box), button); | |
689 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(delete_account_cb), accounts.tree); | |
690 | |
691 gnt_box_add_widget(GNT_BOX(accounts.window), box); | |
692 | |
693 g_signal_connect(G_OBJECT(accounts.window), "destroy", G_CALLBACK(reset_accounts_win), NULL); | |
694 | |
695 gnt_widget_show(accounts.window); | |
696 } | |
697 | |
698 static gpointer | |
699 finch_accounts_get_handle() | |
700 { | |
701 static int handle; | |
702 | |
703 return &handle; | |
704 } | |
705 | |
706 static void | |
15823 | 707 account_added_callback(PurpleAccount *account) |
15818 | 708 { |
709 if (accounts.window == NULL) | |
710 return; | |
711 account_add(account); | |
712 gnt_widget_draw(accounts.tree); | |
713 } | |
714 | |
715 static void | |
15823 | 716 account_removed_callback(PurpleAccount *account) |
15818 | 717 { |
718 if (accounts.window == NULL) | |
719 return; | |
720 | |
721 gnt_tree_remove(GNT_TREE(accounts.tree), account); | |
722 } | |
723 | |
17419
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
724 static void |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
725 account_abled_cb(PurpleAccount *account, gpointer user_data) |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
726 { |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
727 if (accounts.window == NULL) |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
728 return; |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
729 gnt_tree_set_choice(GNT_TREE(accounts.tree), account, |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
730 GPOINTER_TO_INT(user_data)); |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
731 } |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
732 |
15818 | 733 void finch_accounts_init() |
734 { | |
735 GList *iter; | |
736 | |
15823 | 737 purple_signal_connect(purple_accounts_get_handle(), "account-added", |
738 finch_accounts_get_handle(), PURPLE_CALLBACK(account_added_callback), | |
15818 | 739 NULL); |
15823 | 740 purple_signal_connect(purple_accounts_get_handle(), "account-removed", |
741 finch_accounts_get_handle(), PURPLE_CALLBACK(account_removed_callback), | |
15818 | 742 NULL); |
17419
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
743 purple_signal_connect(purple_accounts_get_handle(), "account-disabled", |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
744 finch_accounts_get_handle(), |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
745 PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE)); |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
746 purple_signal_connect(purple_accounts_get_handle(), "account-enabled", |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
747 finch_accounts_get_handle(), |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
748 PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE)); |
8c3a3407af58
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17104
diff
changeset
|
749 |
15823 | 750 for (iter = purple_accounts_get_all(); iter; iter = iter->next) { |
751 if (purple_account_get_enabled(iter->data, FINCH_UI)) | |
15818 | 752 break; |
753 } | |
754 if (!iter) | |
755 finch_accounts_show_all(); | |
756 } | |
757 | |
758 void finch_accounts_uninit() | |
759 { | |
760 if (accounts.window) | |
761 gnt_widget_destroy(accounts.window); | |
762 } | |
763 | |
764 /* The following uiops stuff are copied from gtkaccount.c */ | |
765 typedef struct | |
766 { | |
15823 | 767 PurpleAccount *account; |
15818 | 768 char *username; |
769 char *alias; | |
770 } AddUserData; | |
771 | |
772 static char * | |
15823 | 773 make_info(PurpleAccount *account, PurpleConnection *gc, const char *remote_user, |
15818 | 774 const char *id, const char *alias, const char *msg) |
775 { | |
776 if (msg != NULL && *msg == '\0') | |
777 msg = NULL; | |
778 | |
779 return g_strdup_printf(_("%s%s%s%s has made %s his or her buddy%s%s"), | |
780 remote_user, | |
781 (alias != NULL ? " (" : ""), | |
782 (alias != NULL ? alias : ""), | |
783 (alias != NULL ? ")" : ""), | |
784 (id != NULL | |
785 ? id | |
15823 | 786 : (purple_connection_get_display_name(gc) != NULL |
787 ? purple_connection_get_display_name(gc) | |
788 : purple_account_get_username(account))), | |
15818 | 789 (msg != NULL ? ": " : "."), |
790 (msg != NULL ? msg : "")); | |
791 } | |
792 | |
793 static void | |
15823 | 794 notify_added(PurpleAccount *account, const char *remote_user, |
15818 | 795 const char *id, const char *alias, |
796 const char *msg) | |
797 { | |
798 char *buffer; | |
15823 | 799 PurpleConnection *gc; |
15818 | 800 |
15823 | 801 gc = purple_account_get_connection(account); |
15818 | 802 |
803 buffer = make_info(account, gc, remote_user, id, alias, msg); | |
804 | |
15823 | 805 purple_notify_info(NULL, NULL, buffer, NULL); |
15818 | 806 |
807 g_free(buffer); | |
808 } | |
809 | |
810 static void | |
811 free_add_user_data(AddUserData *data) | |
812 { | |
813 g_free(data->username); | |
814 | |
815 if (data->alias != NULL) | |
816 g_free(data->alias); | |
817 | |
818 g_free(data); | |
819 } | |
820 | |
821 static void | |
822 add_user_cb(AddUserData *data) | |
823 { | |
15823 | 824 PurpleConnection *gc = purple_account_get_connection(data->account); |
15818 | 825 |
15823 | 826 if (g_list_find(purple_connections_get_all(), gc)) |
15818 | 827 { |
15823 | 828 purple_blist_request_add_buddy(data->account, data->username, |
15818 | 829 NULL, data->alias); |
830 } | |
831 | |
832 free_add_user_data(data); | |
833 } | |
834 | |
835 static void | |
15823 | 836 request_add(PurpleAccount *account, const char *remote_user, |
15818 | 837 const char *id, const char *alias, |
838 const char *msg) | |
839 { | |
840 char *buffer; | |
15823 | 841 PurpleConnection *gc; |
15818 | 842 AddUserData *data; |
843 | |
15823 | 844 gc = purple_account_get_connection(account); |
15818 | 845 |
846 data = g_new0(AddUserData, 1); | |
847 data->account = account; | |
848 data->username = g_strdup(remote_user); | |
849 data->alias = (alias != NULL ? g_strdup(alias) : NULL); | |
850 | |
851 buffer = make_info(account, gc, remote_user, id, alias, msg); | |
15823 | 852 purple_request_action(NULL, NULL, _("Add buddy to your list?"), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
853 buffer, PURPLE_DEFAULT_ACTION_NONE, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
854 account, remote_user, NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
855 data, 2, |
15818 | 856 _("Add"), G_CALLBACK(add_user_cb), |
857 _("Cancel"), G_CALLBACK(free_add_user_data)); | |
858 g_free(buffer); | |
859 } | |
860 | |
861 /* Copied from gtkaccount.c */ | |
862 typedef struct { | |
15823 | 863 PurpleAccountRequestAuthorizationCb auth_cb; |
864 PurpleAccountRequestAuthorizationCb deny_cb; | |
15818 | 865 void *data; |
866 char *username; | |
867 char *alias; | |
15823 | 868 PurpleAccount *account; |
15818 | 869 } auth_and_add; |
870 | |
871 static void | |
872 authorize_and_add_cb(auth_and_add *aa) | |
873 { | |
874 aa->auth_cb(aa->data); | |
15823 | 875 purple_blist_request_add_buddy(aa->account, aa->username, |
15818 | 876 NULL, aa->alias); |
877 | |
878 g_free(aa->username); | |
879 g_free(aa->alias); | |
880 g_free(aa); | |
881 } | |
882 | |
883 static void | |
884 deny_no_add_cb(auth_and_add *aa) | |
885 { | |
886 aa->deny_cb(aa->data); | |
887 | |
888 g_free(aa->username); | |
889 g_free(aa->alias); | |
890 g_free(aa); | |
891 } | |
892 | |
893 static void * | |
15823 | 894 finch_request_authorize(PurpleAccount *account, const char *remote_user, |
15818 | 895 const char *id, const char *alias, const char *message, gboolean on_list, |
896 GCallback auth_cb, GCallback deny_cb, void *user_data) | |
897 { | |
898 char *buffer; | |
15823 | 899 PurpleConnection *gc; |
15818 | 900 void *uihandle; |
901 | |
15823 | 902 gc = purple_account_get_connection(account); |
15818 | 903 if (message != NULL && *message == '\0') |
904 message = NULL; | |
905 | |
906 buffer = g_strdup_printf(_("%s%s%s%s wants to add %s to his or her buddy list%s%s"), | |
907 remote_user, | |
908 (alias != NULL ? " (" : ""), | |
909 (alias != NULL ? alias : ""), | |
910 (alias != NULL ? ")" : ""), | |
911 (id != NULL | |
912 ? id | |
15823 | 913 : (purple_connection_get_display_name(gc) != NULL |
914 ? purple_connection_get_display_name(gc) | |
915 : purple_account_get_username(account))), | |
15818 | 916 (message != NULL ? ": " : "."), |
917 (message != NULL ? message : "")); | |
918 if (!on_list) { | |
919 auth_and_add *aa = g_new(auth_and_add, 1); | |
15823 | 920 aa->auth_cb = (PurpleAccountRequestAuthorizationCb)auth_cb; |
921 aa->deny_cb = (PurpleAccountRequestAuthorizationCb)deny_cb; | |
15818 | 922 aa->data = user_data; |
923 aa->username = g_strdup(remote_user); | |
924 aa->alias = g_strdup(alias); | |
925 aa->account = account; | |
15823 | 926 uihandle = purple_request_action(NULL, _("Authorize buddy?"), buffer, NULL, |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
927 PURPLE_DEFAULT_ACTION_NONE, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
928 account, remote_user, NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
929 aa, 2, |
15818 | 930 _("Authorize"), authorize_and_add_cb, |
931 _("Deny"), deny_no_add_cb); | |
932 } else { | |
15823 | 933 uihandle = purple_request_action(NULL, _("Authorize buddy?"), buffer, NULL, |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
934 PURPLE_DEFAULT_ACTION_NONE, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
935 account, remote_user, NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16194
diff
changeset
|
936 user_data, 2, |
15818 | 937 _("Authorize"), auth_cb, |
938 _("Deny"), deny_cb); | |
939 } | |
940 g_free(buffer); | |
941 return uihandle; | |
942 } | |
943 | |
944 static void | |
945 finch_request_close(void *uihandle) | |
946 { | |
15823 | 947 purple_request_close(PURPLE_REQUEST_ACTION, uihandle); |
15818 | 948 } |
949 | |
15823 | 950 static PurpleAccountUiOps ui_ops = |
15818 | 951 { |
17104
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
952 notify_added, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
953 NULL, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
954 request_add, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
955 finch_request_authorize, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
956 finch_request_close, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
957 NULL, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
958 NULL, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
959 NULL, |
46f2f86e08e4
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents:
16465
diff
changeset
|
960 NULL |
15818 | 961 }; |
962 | |
15823 | 963 PurpleAccountUiOps *finch_accounts_get_ui_ops() |
15818 | 964 { |
965 return &ui_ops; | |
966 } | |
967 |