Mercurial > pidgin.yaz
annotate src/account.c @ 11075:812b285aeccd
[gaim-migrate @ 13085]
sf patch #1233654, from Sadrul H C
There was an error in the parsing of the status.
("active" and "type" are attributes of a status, rather
than children). That is fixed with this patch.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 09 Jul 2005 19:36:24 +0000 |
parents | 2eca9ed49469 |
children | 75be3005640e |
rev | line source |
---|---|
5865
412c5a0f9ef1
[gaim-migrate @ 6296]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
1 /** |
5563 | 2 * @file account.c Account API |
3 * @ingroup core | |
4 * | |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
10 * |
5563 | 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 */ | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
25 #include "internal.h" |
5563 | 26 #include "account.h" |
11053
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
27 #include "core.h" |
11067 | 28 #include "dbus-maybe.h" |
5717 | 29 #include "debug.h" |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
30 #include "notify.h" |
8235 | 31 #include "pounce.h" |
5563 | 32 #include "prefs.h" |
10945 | 33 #include "privacy.h" |
5665
132a30783c3d
[gaim-migrate @ 6081]
Christian Hammond <chipx86@chipx86.com>
parents:
5659
diff
changeset
|
34 #include "prpl.h" |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
35 #include "request.h" |
9944 | 36 #include "server.h" |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
37 #include "signals.h" |
9944 | 38 #include "status.h" |
5717 | 39 #include "util.h" |
10423 | 40 #include "xmlnode.h" |
5563 | 41 |
10429 | 42 /* TODO: Should use GaimValue instead of this? What about "ui"? */ |
5563 | 43 typedef struct |
44 { | |
45 GaimPrefType type; | |
46 | |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
47 char *ui; |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
48 |
5563 | 49 union |
50 { | |
51 int integer; | |
52 char *string; | |
53 gboolean bool; | |
54 | |
55 } value; | |
56 | |
57 } GaimAccountSetting; | |
58 | |
7015
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
59 |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
60 static GaimAccountUiOps *account_ui_ops = NULL; |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
61 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
62 static GList *accounts = NULL; |
10428 | 63 static guint save_timer = 0; |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
64 static gboolean accounts_loaded = FALSE; |
5563 | 65 |
10427 | 66 |
10428 | 67 /********************************************************************* |
10429 | 68 * Writing to disk * |
10428 | 69 *********************************************************************/ |
10427 | 70 |
71 static void | |
72 setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) | |
73 { | |
74 const char *name; | |
75 GaimAccountSetting *setting; | |
76 xmlnode *node, *child; | |
77 char buf[20]; | |
78 | |
79 name = (const char *)key; | |
80 setting = (GaimAccountSetting *)value; | |
81 node = (xmlnode *)user_data; | |
82 | |
83 child = xmlnode_new_child(node, "setting"); | |
84 xmlnode_set_attrib(child, "name", name); | |
85 | |
86 if (setting->type == GAIM_PREF_INT) { | |
87 xmlnode_set_attrib(child, "type", "int"); | |
88 snprintf(buf, sizeof(buf), "%d", setting->value.integer); | |
89 xmlnode_insert_data(child, buf, -1); | |
90 } | |
91 else if (setting->type == GAIM_PREF_STRING && setting->value.string != NULL) { | |
92 xmlnode_set_attrib(child, "type", "string"); | |
93 xmlnode_insert_data(child, setting->value.string, -1); | |
94 } | |
95 else if (setting->type == GAIM_PREF_BOOLEAN) { | |
96 xmlnode_set_attrib(child, "type", "bool"); | |
97 snprintf(buf, sizeof(buf), "%d", setting->value.bool); | |
98 xmlnode_insert_data(child, buf, -1); | |
99 } | |
100 } | |
101 | |
102 static void | |
103 ui_setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) | |
104 { | |
105 const char *ui; | |
106 GHashTable *table; | |
107 xmlnode *node, *child; | |
108 | |
109 ui = (const char *)key; | |
110 table = (GHashTable *)value; | |
111 node = (xmlnode *)user_data; | |
112 | |
113 if (g_hash_table_size(table) > 0) | |
114 { | |
115 child = xmlnode_new_child(node, "settings"); | |
116 xmlnode_set_attrib(child, "ui", ui); | |
117 g_hash_table_foreach(table, setting_to_xmlnode, child); | |
118 } | |
119 } | |
120 | |
121 static xmlnode * | |
10738 | 122 status_to_xmlnode(const GaimStatus *status) |
123 { | |
124 xmlnode *node; | |
125 | |
126 node = xmlnode_new("status"); | |
127 xmlnode_set_attrib(node, "type", gaim_status_get_id(status)); | |
128 if (gaim_status_get_name(status) != NULL) | |
129 xmlnode_set_attrib(node, "name", gaim_status_get_name(status)); | |
130 xmlnode_set_attrib(node, "active", gaim_status_is_active(status) ? "true" : "false"); | |
131 | |
132 /* QQQ: Need to save status->attr_values */ | |
133 | |
134 return node; | |
135 } | |
136 | |
137 static xmlnode * | |
138 statuses_to_xmlnode(const GaimPresence *presence) | |
139 { | |
140 xmlnode *node, *child; | |
141 const GList *statuses, *status; | |
142 | |
143 node = xmlnode_new("statuses"); | |
144 | |
145 statuses = gaim_presence_get_statuses(presence); | |
146 for (status = statuses; status != NULL; status = status->next) | |
147 { | |
148 child = status_to_xmlnode((GaimStatus *)status->data); | |
149 xmlnode_insert_child(node, child); | |
150 } | |
151 | |
152 return node; | |
153 } | |
154 | |
155 static xmlnode * | |
10427 | 156 proxy_settings_to_xmlnode(GaimProxyInfo *proxy_info) |
157 { | |
158 xmlnode *node, *child; | |
159 GaimProxyType proxy_type; | |
160 const char *value; | |
161 int int_value; | |
162 char buf[20]; | |
163 | |
164 proxy_type = gaim_proxy_info_get_type(proxy_info); | |
165 | |
166 node = xmlnode_new("proxy"); | |
167 | |
168 child = xmlnode_new_child(node, "type"); | |
169 xmlnode_insert_data(child, | |
170 (proxy_type == GAIM_PROXY_USE_GLOBAL ? "global" : | |
171 proxy_type == GAIM_PROXY_NONE ? "none" : | |
172 proxy_type == GAIM_PROXY_HTTP ? "http" : | |
173 proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" : | |
174 proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" : | |
175 proxy_type == GAIM_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); | |
176 | |
177 if (proxy_type != GAIM_PROXY_USE_GLOBAL && | |
178 proxy_type != GAIM_PROXY_NONE && | |
179 proxy_type != GAIM_PROXY_USE_ENVVAR) | |
180 { | |
181 if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL) | |
182 { | |
183 child = xmlnode_new_child(node, "host"); | |
184 xmlnode_insert_data(child, value, -1); | |
185 } | |
186 | |
187 if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0) | |
188 { | |
189 snprintf(buf, sizeof(buf), "%d", int_value); | |
190 child = xmlnode_new_child(node, "port"); | |
191 xmlnode_insert_data(child, buf, -1); | |
192 } | |
193 | |
194 if ((value = gaim_proxy_info_get_username(proxy_info)) != NULL) | |
195 { | |
196 child = xmlnode_new_child(node, "username"); | |
197 xmlnode_insert_data(child, value, -1); | |
198 } | |
199 | |
200 if ((value = gaim_proxy_info_get_password(proxy_info)) != NULL) | |
201 { | |
202 child = xmlnode_new_child(node, "password"); | |
203 xmlnode_insert_data(child, value, -1); | |
204 } | |
205 } | |
206 | |
207 return node; | |
208 } | |
209 | |
210 static xmlnode * | |
211 account_to_xmlnode(GaimAccount *account) | |
212 { | |
213 xmlnode *node, *child; | |
214 const char *tmp; | |
10738 | 215 GaimPresence *presence; |
10427 | 216 GaimProxyInfo *proxy_info; |
217 | |
218 node = xmlnode_new("account"); | |
219 | |
220 child = xmlnode_new_child(node, "protocol"); | |
221 xmlnode_insert_data(child, gaim_account_get_protocol_id(account), -1); | |
222 | |
223 child = xmlnode_new_child(node, "name"); | |
224 xmlnode_insert_data(child, gaim_account_get_username(account), -1); | |
225 | |
226 if (gaim_account_get_remember_password(account) && | |
227 ((tmp = gaim_account_get_password(account)) != NULL)) | |
228 { | |
229 child = xmlnode_new_child(node, "password"); | |
230 xmlnode_insert_data(child, tmp, -1); | |
231 } | |
232 | |
233 if ((tmp = gaim_account_get_alias(account)) != NULL) | |
234 { | |
235 child = xmlnode_new_child(node, "alias"); | |
236 xmlnode_insert_data(child, tmp, -1); | |
237 } | |
238 | |
10738 | 239 if ((presence = gaim_account_get_presence(account)) != NULL) |
240 { | |
241 child = statuses_to_xmlnode(presence); | |
242 xmlnode_insert_child(node, child); | |
243 } | |
244 | |
10427 | 245 if ((tmp = gaim_account_get_user_info(account)) != NULL) |
246 { | |
247 /* TODO: Do we need to call gaim_str_strip_cr(tmp) here? */ | |
248 child = xmlnode_new_child(node, "userinfo"); | |
249 xmlnode_insert_data(child, tmp, -1); | |
250 } | |
251 | |
252 if ((tmp = gaim_account_get_buddy_icon(account)) != NULL) | |
253 { | |
254 child = xmlnode_new_child(node, "buddyicon"); | |
255 xmlnode_insert_data(child, tmp, -1); | |
256 } | |
257 | |
258 if (g_hash_table_size(account->settings) > 0) | |
259 { | |
260 child = xmlnode_new_child(node, "settings"); | |
261 g_hash_table_foreach(account->settings, setting_to_xmlnode, child); | |
262 } | |
263 | |
264 if (g_hash_table_size(account->ui_settings) > 0) | |
265 { | |
266 g_hash_table_foreach(account->ui_settings, ui_setting_to_xmlnode, node); | |
267 } | |
268 | |
269 if ((proxy_info = gaim_account_get_proxy_info(account)) != NULL) | |
270 { | |
271 child = proxy_settings_to_xmlnode(proxy_info); | |
272 xmlnode_insert_child(node, child); | |
273 } | |
274 | |
275 return node; | |
276 } | |
277 | |
278 static xmlnode * | |
279 accounts_to_xmlnode(void) | |
280 { | |
281 xmlnode *node, *child; | |
282 GList *cur; | |
283 | |
10760 | 284 node = xmlnode_new("account"); |
10427 | 285 xmlnode_set_attrib(node, "version", "1.0"); |
286 | |
287 for (cur = gaim_accounts_get_all(); cur != NULL; cur = cur->next) | |
288 { | |
289 child = account_to_xmlnode(cur->data); | |
290 xmlnode_insert_child(node, child); | |
291 } | |
292 | |
293 return node; | |
294 } | |
295 | |
296 static void | |
297 sync_accounts(void) | |
298 { | |
299 xmlnode *node; | |
300 char *data; | |
301 | |
10428 | 302 if (!accounts_loaded) |
303 { | |
10760 | 304 gaim_debug_error("account", "Attempted to save accounts before " |
10443 | 305 "they were read!\n"); |
306 return; | |
10427 | 307 } |
308 | |
309 node = accounts_to_xmlnode(); | |
310 data = xmlnode_to_formatted_str(node, NULL); | |
311 gaim_util_write_data_to_file("accounts.xml", data, -1); | |
312 g_free(data); | |
313 xmlnode_free(node); | |
314 } | |
315 | |
316 static gboolean | |
317 save_cb(gpointer data) | |
318 { | |
319 sync_accounts(); | |
10428 | 320 save_timer = 0; |
10427 | 321 return FALSE; |
322 } | |
323 | |
324 static void | |
325 schedule_accounts_save() | |
326 { | |
10428 | 327 if (save_timer == 0) |
328 save_timer = gaim_timeout_add(5000, save_cb, NULL); | |
10427 | 329 } |
330 | |
331 | |
10428 | 332 /********************************************************************* |
333 * Reading from disk * | |
334 *********************************************************************/ | |
10427 | 335 |
336 static void | |
337 parse_settings(xmlnode *node, GaimAccount *account) | |
338 { | |
339 const char *ui; | |
340 xmlnode *child; | |
341 | |
342 /* Get the UI string, if these are UI settings */ | |
343 ui = xmlnode_get_attrib(node, "ui"); | |
344 | |
345 /* Read settings, one by one */ | |
346 for (child = xmlnode_get_child(node, "setting"); child != NULL; | |
347 child = xmlnode_get_next_twin(child)) | |
348 { | |
349 const char *name, *str_type; | |
350 GaimPrefType type; | |
351 char *data; | |
352 | |
353 name = xmlnode_get_attrib(child, "name"); | |
354 if (name == NULL) | |
355 /* Ignore this setting */ | |
356 continue; | |
357 | |
358 str_type = xmlnode_get_attrib(child, "type"); | |
10448 | 359 if (str_type == NULL) |
360 /* Ignore this setting */ | |
361 continue; | |
362 | |
10427 | 363 if (!strcmp(str_type, "string")) |
364 type = GAIM_PREF_STRING; | |
365 else if (!strcmp(str_type, "int")) | |
366 type = GAIM_PREF_INT; | |
367 else if (!strcmp(str_type, "bool")) | |
368 type = GAIM_PREF_BOOLEAN; | |
369 else | |
370 /* Ignore this setting */ | |
371 continue; | |
372 | |
373 data = xmlnode_get_data(child); | |
374 if (data == NULL) | |
375 /* Ignore this setting */ | |
376 continue; | |
377 | |
378 if (ui == NULL) | |
379 { | |
380 if (type == GAIM_PREF_STRING) | |
381 gaim_account_set_string(account, name, data); | |
382 else if (type == GAIM_PREF_INT) | |
383 gaim_account_set_int(account, name, atoi(data)); | |
384 else if (type == GAIM_PREF_BOOLEAN) | |
385 gaim_account_set_bool(account, name, | |
386 (*data == '0' ? FALSE : TRUE)); | |
387 } else { | |
388 if (type == GAIM_PREF_STRING) | |
389 gaim_account_set_ui_string(account, ui, name, data); | |
390 else if (type == GAIM_PREF_INT) | |
391 gaim_account_set_ui_int(account, ui, name, atoi(data)); | |
392 else if (type == GAIM_PREF_BOOLEAN) | |
393 gaim_account_set_ui_bool(account, ui, name, | |
394 (*data == '0' ? FALSE : TRUE)); | |
395 } | |
396 | |
397 g_free(data); | |
398 } | |
399 } | |
400 | |
401 static void | |
10738 | 402 parse_status(xmlnode *node, GaimAccount *account) |
403 { | |
404 gboolean active = FALSE; | |
405 const char *data; | |
406 const char *type; | |
407 | |
408 /* Get the active/inactive state */ | |
11075 | 409 data = xmlnode_get_attrib(node, "active"); |
410 if (data != NULL) | |
10738 | 411 { |
412 if (strcasecmp(data, "true") == 0) | |
413 active = TRUE; | |
414 else if (strcasecmp(data, "false") == 0) | |
415 active = FALSE; | |
416 else | |
417 return; | |
418 } | |
419 else | |
420 return; | |
421 | |
422 /* Get the type of the status */ | |
11075 | 423 type = xmlnode_get_attrib(node, "type"); |
424 if (type == NULL) | |
10738 | 425 return; |
426 | |
427 /* QQQ: Need to read attributes into a vargs */ | |
428 | |
429 /* QQQ: This needs to do a better job of adding attributes and stuff */ | |
430 /* Use gaim_account_set_status_vargs(); */ | |
431 gaim_account_set_status(account, type, active); | |
432 } | |
433 | |
434 static void | |
435 parse_statuses(xmlnode *node, GaimAccount *account) | |
436 { | |
437 xmlnode *child; | |
438 | |
439 for (child = xmlnode_get_child(node, "status"); child != NULL; | |
440 child = xmlnode_get_next_twin(child)) | |
441 { | |
442 parse_status(child, account); | |
443 } | |
444 } | |
445 | |
446 static void | |
10427 | 447 parse_proxy_info(xmlnode *node, GaimAccount *account) |
448 { | |
449 GaimProxyInfo *proxy_info; | |
450 xmlnode *child; | |
451 char *data; | |
452 | |
453 proxy_info = gaim_proxy_info_new(); | |
454 | |
455 /* Use the global proxy settings, by default */ | |
456 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_GLOBAL); | |
457 | |
458 /* Read proxy type */ | |
459 child = xmlnode_get_child(node, "type"); | |
460 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
461 { | |
462 if (!strcmp(data, "global")) | |
463 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_GLOBAL); | |
464 else if (!strcmp(data, "none")) | |
465 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_NONE); | |
466 else if (!strcmp(data, "http")) | |
467 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_HTTP); | |
468 else if (!strcmp(data, "socks4")) | |
469 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_SOCKS4); | |
470 else if (!strcmp(data, "socks5")) | |
471 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_SOCKS5); | |
472 else if (!strcmp(data, "envvar")) | |
473 gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_ENVVAR); | |
474 else | |
475 { | |
476 gaim_debug_error("account", "Invalid proxy type found when " | |
477 "loading account information for %s\n", | |
478 gaim_account_get_username(account)); | |
479 } | |
480 g_free(data); | |
481 } | |
482 | |
483 /* Read proxy host */ | |
484 child = xmlnode_get_child(node, "host"); | |
485 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
486 { | |
487 gaim_proxy_info_set_host(proxy_info, data); | |
488 g_free(data); | |
489 } | |
490 | |
491 /* Read proxy port */ | |
492 child = xmlnode_get_child(node, "port"); | |
493 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
494 { | |
495 gaim_proxy_info_set_port(proxy_info, atoi(data)); | |
496 g_free(data); | |
497 } | |
498 | |
499 /* Read proxy username */ | |
500 child = xmlnode_get_child(node, "username"); | |
501 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
502 { | |
503 gaim_proxy_info_set_username(proxy_info, data); | |
504 g_free(data); | |
505 } | |
506 | |
507 /* Read proxy password */ | |
508 child = xmlnode_get_child(node, "password"); | |
509 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
510 { | |
511 gaim_proxy_info_set_password(proxy_info, data); | |
512 g_free(data); | |
513 } | |
514 | |
515 /* If there are no values set then proxy_infourn NULL */ | |
516 if ((gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_GLOBAL) && | |
517 (gaim_proxy_info_get_host(proxy_info) == NULL) && | |
518 (gaim_proxy_info_get_port(proxy_info) == 0) && | |
519 (gaim_proxy_info_get_username(proxy_info) == NULL) && | |
520 (gaim_proxy_info_get_password(proxy_info) == NULL)) | |
521 { | |
522 gaim_proxy_info_destroy(proxy_info); | |
523 return; | |
524 } | |
525 | |
526 gaim_account_set_proxy_info(account, proxy_info); | |
527 } | |
528 | |
529 static GaimAccount * | |
530 parse_account(xmlnode *node) | |
531 { | |
532 GaimAccount *ret; | |
533 xmlnode *child; | |
534 char *protocol_id = NULL; | |
535 char *name = NULL; | |
536 char *data; | |
537 | |
538 child = xmlnode_get_child(node, "protocol"); | |
539 if (child != NULL) | |
540 protocol_id = xmlnode_get_data(child); | |
541 | |
542 child = xmlnode_get_child(node, "name"); | |
543 if (child != NULL) | |
544 name = xmlnode_get_data(child); | |
545 if (name == NULL) | |
546 { | |
547 /* Do we really need to do this? */ | |
548 child = xmlnode_get_child(node, "username"); | |
549 if (child != NULL) | |
550 name = xmlnode_get_data(child); | |
551 } | |
552 | |
553 if ((protocol_id == NULL) || (name == NULL)) | |
554 { | |
555 free(protocol_id); | |
556 free(name); | |
557 return NULL; | |
558 } | |
559 | |
560 ret = gaim_account_new(name, protocol_id); | |
561 free(name); | |
562 free(protocol_id); | |
563 | |
564 /* Read the password */ | |
565 child = xmlnode_get_child(node, "password"); | |
566 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
567 { | |
10743 | 568 gaim_account_set_remember_password(ret, TRUE); |
10427 | 569 gaim_account_set_password(ret, data); |
570 g_free(data); | |
571 } | |
572 | |
573 /* Read the alias */ | |
574 child = xmlnode_get_child(node, "alias"); | |
575 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
576 { | |
577 gaim_account_set_alias(ret, data); | |
578 g_free(data); | |
579 } | |
580 | |
10738 | 581 /* Read the statuses */ |
582 child = xmlnode_get_child(node, "statuses"); | |
583 if (child != NULL) | |
584 { | |
585 parse_statuses(child, ret); | |
586 } | |
587 | |
10427 | 588 /* Read the userinfo */ |
589 child = xmlnode_get_child(node, "userinfo"); | |
590 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
591 { | |
592 gaim_account_set_user_info(ret, data); | |
593 g_free(data); | |
594 } | |
595 | |
596 /* Read the buddyicon */ | |
597 child = xmlnode_get_child(node, "buddyicon"); | |
598 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) | |
599 { | |
600 gaim_account_set_buddy_icon(ret, data); | |
601 g_free(data); | |
602 } | |
603 | |
604 /* Read settings (both core and UI) */ | |
605 for (child = xmlnode_get_child(node, "settings"); child != NULL; | |
606 child = xmlnode_get_next_twin(child)) | |
607 { | |
608 parse_settings(child, ret); | |
609 } | |
610 | |
611 /* Read proxy */ | |
612 child = xmlnode_get_child(node, "proxy"); | |
613 if (child != NULL) | |
614 { | |
615 parse_proxy_info(child, ret); | |
616 } | |
617 | |
618 return ret; | |
619 } | |
620 | |
621 static void | |
622 load_accounts(void) | |
623 { | |
624 xmlnode *node, *child; | |
625 | |
626 accounts_loaded = TRUE; | |
627 | |
628 node = gaim_util_read_xml_from_file("accounts.xml", _("accounts")); | |
629 | |
630 if (node == NULL) | |
631 return; | |
632 | |
633 for (child = xmlnode_get_child(node, "account"); child != NULL; | |
634 child = xmlnode_get_next_twin(child)) | |
635 { | |
10490 | 636 GaimAccount *new_acct; |
637 new_acct = parse_account(child); | |
638 gaim_accounts_add(new_acct); | |
10427 | 639 } |
640 } | |
641 | |
642 | |
5563 | 643 static void |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
644 delete_setting(void *data) |
5563 | 645 { |
646 GaimAccountSetting *setting = (GaimAccountSetting *)data; | |
647 | |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
648 if (setting->ui != NULL) |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
649 g_free(setting->ui); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
650 |
5563 | 651 if (setting->type == GAIM_PREF_STRING) |
652 g_free(setting->value.string); | |
653 | |
654 g_free(setting); | |
655 } | |
656 | |
657 GaimAccount * | |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
658 gaim_account_new(const char *username, const char *protocol_id) |
5563 | 659 { |
6067 | 660 GaimAccount *account = NULL; |
10012 | 661 GaimPlugin *prpl = NULL; |
662 GaimPluginProtocolInfo *prpl_info = NULL; | |
5563 | 663 |
9944 | 664 g_return_val_if_fail(username != NULL, NULL); |
9971 | 665 g_return_val_if_fail(protocol_id != NULL, NULL); |
5563 | 666 |
9971 | 667 account = gaim_accounts_find(username, protocol_id); |
5867
db4df0be06fd
[gaim-migrate @ 6298]
Christian Hammond <chipx86@chipx86.com>
parents:
5865
diff
changeset
|
668 |
5874
964e4f94fc56
[gaim-migrate @ 6306]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
669 if (account != NULL) |
964e4f94fc56
[gaim-migrate @ 6306]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
670 return account; |
5867
db4df0be06fd
[gaim-migrate @ 6298]
Christian Hammond <chipx86@chipx86.com>
parents:
5865
diff
changeset
|
671 |
5563 | 672 account = g_new0(GaimAccount, 1); |
673 | |
6067 | 674 gaim_account_set_username(account, username); |
675 | |
9971 | 676 gaim_account_set_protocol_id(account, protocol_id); |
5563 | 677 |
678 account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, | |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
679 g_free, delete_setting); |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
680 account->ui_settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
681 g_free, (GDestroyNotify)g_hash_table_destroy); |
8573 | 682 account->system_log = NULL; |
10944 | 683 /* 0 is not a valid privacy setting */ |
10945 | 684 account->perm_deny = GAIM_PRIVACY_ALLOW_ALL; |
10720 | 685 |
9944 | 686 account->presence = gaim_presence_new_for_account(account); |
687 | |
10447 | 688 prpl = gaim_find_prpl(protocol_id); |
10052 | 689 |
10012 | 690 if (prpl == NULL) |
691 return account; | |
10052 | 692 |
10738 | 693 /* TODO: Should maybe use gaim_prpl_get_statuses()? */ |
10012 | 694 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); |
10738 | 695 if (prpl_info != NULL && prpl_info->status_types != NULL) |
10012 | 696 gaim_account_set_status_types(account, prpl_info->status_types(account)); |
697 | |
10052 | 698 gaim_presence_set_status_active(account->presence, "offline", TRUE); |
699 | |
11067 | 700 GAIM_DBUS_REGISTER_POINTER(account, DBUS_POINTER_ACCOUNT); |
5563 | 701 return account; |
702 } | |
703 | |
704 void | |
705 gaim_account_destroy(GaimAccount *account) | |
706 { | |
7324
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
707 GList *l; |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
708 |
5563 | 709 g_return_if_fail(account != NULL); |
710 | |
9944 | 711 gaim_debug_info("account", "Destroying account %p\n", account); |
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
712 |
10742 | 713 if (gaim_account_is_connected(account)) |
714 gaim_account_disconnect(account); | |
5563 | 715 |
9944 | 716 gaim_debug_info("account", "Continuing to destroy account %p\n", account); |
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
717 |
7324
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
718 for (l = gaim_get_conversations(); l != NULL; l = l->next) |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
719 { |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
720 GaimConversation *conv = (GaimConversation *)l->data; |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
721 |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
722 if (gaim_conversation_get_account(conv) == account) |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
723 gaim_conversation_set_account(conv, NULL); |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
724 } |
4963abdebd29
[gaim-migrate @ 7910]
Christian Hammond <chipx86@chipx86.com>
parents:
7263
diff
changeset
|
725 |
5643
eb685809108b
[gaim-migrate @ 6057]
Christian Hammond <chipx86@chipx86.com>
parents:
5620
diff
changeset
|
726 if (account->username != NULL) g_free(account->username); |
eb685809108b
[gaim-migrate @ 6057]
Christian Hammond <chipx86@chipx86.com>
parents:
5620
diff
changeset
|
727 if (account->alias != NULL) g_free(account->alias); |
eb685809108b
[gaim-migrate @ 6057]
Christian Hammond <chipx86@chipx86.com>
parents:
5620
diff
changeset
|
728 if (account->password != NULL) g_free(account->password); |
eb685809108b
[gaim-migrate @ 6057]
Christian Hammond <chipx86@chipx86.com>
parents:
5620
diff
changeset
|
729 if (account->user_info != NULL) g_free(account->user_info); |
eb685809108b
[gaim-migrate @ 6057]
Christian Hammond <chipx86@chipx86.com>
parents:
5620
diff
changeset
|
730 if (account->protocol_id != NULL) g_free(account->protocol_id); |
5563 | 731 |
732 g_hash_table_destroy(account->settings); | |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
733 g_hash_table_destroy(account->ui_settings); |
5563 | 734 |
9944 | 735 gaim_account_set_status_types(account, NULL); |
736 | |
737 gaim_presence_destroy(account->presence); | |
738 | |
8573 | 739 if(account->system_log) |
740 gaim_log_free(account->system_log); | |
741 | |
11067 | 742 GAIM_DBUS_UNREGISTER_POINTER(account); |
5563 | 743 g_free(account); |
744 } | |
745 | |
10740 | 746 void |
6581 | 747 gaim_account_register(GaimAccount *account) |
748 { | |
10740 | 749 g_return_if_fail(account != NULL); |
6581 | 750 |
10740 | 751 gaim_debug_info("account", "Registering account %s\n", |
752 gaim_account_get_username(account)); | |
6581 | 753 |
10740 | 754 gaim_connection_new(account, TRUE, NULL); |
755 } | |
6581 | 756 |
10740 | 757 static void |
11042
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
758 request_password_ok_cb(GaimAccount *account, GaimRequestFields *fields) |
10740 | 759 { |
11042
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
760 const char *entry; |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
761 gboolean remember; |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
762 |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
763 entry = gaim_request_fields_get_string(fields, "password"); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
764 remember = gaim_request_fields_get_bool(fields, "remember"); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
765 |
10740 | 766 if (!entry || !*entry) |
767 { | |
768 gaim_notify_error(account, NULL, _("Password is required to sign on."), NULL); | |
769 return; | |
770 } | |
6581 | 771 |
11042
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
772 if(remember) |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
773 gaim_account_set_remember_password(account, TRUE); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
774 |
10740 | 775 if (gaim_account_get_remember_password(account)) |
776 gaim_account_set_password(account, entry); | |
6581 | 777 |
10740 | 778 gaim_connection_new(account, FALSE, entry); |
6581 | 779 } |
780 | |
10740 | 781 static void |
782 request_password(GaimAccount *account) | |
783 { | |
784 gchar *primary; | |
785 const gchar *username; | |
11042
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
786 GaimRequestFieldGroup *group; |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
787 GaimRequestField *field; |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
788 GaimRequestFields *fields; |
10740 | 789 |
10758 | 790 /* Close any previous password request windows */ |
791 gaim_request_close_with_handle(account); | |
792 | |
10740 | 793 username = gaim_account_get_username(account); |
10774 | 794 primary = g_strdup_printf(_("Enter password for %s (%s)"), username, |
10740 | 795 gaim_account_get_protocol_name(account)); |
11042
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
796 |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
797 fields = gaim_request_fields_new(); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
798 group = gaim_request_field_group_new(NULL); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
799 gaim_request_fields_add_group(fields, group); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
800 |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
801 field = gaim_request_field_string_new("password", _("Enter Password"), NULL, FALSE); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
802 gaim_request_field_string_set_masked(field, TRUE); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
803 gaim_request_field_set_required(field, TRUE); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
804 gaim_request_field_group_add_field(group, field); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
805 |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
806 field = gaim_request_field_bool_new("remember", _("Save password"), FALSE); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
807 gaim_request_field_group_add_field(group, field); |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
808 |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
809 gaim_request_fields(account, |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
810 NULL, |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
811 primary, |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
812 NULL, |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
813 fields, |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
814 _("OK"), G_CALLBACK(request_password_ok_cb), |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
815 _("Cancel"), NULL, |
a5c31b83063f
[gaim-migrate @ 12954]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
816 account); |
10740 | 817 g_free(primary); |
818 } | |
819 | |
820 void | |
10738 | 821 gaim_account_connect(GaimAccount *account) |
5563 | 822 { |
10740 | 823 GaimPlugin *prpl; |
824 GaimPluginProtocolInfo *prpl_info; | |
825 const char *password; | |
826 | |
827 g_return_if_fail(account != NULL); | |
5563 | 828 |
10740 | 829 gaim_debug_info("account", "Connecting to account %s\n", |
830 gaim_account_get_username(account)); | |
5563 | 831 |
10740 | 832 prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); |
833 if (prpl == NULL) | |
834 { | |
835 gchar *message; | |
6036 | 836 |
10740 | 837 message = g_strdup_printf(_("Missing protocol plugin for %s"), |
838 gaim_account_get_username(account)); | |
10758 | 839 gaim_notify_error(account, _("Connection Error"), message, NULL); |
10740 | 840 g_free(message); |
841 return; | |
842 } | |
5563 | 843 |
10740 | 844 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); |
845 password = gaim_account_get_password(account); | |
846 if ((password == NULL) && | |
847 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && | |
848 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) | |
849 request_password(account); | |
850 else | |
851 gaim_connection_new(account, FALSE, password); | |
5563 | 852 } |
853 | |
854 void | |
855 gaim_account_disconnect(GaimAccount *account) | |
856 { | |
5926
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5879
diff
changeset
|
857 GaimConnection *gc; |
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5879
diff
changeset
|
858 |
5563 | 859 g_return_if_fail(account != NULL); |
860 g_return_if_fail(gaim_account_is_connected(account)); | |
861 | |
9944 | 862 gaim_debug_info("account", "Disconnecting account %p\n", account); |
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
863 |
10384 | 864 account->disconnecting = TRUE; |
5563 | 865 |
10742 | 866 gc = gaim_account_get_connection(account); |
867 gaim_connection_destroy(gc); | |
868 gaim_account_set_connection(account, NULL); | |
10384 | 869 |
870 account->disconnecting = FALSE; | |
5563 | 871 } |
872 | |
873 void | |
7166 | 874 gaim_account_notify_added(GaimAccount *account, const char *id, |
875 const char *remote_user, const char *alias, | |
7015
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
876 const char *message) |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
877 { |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
878 GaimAccountUiOps *ui_ops; |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
879 |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
880 g_return_if_fail(account != NULL); |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
881 g_return_if_fail(remote_user != NULL); |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
882 |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
883 ui_ops = gaim_accounts_get_ui_ops(); |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
884 |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
885 if (ui_ops != NULL && ui_ops->notify_added != NULL) |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
886 ui_ops->notify_added(account, remote_user, id, alias, message); |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
887 } |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
888 |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
889 static void |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
890 change_password_cb(GaimAccount *account, GaimRequestFields *fields) |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
891 { |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
892 const char *orig_pass, *new_pass_1, *new_pass_2; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
893 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
894 orig_pass = gaim_request_fields_get_string(fields, "password"); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
895 new_pass_1 = gaim_request_fields_get_string(fields, "new_password_1"); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
896 new_pass_2 = gaim_request_fields_get_string(fields, "new_password_2"); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
897 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
898 if (g_utf8_collate(new_pass_1, new_pass_2)) |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
899 { |
10758 | 900 gaim_notify_error(account, NULL, |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
901 _("New passwords do not match."), NULL); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
902 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
903 return; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
904 } |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
905 |
8638 | 906 if (orig_pass == NULL || new_pass_1 == NULL || new_pass_2 == NULL || |
907 *orig_pass == '\0' || *new_pass_1 == '\0' || *new_pass_2 == '\0') | |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
908 { |
10758 | 909 gaim_notify_error(account, NULL, |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
910 _("Fill out all fields completely."), NULL); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
911 return; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
912 } |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
913 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
914 serv_change_passwd(gaim_account_get_connection(account), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
915 orig_pass, new_pass_1); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
916 gaim_account_set_password(account, new_pass_1); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
917 } |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
918 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
919 void |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
920 gaim_account_request_change_password(GaimAccount *account) |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
921 { |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
922 GaimRequestFields *fields; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
923 GaimRequestFieldGroup *group; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
924 GaimRequestField *field; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
925 char primary[256]; |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
926 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
927 g_return_if_fail(account != NULL); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
928 g_return_if_fail(gaim_account_is_connected(account)); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
929 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
930 fields = gaim_request_fields_new(); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
931 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
932 group = gaim_request_field_group_new(NULL); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
933 gaim_request_fields_add_group(fields, group); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
934 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
935 field = gaim_request_field_string_new("password", _("Original password"), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
936 NULL, FALSE); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
937 gaim_request_field_string_set_masked(field, TRUE); |
8638 | 938 gaim_request_field_set_required(field, TRUE); |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
939 gaim_request_field_group_add_field(group, field); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
940 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
941 field = gaim_request_field_string_new("new_password_1", |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
942 _("New password"), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
943 NULL, FALSE); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
944 gaim_request_field_string_set_masked(field, TRUE); |
8638 | 945 gaim_request_field_set_required(field, TRUE); |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
946 gaim_request_field_group_add_field(group, field); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
947 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
948 field = gaim_request_field_string_new("new_password_2", |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
949 _("New password (again)"), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
950 NULL, FALSE); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
951 gaim_request_field_string_set_masked(field, TRUE); |
8638 | 952 gaim_request_field_set_required(field, TRUE); |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
953 gaim_request_field_group_add_field(group, field); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
954 |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
955 g_snprintf(primary, sizeof(primary), _("Change password for %s"), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
956 gaim_account_get_username(account)); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
957 |
7755 | 958 /* I'm sticking this somewhere in the code: bologna */ |
959 | |
7063
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
960 gaim_request_fields(gaim_account_get_connection(account), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
961 NULL, |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
962 primary, |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
963 _("Please enter your current password and your " |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
964 "new password."), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
965 fields, |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
966 _("OK"), G_CALLBACK(change_password_cb), |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
967 _("Cancel"), NULL, |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
968 account); |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
969 } |
7fdac700deb1
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
970 |
7067
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
971 static void |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
972 set_user_info_cb(GaimAccount *account, const char *user_info) |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
973 { |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
974 GaimConnection *gc; |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
975 |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
976 gaim_account_set_user_info(account, user_info); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
977 |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
978 gc = gaim_account_get_connection(account); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
979 |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
980 if (gc != NULL) |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
981 serv_set_info(gaim_account_get_connection(account), user_info); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
982 } |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
983 |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
984 void |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
985 gaim_account_request_change_user_info(GaimAccount *account) |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
986 { |
8697 | 987 GaimConnection *gc; |
7067
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
988 char primary[256]; |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
989 |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
990 g_return_if_fail(account != NULL); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
991 g_return_if_fail(gaim_account_is_connected(account)); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
992 |
8697 | 993 gc = gaim_account_get_connection(account); |
994 | |
7067
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
995 g_snprintf(primary, sizeof(primary), |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
996 _("Change user information for %s"), |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
997 gaim_account_get_username(account)); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
998 |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
999 gaim_request_input(gaim_account_get_connection(account), |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
1000 NULL, primary, NULL, |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
1001 gaim_account_get_user_info(account), |
8697 | 1002 TRUE, FALSE, ((gc != NULL) && |
1003 (gc->flags & GAIM_CONNECTION_HTML) ? "html" : NULL), | |
7067
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
1004 _("Save"), G_CALLBACK(set_user_info_cb), |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
1005 _("Cancel"), NULL, account); |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
1006 } |
71e0da45abe6
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
1007 |
7015
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1008 void |
5563 | 1009 gaim_account_set_username(GaimAccount *account, const char *username) |
1010 { | |
5711
e33778b9d395
[gaim-migrate @ 6132]
Christian Hammond <chipx86@chipx86.com>
parents:
5710
diff
changeset
|
1011 g_return_if_fail(account != NULL); |
5563 | 1012 |
10740 | 1013 g_free(account->username); |
5563 | 1014 account->username = (username == NULL ? NULL : g_strdup(username)); |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1015 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1016 schedule_accounts_save(); |
5563 | 1017 } |
1018 | |
1019 void | |
1020 gaim_account_set_password(GaimAccount *account, const char *password) | |
1021 { | |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1022 g_return_if_fail(account != NULL); |
5563 | 1023 |
10740 | 1024 g_free(account->password); |
1025 account->password = NULL; | |
1026 | |
1027 if (!gaim_account_get_remember_password(account)) | |
1028 return; | |
5563 | 1029 |
1030 account->password = (password == NULL ? NULL : g_strdup(password)); | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1031 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1032 schedule_accounts_save(); |
5563 | 1033 } |
1034 | |
1035 void | |
1036 gaim_account_set_alias(GaimAccount *account, const char *alias) | |
1037 { | |
1038 g_return_if_fail(account != NULL); | |
1039 | |
10740 | 1040 g_free(account->alias); |
5563 | 1041 account->alias = (alias == NULL ? NULL : g_strdup(alias)); |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1042 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1043 schedule_accounts_save(); |
5563 | 1044 } |
1045 | |
1046 void | |
1047 gaim_account_set_user_info(GaimAccount *account, const char *user_info) | |
1048 { | |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1049 g_return_if_fail(account != NULL); |
5563 | 1050 |
10740 | 1051 g_free(account->user_info); |
5563 | 1052 account->user_info = (user_info == NULL ? NULL : g_strdup(user_info)); |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1053 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1054 schedule_accounts_save(); |
5563 | 1055 } |
1056 | |
1057 void | |
1058 gaim_account_set_buddy_icon(GaimAccount *account, const char *icon) | |
1059 { | |
1060 g_return_if_fail(account != NULL); | |
1061 | |
10740 | 1062 g_free(account->buddy_icon); |
5563 | 1063 account->buddy_icon = (icon == NULL ? NULL : g_strdup(icon)); |
10740 | 1064 if (gaim_account_is_connected(account)) |
10742 | 1065 serv_set_buddyicon(gaim_account_get_connection(account), icon); |
10418 | 1066 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1067 schedule_accounts_save(); |
5563 | 1068 } |
1069 | |
1070 void | |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1071 gaim_account_set_protocol_id(GaimAccount *account, const char *protocol_id) |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1072 { |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1073 g_return_if_fail(account != NULL); |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1074 g_return_if_fail(protocol_id != NULL); |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1075 |
10740 | 1076 g_free(account->protocol_id); |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1077 account->protocol_id = g_strdup(protocol_id); |
5665
132a30783c3d
[gaim-migrate @ 6081]
Christian Hammond <chipx86@chipx86.com>
parents:
5659
diff
changeset
|
1078 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1079 schedule_accounts_save(); |
5563 | 1080 } |
1081 | |
1082 void | |
1083 gaim_account_set_connection(GaimAccount *account, GaimConnection *gc) | |
1084 { | |
1085 g_return_if_fail(account != NULL); | |
1086 | |
1087 account->gc = gc; | |
1088 } | |
1089 | |
1090 void | |
1091 gaim_account_set_remember_password(GaimAccount *account, gboolean value) | |
1092 { | |
1093 g_return_if_fail(account != NULL); | |
1094 | |
1095 account->remember_pass = value; | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1096 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1097 schedule_accounts_save(); |
5563 | 1098 } |
1099 | |
1100 void | |
5659
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1101 gaim_account_set_check_mail(GaimAccount *account, gboolean value) |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1102 { |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1103 g_return_if_fail(account != NULL); |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1104 |
5977
2d34c02d2031
[gaim-migrate @ 6424]
Christian Hammond <chipx86@chipx86.com>
parents:
5953
diff
changeset
|
1105 gaim_account_set_bool(account, "check-mail", value); |
5659
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1106 } |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1107 |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
1108 void |
10400 | 1109 gaim_account_set_enabled(GaimAccount *account, const char *ui, |
1110 gboolean value) | |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1111 { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1112 g_return_if_fail(account != NULL); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1113 g_return_if_fail(ui != NULL); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1114 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1115 gaim_account_set_ui_bool(account, ui, "auto-login", value); |
10862 | 1116 if (gaim_presence_is_online(account->presence)) |
1117 gaim_account_connect(account); | |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1118 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1119 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1120 void |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1121 gaim_account_set_proxy_info(GaimAccount *account, GaimProxyInfo *info) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1122 { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1123 g_return_if_fail(account != NULL); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1124 |
5695
e42535701e25
[gaim-migrate @ 6116]
Christian Hammond <chipx86@chipx86.com>
parents:
5694
diff
changeset
|
1125 if (account->proxy_info != NULL) |
e42535701e25
[gaim-migrate @ 6116]
Christian Hammond <chipx86@chipx86.com>
parents:
5694
diff
changeset
|
1126 gaim_proxy_info_destroy(account->proxy_info); |
e42535701e25
[gaim-migrate @ 6116]
Christian Hammond <chipx86@chipx86.com>
parents:
5694
diff
changeset
|
1127 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1128 account->proxy_info = info; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1129 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1130 schedule_accounts_save(); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1131 } |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1132 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1133 void |
9944 | 1134 gaim_account_set_status_types(GaimAccount *account, GList *status_types) |
1135 { | |
1136 g_return_if_fail(account != NULL); | |
1137 | |
10005 | 1138 /* Old with the old... */ |
9944 | 1139 if (account->status_types != NULL) |
1140 { | |
1141 GList *l; | |
1142 | |
1143 for (l = account->status_types; l != NULL; l = l->next) | |
1144 gaim_status_type_destroy((GaimStatusType *)l->data); | |
1145 | |
1146 g_list_free(account->status_types); | |
1147 } | |
1148 | |
10005 | 1149 /* In with the new... */ |
9944 | 1150 account->status_types = status_types; |
1151 } | |
1152 | |
1153 void | |
1154 gaim_account_set_status(GaimAccount *account, const char *status_id, | |
1155 gboolean active, ...) | |
1156 { | |
10738 | 1157 va_list args; |
1158 | |
1159 va_start(args, active); | |
1160 gaim_account_set_status_vargs(account, status_id, active, args); | |
1161 va_end(args); | |
1162 } | |
1163 | |
1164 void | |
1165 gaim_account_set_status_vargs(GaimAccount *account, const char *status_id, | |
1166 gboolean active, va_list args) | |
1167 { | |
9944 | 1168 GaimStatus *status; |
1169 | |
1170 g_return_if_fail(account != NULL); | |
1171 g_return_if_fail(status_id != NULL); | |
1172 | |
10760 | 1173 gaim_debug_info("account", "Changing status for %s, setting %s to %d\n", |
1174 gaim_account_get_username(account), status_id, active); | |
1175 | |
9944 | 1176 status = gaim_account_get_status(account, status_id); |
1177 if (status == NULL) | |
1178 { | |
10760 | 1179 gaim_debug_error("account", |
9944 | 1180 "Invalid status ID %s for account %s (%s)\n", |
1181 status_id, gaim_account_get_username(account), | |
1182 gaim_account_get_protocol_id(account)); | |
1183 return; | |
1184 } | |
10720 | 1185 |
10754 | 1186 if (active || gaim_status_is_independent(status)) |
1187 gaim_status_set_active_with_attrs(status, active, args); | |
10862 | 1188 |
1189 /* | |
1190 * Our current statuses are saved to accounts.xml (so that when we | |
1191 * reconnect, we go back to the previous status). | |
1192 */ | |
1193 schedule_accounts_save(); | |
9944 | 1194 } |
1195 | |
1196 void | |
5694
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1197 gaim_account_clear_settings(GaimAccount *account) |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1198 { |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1199 g_return_if_fail(account != NULL); |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1200 |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1201 g_hash_table_destroy(account->settings); |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1202 |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1203 account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1204 g_free, delete_setting); |
5694
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1205 } |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1206 |
2d0d96c5a7a7
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1207 void |
5563 | 1208 gaim_account_set_int(GaimAccount *account, const char *name, int value) |
1209 { | |
1210 GaimAccountSetting *setting; | |
1211 | |
1212 g_return_if_fail(account != NULL); | |
1213 g_return_if_fail(name != NULL); | |
1214 | |
1215 setting = g_new0(GaimAccountSetting, 1); | |
1216 | |
1217 setting->type = GAIM_PREF_INT; | |
1218 setting->value.integer = value; | |
1219 | |
1220 g_hash_table_insert(account->settings, g_strdup(name), setting); | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1221 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1222 schedule_accounts_save(); |
5563 | 1223 } |
1224 | |
1225 void | |
1226 gaim_account_set_string(GaimAccount *account, const char *name, | |
1227 const char *value) | |
1228 { | |
1229 GaimAccountSetting *setting; | |
1230 | |
1231 g_return_if_fail(account != NULL); | |
1232 g_return_if_fail(name != NULL); | |
1233 | |
1234 setting = g_new0(GaimAccountSetting, 1); | |
1235 | |
1236 setting->type = GAIM_PREF_STRING; | |
1237 setting->value.string = g_strdup(value); | |
1238 | |
1239 g_hash_table_insert(account->settings, g_strdup(name), setting); | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1240 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1241 schedule_accounts_save(); |
5563 | 1242 } |
1243 | |
1244 void | |
1245 gaim_account_set_bool(GaimAccount *account, const char *name, gboolean value) | |
1246 { | |
1247 GaimAccountSetting *setting; | |
1248 | |
1249 g_return_if_fail(account != NULL); | |
1250 g_return_if_fail(name != NULL); | |
1251 | |
1252 setting = g_new0(GaimAccountSetting, 1); | |
1253 | |
1254 setting->type = GAIM_PREF_BOOLEAN; | |
1255 setting->value.bool = value; | |
1256 | |
1257 g_hash_table_insert(account->settings, g_strdup(name), setting); | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1258 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1259 schedule_accounts_save(); |
5563 | 1260 } |
1261 | |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1262 static GHashTable * |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1263 get_ui_settings_table(GaimAccount *account, const char *ui) |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1264 { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1265 GHashTable *table; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1266 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1267 table = g_hash_table_lookup(account->ui_settings, ui); |
5979
49ae70ffcea5
[gaim-migrate @ 6426]
Christian Hammond <chipx86@chipx86.com>
parents:
5977
diff
changeset
|
1268 |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1269 if (table == NULL) { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1270 table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1271 delete_setting); |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1272 g_hash_table_insert(account->ui_settings, g_strdup(ui), table); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1273 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1274 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1275 return table; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1276 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1277 |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1278 void |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1279 gaim_account_set_ui_int(GaimAccount *account, const char *ui, |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1280 const char *name, int value) |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1281 { |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1282 GaimAccountSetting *setting; |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1283 GHashTable *table; |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1284 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1285 g_return_if_fail(account != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1286 g_return_if_fail(ui != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1287 g_return_if_fail(name != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1288 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1289 setting = g_new0(GaimAccountSetting, 1); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1290 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1291 setting->type = GAIM_PREF_INT; |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1292 setting->ui = g_strdup(ui); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1293 setting->value.integer = value; |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1294 |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1295 table = get_ui_settings_table(account, ui); |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1296 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1297 g_hash_table_insert(table, g_strdup(name), setting); |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1298 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1299 schedule_accounts_save(); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1300 } |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1301 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1302 void |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1303 gaim_account_set_ui_string(GaimAccount *account, const char *ui, |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1304 const char *name, const char *value) |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1305 { |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1306 GaimAccountSetting *setting; |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1307 GHashTable *table; |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1308 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1309 g_return_if_fail(account != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1310 g_return_if_fail(ui != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1311 g_return_if_fail(name != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1312 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1313 setting = g_new0(GaimAccountSetting, 1); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1314 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1315 setting->type = GAIM_PREF_STRING; |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1316 setting->ui = g_strdup(ui); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1317 setting->value.string = g_strdup(value); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1318 |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1319 table = get_ui_settings_table(account, ui); |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1320 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1321 g_hash_table_insert(table, g_strdup(name), setting); |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1322 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1323 schedule_accounts_save(); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1324 } |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1325 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1326 void |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1327 gaim_account_set_ui_bool(GaimAccount *account, const char *ui, |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1328 const char *name, gboolean value) |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1329 { |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1330 GaimAccountSetting *setting; |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1331 GHashTable *table; |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1332 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1333 g_return_if_fail(account != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1334 g_return_if_fail(ui != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1335 g_return_if_fail(name != NULL); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1336 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1337 setting = g_new0(GaimAccountSetting, 1); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1338 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1339 setting->type = GAIM_PREF_BOOLEAN; |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1340 setting->ui = g_strdup(ui); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1341 setting->value.bool = value; |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1342 |
5794
5e93fc46d1af
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1343 table = get_ui_settings_table(account, ui); |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1344 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1345 g_hash_table_insert(table, g_strdup(name), setting); |
5777
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1346 |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1347 schedule_accounts_save(); |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1348 } |
1f786fb43ee6
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1349 |
5563 | 1350 gboolean |
1351 gaim_account_is_connected(const GaimAccount *account) | |
1352 { | |
9019 | 1353 GaimConnection *gc; |
1354 | |
5563 | 1355 g_return_val_if_fail(account != NULL, FALSE); |
1356 | |
9019 | 1357 gc = gaim_account_get_connection(account); |
1358 | |
10428 | 1359 /* TODO: The first way is better... but it doesn't work quite right yet */ |
9021 | 1360 /* return ((gc != NULL) && GAIM_CONNECTION_IS_CONNECTED(gc)); */ |
1361 return ((gc != NULL) && gaim_connection_get_state(gc) != GAIM_DISCONNECTED); | |
5563 | 1362 } |
1363 | |
1364 const char * | |
1365 gaim_account_get_username(const GaimAccount *account) | |
1366 { | |
1367 g_return_val_if_fail(account != NULL, NULL); | |
1368 | |
1369 return account->username; | |
1370 } | |
1371 | |
1372 const char * | |
1373 gaim_account_get_password(const GaimAccount *account) | |
1374 { | |
1375 g_return_val_if_fail(account != NULL, NULL); | |
1376 | |
1377 return account->password; | |
1378 } | |
1379 | |
1380 const char * | |
1381 gaim_account_get_alias(const GaimAccount *account) | |
1382 { | |
1383 g_return_val_if_fail(account != NULL, NULL); | |
1384 | |
1385 return account->alias; | |
1386 } | |
1387 | |
1388 const char * | |
1389 gaim_account_get_user_info(const GaimAccount *account) | |
1390 { | |
1391 g_return_val_if_fail(account != NULL, NULL); | |
1392 | |
1393 return account->user_info; | |
1394 } | |
1395 | |
1396 const char * | |
1397 gaim_account_get_buddy_icon(const GaimAccount *account) | |
1398 { | |
1399 g_return_val_if_fail(account != NULL, NULL); | |
1400 | |
1401 return account->buddy_icon; | |
1402 } | |
1403 | |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1404 const char * |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1405 gaim_account_get_protocol_id(const GaimAccount *account) |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1406 { |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1407 g_return_val_if_fail(account != NULL, NULL); |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1408 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1409 return account->protocol_id; |
5563 | 1410 } |
1411 | |
9699 | 1412 const char * |
1413 gaim_account_get_protocol_name(const GaimAccount *account) | |
1414 { | |
9720 | 1415 GaimPlugin *p; |
1416 | |
9699 | 1417 g_return_val_if_fail(account != NULL, NULL); |
1418 | |
9989 | 1419 p = gaim_find_prpl(gaim_account_get_protocol_id(account)); |
9988 | 1420 |
1421 return ((p && p->info->name) ? _(p->info->name) : _("Unknown")); | |
1422 } | |
1423 | |
5563 | 1424 GaimConnection * |
1425 gaim_account_get_connection(const GaimAccount *account) | |
1426 { | |
1427 g_return_val_if_fail(account != NULL, NULL); | |
1428 | |
1429 return account->gc; | |
1430 } | |
1431 | |
1432 gboolean | |
1433 gaim_account_get_remember_password(const GaimAccount *account) | |
1434 { | |
1435 g_return_val_if_fail(account != NULL, FALSE); | |
1436 | |
1437 return account->remember_pass; | |
1438 } | |
1439 | |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1440 gboolean |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1441 gaim_account_get_check_mail(const GaimAccount *account) |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1442 { |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1443 g_return_val_if_fail(account != NULL, FALSE); |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1444 |
5977
2d34c02d2031
[gaim-migrate @ 6424]
Christian Hammond <chipx86@chipx86.com>
parents:
5953
diff
changeset
|
1445 return gaim_account_get_bool(account, "check-mail", FALSE); |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1446 } |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1447 |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1448 gboolean |
10400 | 1449 gaim_account_get_enabled(const GaimAccount *account, const char *ui) |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1450 { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1451 g_return_val_if_fail(account != NULL, FALSE); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1452 g_return_val_if_fail(ui != NULL, FALSE); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1453 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1454 return gaim_account_get_ui_bool(account, ui, "auto-login", FALSE); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1455 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1456 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1457 GaimProxyInfo * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1458 gaim_account_get_proxy_info(const GaimAccount *account) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1459 { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1460 g_return_val_if_fail(account != NULL, NULL); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1461 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1462 return account->proxy_info; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1463 } |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1464 |
9944 | 1465 GaimStatus * |
10738 | 1466 gaim_account_get_active_status(const GaimAccount *account) |
1467 { | |
1468 g_return_val_if_fail(account != NULL, NULL); | |
1469 | |
1470 return gaim_presence_get_active_status(account->presence); | |
1471 } | |
1472 | |
1473 GaimStatus * | |
9944 | 1474 gaim_account_get_status(const GaimAccount *account, const char *status_id) |
1475 { | |
1476 g_return_val_if_fail(account != NULL, NULL); | |
1477 g_return_val_if_fail(status_id != NULL, NULL); | |
1478 | |
1479 return gaim_presence_get_status(account->presence, status_id); | |
1480 } | |
1481 | |
1482 GaimStatusType * | |
1483 gaim_account_get_status_type(const GaimAccount *account, const char *id) | |
1484 { | |
1485 const GList *l; | |
1486 | |
1487 g_return_val_if_fail(account != NULL, NULL); | |
1488 g_return_val_if_fail(id != NULL, NULL); | |
1489 | |
1490 for (l = gaim_account_get_status_types(account); l != NULL; l = l->next) | |
1491 { | |
1492 GaimStatusType *status_type = (GaimStatusType *)l->data; | |
1493 | |
1494 if (!strcmp(gaim_status_type_get_id(status_type), id)) | |
1495 return status_type; | |
1496 } | |
1497 | |
1498 return NULL; | |
1499 } | |
1500 | |
1501 GaimPresence * | |
1502 gaim_account_get_presence(const GaimAccount *account) | |
1503 { | |
1504 g_return_val_if_fail(account != NULL, NULL); | |
1505 | |
1506 return account->presence; | |
1507 } | |
1508 | |
1509 gboolean | |
1510 gaim_account_is_status_active(const GaimAccount *account, | |
1511 const char *status_id) | |
1512 { | |
1513 g_return_val_if_fail(account != NULL, FALSE); | |
1514 g_return_val_if_fail(status_id != NULL, FALSE); | |
1515 | |
1516 return gaim_presence_is_status_active(account->presence, status_id); | |
1517 } | |
1518 | |
1519 const GList * | |
1520 gaim_account_get_status_types(const GaimAccount *account) | |
1521 { | |
1522 g_return_val_if_fail(account != NULL, NULL); | |
1523 | |
1524 return account->status_types; | |
1525 } | |
1526 | |
5563 | 1527 int |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1528 gaim_account_get_int(const GaimAccount *account, const char *name, |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1529 int default_value) |
5563 | 1530 { |
1531 GaimAccountSetting *setting; | |
1532 | |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1533 g_return_val_if_fail(account != NULL, default_value); |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1534 g_return_val_if_fail(name != NULL, default_value); |
5563 | 1535 |
1536 setting = g_hash_table_lookup(account->settings, name); | |
1537 | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1538 if (setting == NULL) |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1539 return default_value; |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1540 |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1541 g_return_val_if_fail(setting->type == GAIM_PREF_INT, default_value); |
5563 | 1542 |
1543 return setting->value.integer; | |
1544 } | |
1545 | |
1546 const char * | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1547 gaim_account_get_string(const GaimAccount *account, const char *name, |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1548 const char *default_value) |
5563 | 1549 { |
1550 GaimAccountSetting *setting; | |
1551 | |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1552 g_return_val_if_fail(account != NULL, default_value); |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1553 g_return_val_if_fail(name != NULL, default_value); |
5563 | 1554 |
1555 setting = g_hash_table_lookup(account->settings, name); | |
1556 | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1557 if (setting == NULL) |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1558 return default_value; |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1559 |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1560 g_return_val_if_fail(setting->type == GAIM_PREF_STRING, default_value); |
5563 | 1561 |
1562 return setting->value.string; | |
1563 } | |
1564 | |
1565 gboolean | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1566 gaim_account_get_bool(const GaimAccount *account, const char *name, |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1567 gboolean default_value) |
5563 | 1568 { |
1569 GaimAccountSetting *setting; | |
1570 | |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1571 g_return_val_if_fail(account != NULL, default_value); |
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1572 g_return_val_if_fail(name != NULL, default_value); |
5563 | 1573 |
1574 setting = g_hash_table_lookup(account->settings, name); | |
1575 | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1576 if (setting == NULL) |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1577 return default_value; |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1578 |
5565
c3c4aaf69f65
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1579 g_return_val_if_fail(setting->type == GAIM_PREF_BOOLEAN, default_value); |
5563 | 1580 |
1581 return setting->value.bool; | |
1582 } | |
1583 | |
5779
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1584 int |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1585 gaim_account_get_ui_int(const GaimAccount *account, const char *ui, |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1586 const char *name, int default_value) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1587 { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1588 GaimAccountSetting *setting; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1589 GHashTable *table; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1590 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1591 g_return_val_if_fail(account != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1592 g_return_val_if_fail(ui != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1593 g_return_val_if_fail(name != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1594 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1595 if ((table = g_hash_table_lookup(account->ui_settings, ui)) == NULL) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1596 return default_value; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1597 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1598 if ((setting = g_hash_table_lookup(table, name)) == NULL) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1599 return default_value; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1600 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1601 g_return_val_if_fail(setting->type == GAIM_PREF_INT, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1602 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1603 return setting->value.integer; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1604 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1605 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1606 const char * |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1607 gaim_account_get_ui_string(const GaimAccount *account, const char *ui, |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1608 const char *name, const char *default_value) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1609 { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1610 GaimAccountSetting *setting; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1611 GHashTable *table; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1612 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1613 g_return_val_if_fail(account != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1614 g_return_val_if_fail(ui != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1615 g_return_val_if_fail(name != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1616 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1617 if ((table = g_hash_table_lookup(account->ui_settings, ui)) == NULL) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1618 return default_value; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1619 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1620 if ((setting = g_hash_table_lookup(table, name)) == NULL) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1621 return default_value; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1622 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1623 g_return_val_if_fail(setting->type == GAIM_PREF_STRING, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1624 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1625 return setting->value.string; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1626 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1627 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1628 gboolean |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1629 gaim_account_get_ui_bool(const GaimAccount *account, const char *ui, |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1630 const char *name, gboolean default_value) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1631 { |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1632 GaimAccountSetting *setting; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1633 GHashTable *table; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1634 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1635 g_return_val_if_fail(account != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1636 g_return_val_if_fail(ui != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1637 g_return_val_if_fail(name != NULL, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1638 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1639 if ((table = g_hash_table_lookup(account->ui_settings, ui)) == NULL) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1640 return default_value; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1641 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1642 if ((setting = g_hash_table_lookup(table, name)) == NULL) |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1643 return default_value; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1644 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1645 g_return_val_if_fail(setting->type == GAIM_PREF_BOOLEAN, default_value); |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1646 |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1647 return setting->value.bool; |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1648 } |
758fa27534b3
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1649 |
8573 | 1650 GaimLog * |
1651 gaim_account_get_log(GaimAccount *account) | |
1652 { | |
1653 g_return_val_if_fail(account != NULL, NULL); | |
1654 | |
1655 if(!account->system_log){ | |
8658 | 1656 GaimConnection *gc; |
1657 | |
1658 gc = gaim_account_get_connection(account); | |
1659 | |
8635 | 1660 account->system_log = gaim_log_new(GAIM_LOG_SYSTEM, |
1661 gaim_account_get_username(account), account, | |
11014 | 1662 (gc != NULL && gc->login_time != 0) ? gc->login_time : time(NULL)); |
8573 | 1663 } |
1664 | |
1665 return account->system_log; | |
1666 } | |
1667 | |
1668 void | |
1669 gaim_account_destroy_log(GaimAccount *account) | |
1670 { | |
1671 g_return_if_fail(account != NULL); | |
1672 | |
1673 if(account->system_log){ | |
1674 gaim_log_free(account->system_log); | |
1675 account->system_log = NULL; | |
1676 } | |
1677 } | |
1678 | |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1679 void |
5710
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1680 gaim_accounts_add(GaimAccount *account) |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1681 { |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1682 g_return_if_fail(account != NULL); |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1683 |
5867
db4df0be06fd
[gaim-migrate @ 6298]
Christian Hammond <chipx86@chipx86.com>
parents:
5865
diff
changeset
|
1684 if (g_list_find(accounts, account) != NULL) |
db4df0be06fd
[gaim-migrate @ 6298]
Christian Hammond <chipx86@chipx86.com>
parents:
5865
diff
changeset
|
1685 return; |
db4df0be06fd
[gaim-migrate @ 6298]
Christian Hammond <chipx86@chipx86.com>
parents:
5865
diff
changeset
|
1686 |
5710
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1687 accounts = g_list_append(accounts, account); |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1688 |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1689 schedule_accounts_save(); |
8134 | 1690 |
1691 gaim_signal_emit(gaim_accounts_get_handle(), "account-added", account); | |
5710
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1692 } |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1693 |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1694 void |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1695 gaim_accounts_remove(GaimAccount *account) |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1696 { |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1697 g_return_if_fail(account != NULL); |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1698 |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1699 accounts = g_list_remove(accounts, account); |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1700 |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1701 schedule_accounts_save(); |
8134 | 1702 |
1703 gaim_signal_emit(gaim_accounts_get_handle(), "account-removed", account); | |
6368
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1704 } |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1705 |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1706 void |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1707 gaim_accounts_delete(GaimAccount *account) |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1708 { |
6695 | 1709 GaimBlistNode *gnode, *cnode, *bnode; |
6368
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1710 |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1711 g_return_if_fail(account != NULL); |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1712 |
10758 | 1713 gaim_notify_close_with_handle(account); |
1714 gaim_request_close_with_handle(account); | |
1715 | |
6368
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1716 gaim_accounts_remove(account); |
6367
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1717 |
8235 | 1718 /* Remove this account's buddies */ |
6367
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1719 for (gnode = gaim_get_blist()->root; gnode != NULL; gnode = gnode->next) { |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1720 if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1721 continue; |
10106
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1722 |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1723 cnode = gnode->child; |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1724 while (cnode) { |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1725 GaimBlistNode *cnode_next = cnode->next; |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1726 |
6695 | 1727 if(GAIM_BLIST_NODE_IS_CONTACT(cnode)) { |
10106
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1728 bnode = cnode->child; |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1729 while (bnode) { |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1730 GaimBlistNode *bnode_next = bnode->next; |
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1731 |
6695 | 1732 if (GAIM_BLIST_NODE_IS_BUDDY(bnode)) { |
1733 GaimBuddy *b = (GaimBuddy *)bnode; | |
6367
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1734 |
6695 | 1735 if (b->account == account) |
1736 gaim_blist_remove_buddy(b); | |
1737 } | |
10106
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1738 bnode = bnode_next; |
6695 | 1739 } |
1740 } else if (GAIM_BLIST_NODE_IS_CHAT(cnode)) { | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1741 GaimChat *c = (GaimChat *)cnode; |
6367
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1742 |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1743 if (c->account == account) |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1744 gaim_blist_remove_chat(c); |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1745 } |
10106
131f70fc53c1
[gaim-migrate @ 11138]
Luke Schierer <lschiere@pidgin.im>
parents:
10067
diff
changeset
|
1746 cnode = cnode_next; |
6367
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1747 } |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1748 } |
9fd154ca6a94
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
1749 |
8235 | 1750 /* Remove this account's pounces */ |
1751 gaim_pounce_destroy_all_by_account(account); | |
6368
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1752 |
41e6d15f4687
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
1753 gaim_account_destroy(account); |
5710
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1754 } |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1755 |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
1756 void |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1757 gaim_accounts_reorder(GaimAccount *account, size_t new_index) |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1758 { |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1759 size_t index; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1760 GList *l; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1761 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1762 g_return_if_fail(account != NULL); |
5620
c9724982ce45
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5610
diff
changeset
|
1763 g_return_if_fail(new_index >= 0 && new_index <= g_list_length(accounts)); |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1764 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1765 index = g_list_index(accounts, account); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1766 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1767 if (index == -1) { |
10760 | 1768 gaim_debug_error("account", |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1769 "Unregistered account (%s) discovered during reorder!\n", |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1770 gaim_account_get_username(account)); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1771 return; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1772 } |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1773 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1774 l = g_list_nth(accounts, index); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1775 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1776 if (new_index > index) |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1777 new_index--; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1778 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1779 /* Remove the old one. */ |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1780 accounts = g_list_delete_link(accounts, l); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1781 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1782 /* Insert it where it should go. */ |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1783 accounts = g_list_insert(accounts, account, new_index); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1784 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1785 schedule_accounts_save(); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1786 } |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1787 |
5563 | 1788 GList * |
1789 gaim_accounts_get_all(void) | |
1790 { | |
1791 return accounts; | |
1792 } | |
5874
964e4f94fc56
[gaim-migrate @ 6306]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1793 |
11053
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1794 GList * |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1795 gaim_accounts_get_all_active(void) |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1796 { |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1797 GList *list = NULL; |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1798 GList *all = gaim_accounts_get_all(); |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1799 |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1800 while (all != NULL) { |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1801 GaimAccount *account = all->data; |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1802 |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1803 if (gaim_account_get_enabled(account, gaim_core_get_ui())) |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1804 list = g_list_append(list, account); |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1805 |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1806 all = all->next; |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1807 } |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1808 |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1809 return list; |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1810 } |
da05145441ca
[gaim-migrate @ 12991]
Richard Laager <rlaager@wiktel.com>
parents:
11042
diff
changeset
|
1811 |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1812 GaimAccount * |
7132 | 1813 gaim_accounts_find(const char *name, const char *protocol_id) |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1814 { |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1815 GaimAccount *account = NULL; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1816 GList *l; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1817 char *who; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1818 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1819 g_return_val_if_fail(name != NULL, NULL); |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1820 |
7261 | 1821 who = g_strdup(gaim_normalize(NULL, name)); |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1822 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1823 for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1824 account = (GaimAccount *)l->data; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1825 |
7261 | 1826 if (!strcmp(gaim_normalize(NULL, gaim_account_get_username(account)), who) && |
7132 | 1827 (!protocol_id || !strcmp(account->protocol_id, protocol_id))) { |
5943
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1828 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1829 break; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1830 } |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1831 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1832 account = NULL; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1833 } |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1834 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1835 g_free(who); |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1836 |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1837 return account; |
a4f2aba0848d
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1838 } |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1839 |
7015
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1840 void |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1841 gaim_accounts_set_ui_ops(GaimAccountUiOps *ops) |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1842 { |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1843 account_ui_ops = ops; |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1844 } |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1845 |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1846 GaimAccountUiOps * |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1847 gaim_accounts_get_ui_ops(void) |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1848 { |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1849 return account_ui_ops; |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1850 } |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1851 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1852 void * |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1853 gaim_accounts_get_handle(void) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1854 { |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1855 static int handle; |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1856 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1857 return &handle; |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1858 } |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1859 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1860 void |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1861 gaim_accounts_init(void) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1862 { |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1863 void *handle = gaim_accounts_get_handle(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1864 |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11014
diff
changeset
|
1865 gaim_debug_register_category("account"); |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11014
diff
changeset
|
1866 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1867 gaim_signal_register(handle, "account-connecting", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1868 gaim_marshal_VOID__POINTER, NULL, 1, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1869 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1870 GAIM_SUBTYPE_ACCOUNT)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1871 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1872 gaim_signal_register(handle, "account-away", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1873 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1874 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1875 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1876 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1877 gaim_value_new(GAIM_TYPE_STRING)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1878 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1879 gaim_signal_register(handle, "account-setting-info", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1880 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1881 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1882 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1883 gaim_value_new(GAIM_TYPE_STRING)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1884 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1885 gaim_signal_register(handle, "account-set-info", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1886 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1887 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1888 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1889 gaim_value_new(GAIM_TYPE_STRING)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1890 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1891 gaim_signal_register(handle, "account-warned", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1892 gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1893 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1894 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1895 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1896 gaim_value_new(GAIM_TYPE_UINT)); |
8134 | 1897 |
1898 gaim_signal_register(handle, "account-added", | |
10447 | 1899 gaim_marshal_VOID__POINTER, NULL, 1, |
1900 gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT)); | |
8134 | 1901 |
1902 gaim_signal_register(handle, "account-removed", | |
10447 | 1903 gaim_marshal_VOID__POINTER, NULL, 1, |
1904 gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT)); | |
10490 | 1905 |
1906 load_accounts(); | |
1907 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1908 } |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1909 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1910 void |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1911 gaim_accounts_uninit(void) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1912 { |
10428 | 1913 if (save_timer != 0) |
10427 | 1914 { |
10428 | 1915 gaim_timeout_remove(save_timer); |
1916 save_timer = 0; | |
10427 | 1917 sync_accounts(); |
8235 | 1918 } |
1919 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1920 gaim_signals_unregister_by_instance(gaim_accounts_get_handle()); |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11014
diff
changeset
|
1921 |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11014
diff
changeset
|
1922 gaim_debug_unregister_category("account"); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1923 } |