Thu, 20 Jun 2013 00:33:12 +0530
Removed unused PurpleAccount member ui_data.
If the UI wishes to store UI-specific data, it can subclass PurpleAccount.
|
5865
5b358b960d7d
[gaim-migrate @ 6296]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
1 | /** |
| 5563 | 2 | * @file account.c Account API |
| 3 | * @ingroup core | |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20093
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20093
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20093
diff
changeset
|
6 | /* purple |
| 5563 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
11 | * |
| 5563 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19767
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5563 | 25 | */ |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
26 | #include "internal.h" |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
27 | #include "accounts.h" |
|
11053
6d2abb51e586
[gaim-migrate @ 12991]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11042
diff
changeset
|
28 | #include "core.h" |
|
11067
b6353889a9ba
[gaim-migrate @ 13048]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents:
11053
diff
changeset
|
29 | #include "dbus-maybe.h" |
| 5717 | 30 | #include "debug.h" |
| 14758 | 31 | #include "network.h" |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
32 | #include "notify.h" |
| 8235 | 33 | #include "pounce.h" |
| 5563 | 34 | #include "prefs.h" |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
35 | #include "request.h" |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
36 | #include "server.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
37 | #include "signals.h" |
| 5717 | 38 | #include "util.h" |
| 5563 | 39 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
40 | #define PURPLE_ACCOUNT_GET_PRIVATE(obj) \ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
41 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_ACCOUNT, PurpleAccountPrivate)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
42 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
43 | typedef struct |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
44 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
45 | char *username; /**< The username. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
46 | char *alias; /**< How you appear to yourself. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
47 | char *password; /**< The account password. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
48 | char *user_info; /**< User information. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
49 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
50 | char *buddy_icon_path; /**< The buddy icon's non-cached path. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
51 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
52 | gboolean remember_pass; /**< Remember the password. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
53 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
54 | char *protocol_id; /**< The ID of the protocol. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
55 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
56 | PurpleConnection *gc; /**< The connection handle. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
57 | gboolean disconnecting; /**< The account is currently disconnecting */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
58 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
59 | GHashTable *settings; /**< Protocol-specific settings. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
60 | GHashTable *ui_settings; /**< UI-specific settings. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
61 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
62 | PurpleProxyInfo *proxy_info; /**< Proxy information. This will be set */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
63 | /* to NULL when the account inherits */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
64 | /* proxy settings from global prefs. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
65 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
66 | /* |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
67 | * TODO: Supplementing the next two linked lists with hash tables |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
68 | * should help performance a lot when these lists are long. This |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
69 | * matters quite a bit for protocols like MSN, where all your |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
70 | * buddies are added to your permit list. Currently we have to |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
71 | * iterate through the entire list if we want to check if someone |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
72 | * is permitted or denied. We should do this for 3.0.0. |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
73 | * Or maybe use a GTree. |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
74 | */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
75 | GSList *permit; /**< Permit list. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
76 | GSList *deny; /**< Deny list. */ |
|
34590
9da48e98a77a
Renamed PurpleAccount's private member perm_deny to privacy_type
Ankit Vani <a@nevitus.org>
parents:
34589
diff
changeset
|
77 | PurpleAccountPrivacyType privacy_type; /**< The permit/deny setting. */ |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
78 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
79 | GList *status_types; /**< Status types. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
80 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
81 | PurplePresence *presence; /**< Presence. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
82 | PurpleLog *system_log; /**< The system log */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
83 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
84 | PurpleAccountRegistrationCb registration_cb; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
85 | void *registration_cb_user_data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
86 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
87 | PurpleConnectionErrorInfo *current_error; /**< Errors */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
88 | } PurpleAccountPrivate; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
89 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
90 | typedef struct |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
91 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
92 | char *ui; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
93 | GValue value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
94 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
95 | } PurpleAccountSetting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
96 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
97 | typedef struct |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
98 | { |
| 15884 | 99 | PurpleAccountRequestType type; |
| 100 | PurpleAccount *account; | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
101 | void *ui_handle; |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
102 | char *user; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
103 | gpointer userdata; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
104 | PurpleAccountRequestAuthorizationCb auth_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
105 | PurpleAccountRequestAuthorizationCb deny_cb; |
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
106 | guint ref; |
| 15884 | 107 | } PurpleAccountRequestInfo; |
| 108 | ||
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
109 | typedef struct |
|
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
110 | { |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
111 | PurpleCallback cb; |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
112 | gpointer data; |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
113 | } PurpleCallbackBundle; |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
114 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
115 | /* GObject Property enums */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
116 | enum |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
117 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
118 | PROP_0, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
119 | PROP_USERNAME, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
120 | PROP_PRIVATE_ALIAS, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
121 | PROP_ENABLED, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
122 | PROP_CONNECTION, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
123 | PROP_PROTOCOL_ID, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
124 | PROP_USER_INFO, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
125 | PROP_BUDDY_ICON_PATH, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
126 | PROP_REMEMBER_PASSWORD, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
127 | PROP_CHECK_MAIL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
128 | PROP_LAST |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
129 | }; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
130 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
131 | static GObjectClass *parent_class = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
132 | static GList *handles = NULL; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
133 | |
| 5563 | 134 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
135 | void |
|
17814
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
136 | purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data) |
|
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
137 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
138 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
139 | |
|
17814
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
140 | g_return_if_fail(account != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
141 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
142 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
143 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
144 | priv->registration_cb = cb; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
145 | priv->registration_cb_user_data = user_data; |
|
17814
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
146 | } |
|
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
147 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
148 | static void |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
149 | purple_account_register_got_password_cb(PurpleAccount *account, |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
150 | const gchar *password, GError *error, gpointer data) |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
151 | { |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
152 | g_return_if_fail(account != NULL); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
153 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
154 | _purple_connection_new(account, TRUE, password); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
155 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
156 | |
|
17814
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
157 | void |
| 15884 | 158 | purple_account_register(PurpleAccount *account) |
| 6581 | 159 | { |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
160 | g_return_if_fail(account != NULL); |
| 6581 | 161 | |
| 15884 | 162 | purple_debug_info("account", "Registering account %s\n", |
| 163 | purple_account_get_username(account)); | |
| 164 | ||
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
165 | purple_keyring_get_password(account, |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
166 | purple_account_register_got_password_cb, NULL); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
167 | } |
| 6581 | 168 | |
|
33983
317cd0a252c2
Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33982
diff
changeset
|
169 | static void |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
170 | purple_account_unregister_got_password_cb(PurpleAccount *account, |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
171 | const gchar *password, GError *error, gpointer data) |
|
33983
317cd0a252c2
Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33982
diff
changeset
|
172 | { |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
173 | PurpleCallbackBundle *cbb = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
174 | PurpleAccountUnregistrationCb cb; |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
175 | |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
176 | cb = (PurpleAccountUnregistrationCb)cbb->cb; |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
177 | _purple_connection_new_unregister(account, password, cb, cbb->data); |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
178 | |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
179 | g_free(cbb); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
180 | } |
| 6581 | 181 | |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
182 | void |
|
32721
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
183 | purple_account_register_completed(PurpleAccount *account, gboolean succeeded) |
|
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
184 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
185 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
186 | |
|
32721
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
187 | g_return_if_fail(account != NULL); |
|
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
188 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
189 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
190 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
191 | if (priv->registration_cb) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
192 | (priv->registration_cb)(account, succeeded, priv->registration_cb_user_data); |
|
32721
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
193 | } |
|
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
194 | |
|
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
195 | void |
|
18994
310e9d853e2b
Implemented a callback for unregistering, mirroring the registration callback. Since this is a new API, I can do it properly by passing it right in the unregister function call, instead of having a separate function for setting it.
Andreas Monitzer <am@adiumx.com>
parents:
18912
diff
changeset
|
196 | purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data) |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
197 | { |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
198 | PurpleCallbackBundle *cbb; |
|
33983
317cd0a252c2
Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33982
diff
changeset
|
199 | |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
200 | g_return_if_fail(account != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
201 | |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
202 | purple_debug_info("account", "Unregistering account %s\n", |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
203 | purple_account_get_username(account)); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
204 | |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
205 | cbb = g_new0(PurpleCallbackBundle, 1); |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
206 | cbb->cb = PURPLE_CALLBACK(cb); |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
207 | cbb->data = user_data; |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
208 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
209 | purple_keyring_get_password(account, |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
210 | purple_account_unregister_got_password_cb, cbb); |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
211 | } |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
212 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
213 | static void |
| 15884 | 214 | request_password_ok_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
215 | { |
|
11042
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
216 | const char *entry; |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
217 | gboolean remember; |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
218 | |
| 15884 | 219 | entry = purple_request_fields_get_string(fields, "password"); |
| 220 | remember = purple_request_fields_get_bool(fields, "remember"); | |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
221 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
222 | if (!entry || !*entry) |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
223 | { |
| 15884 | 224 | purple_notify_error(account, NULL, _("Password is required to sign on."), NULL); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
225 | return; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
226 | } |
| 6581 | 227 | |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
228 | purple_account_set_remember_password(account, remember); |
|
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
229 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
230 | purple_account_set_password(account, entry, NULL, NULL); |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
24230
diff
changeset
|
231 | _purple_connection_new(account, FALSE, entry); |
| 6581 | 232 | } |
| 233 | ||
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
234 | static void |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
235 | request_password_cancel_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
236 | { |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30456
diff
changeset
|
237 | /* Disable the account as the user has cancelled connecting */ |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
238 | purple_account_set_enabled(account, purple_core_get_ui(), FALSE); |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
239 | } |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
240 | |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
241 | |
|
16180
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
242 | void |
|
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
243 | purple_account_request_password(PurpleAccount *account, GCallback ok_cb, |
|
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
244 | GCallback cancel_cb, void *user_data) |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
245 | { |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
246 | gchar *primary; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
247 | const gchar *username; |
| 15884 | 248 | PurpleRequestFieldGroup *group; |
| 249 | PurpleRequestField *field; | |
| 250 | PurpleRequestFields *fields; | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
251 | |
|
10758
b4554ec8d126
[gaim-migrate @ 12361]
Mark Doliner <markdoliner@pidgin.im>
parents:
10754
diff
changeset
|
252 | /* Close any previous password request windows */ |
| 15884 | 253 | purple_request_close_with_handle(account); |
| 254 | ||
| 255 | username = purple_account_get_username(account); | |
|
10774
f4238d6312ff
[gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10760
diff
changeset
|
256 | primary = g_strdup_printf(_("Enter password for %s (%s)"), username, |
| 15884 | 257 | purple_account_get_protocol_name(account)); |
| 258 | ||
| 259 | fields = purple_request_fields_new(); | |
| 260 | group = purple_request_field_group_new(NULL); | |
| 261 | purple_request_fields_add_group(fields, group); | |
| 262 | ||
| 263 | field = purple_request_field_string_new("password", _("Enter Password"), NULL, FALSE); | |
| 264 | purple_request_field_string_set_masked(field, TRUE); | |
| 265 | purple_request_field_set_required(field, TRUE); | |
| 266 | purple_request_field_group_add_field(group, field); | |
| 267 | ||
| 268 | field = purple_request_field_bool_new("remember", _("Save password"), FALSE); | |
| 269 | purple_request_field_group_add_field(group, field); | |
| 270 | ||
| 271 | purple_request_fields(account, | |
|
11042
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
272 | NULL, |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
273 | primary, |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
274 | NULL, |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
275 | fields, |
|
16180
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
276 | _("OK"), ok_cb, |
|
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
277 | _("Cancel"), cancel_cb, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16180
diff
changeset
|
278 | account, NULL, NULL, |
|
16180
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
279 | user_data); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
280 | g_free(primary); |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
281 | } |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
282 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
283 | static void |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
284 | purple_account_connect_got_password_cb(PurpleAccount *account, |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
285 | const gchar *password, GError *error, gpointer data) |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
286 | { |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
287 | PurplePluginProtocolInfo *prpl_info = data; |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
288 | |
|
34086
6fcec7f32c4a
Prompt the user for a password if the keyring's result is non-NULL,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34063
diff
changeset
|
289 | if ((password == NULL || *password == '\0') && |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
290 | !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
291 | !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
292 | purple_account_request_password(account, |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
293 | G_CALLBACK(request_password_ok_cb), |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
294 | G_CALLBACK(request_password_cancel_cb), account); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
295 | else |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
296 | _purple_connection_new(account, FALSE, password); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
297 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
298 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
299 | void |
| 15884 | 300 | purple_account_connect(PurpleAccount *account) |
| 5563 | 301 | { |
| 15884 | 302 | PurplePlugin *prpl; |
|
34022
c49f6e9ea27d
Make all the prpls build.
Paul Aurich <darkrain42@pidgin.im>
parents:
34021
diff
changeset
|
303 | const char *username; |
| 15884 | 304 | PurplePluginProtocolInfo *prpl_info; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
305 | PurpleAccountPrivate *priv; |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
306 | |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
307 | g_return_if_fail(account != NULL); |
| 5563 | 308 | |
|
27575
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
309 | username = purple_account_get_username(account); |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
310 | |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
311 | if (!purple_account_get_enabled(account, purple_core_get_ui())) { |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
312 | purple_debug_info("account", |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
313 | "Account %s not enabled, not connecting.\n", |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
314 | username); |
|
11722
8cad41c3c5b9
[gaim-migrate @ 14013]
Mark Doliner <markdoliner@pidgin.im>
parents:
11643
diff
changeset
|
315 | return; |
|
27575
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
316 | } |
|
11722
8cad41c3c5b9
[gaim-migrate @ 14013]
Mark Doliner <markdoliner@pidgin.im>
parents:
11643
diff
changeset
|
317 | |
| 15884 | 318 | prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
|
27575
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
319 | if (prpl == NULL) { |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
320 | gchar *message; |
|
6036
285e48913c72
[gaim-migrate @ 6486]
Mark Doliner <markdoliner@pidgin.im>
parents:
5979
diff
changeset
|
321 | |
|
27575
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
322 | message = g_strdup_printf(_("Missing protocol plugin for %s"), username); |
| 15884 | 323 | purple_notify_error(account, _("Connection Error"), message, NULL); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
324 | g_free(message); |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
325 | return; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
326 | } |
| 5563 | 327 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
328 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
329 | |
|
27575
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
330 | purple_debug_info("account", "Connecting to account %s.\n", username); |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
331 | |
| 15884 | 332 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
333 | if (priv->password != NULL) { |
|
34146
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
334 | purple_account_connect_got_password_cb(account, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
335 | priv->password, NULL, prpl_info); |
|
34146
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
336 | } else { |
|
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
337 | purple_keyring_get_password(account, |
|
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
338 | purple_account_connect_got_password_cb, prpl_info); |
|
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
339 | } |
| 5563 | 340 | } |
| 341 | ||
| 342 | void | |
| 15884 | 343 | purple_account_disconnect(PurpleAccount *account) |
| 5563 | 344 | { |
| 15884 | 345 | PurpleConnection *gc; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
346 | PurpleAccountPrivate *priv; |
|
28373
14e79bd71ac3
Display the username in the debug log when disconnecting an account.
Paul Aurich <darkrain42@pidgin.im>
parents:
27969
diff
changeset
|
347 | const char *username; |
|
5926
f0c5bbf16793
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5879
diff
changeset
|
348 | |
| 5563 | 349 | g_return_if_fail(account != NULL); |
| 15884 | 350 | g_return_if_fail(!purple_account_is_disconnected(account)); |
| 351 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
352 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
353 | |
|
28373
14e79bd71ac3
Display the username in the debug log when disconnecting an account.
Paul Aurich <darkrain42@pidgin.im>
parents:
27969
diff
changeset
|
354 | username = purple_account_get_username(account); |
|
14e79bd71ac3
Display the username in the debug log when disconnecting an account.
Paul Aurich <darkrain42@pidgin.im>
parents:
27969
diff
changeset
|
355 | purple_debug_info("account", "Disconnecting account %s (%p)\n", |
|
14e79bd71ac3
Display the username in the debug log when disconnecting an account.
Paul Aurich <darkrain42@pidgin.im>
parents:
27969
diff
changeset
|
356 | username ? username : "(null)", account); |
|
5930
cdd2e5397cd3
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
357 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
358 | priv->disconnecting = TRUE; |
| 5563 | 359 | |
| 15884 | 360 | gc = purple_account_get_connection(account); |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
24230
diff
changeset
|
361 | _purple_connection_destroy(gc); |
| 15884 | 362 | purple_account_set_connection(account, NULL); |
| 10384 | 363 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
364 | priv->disconnecting = FALSE; |
| 5563 | 365 | } |
| 366 | ||
|
32722
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
367 | gboolean |
|
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
368 | purple_account_is_disconnecting(const PurpleAccount *account) |
|
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
369 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
370 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
371 | |
|
32722
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
372 | g_return_val_if_fail(account != NULL, TRUE); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
373 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
374 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
375 | return priv->disconnecting; |
|
32722
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
376 | } |
|
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
377 | |
| 5563 | 378 | void |
| 15884 | 379 | purple_account_notify_added(PurpleAccount *account, const char *remote_user, |
| 12287 | 380 | const char *id, const char *alias, |
| 12286 | 381 | const char *message) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
382 | { |
| 15884 | 383 | PurpleAccountUiOps *ui_ops; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
384 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
385 | g_return_if_fail(account != NULL); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
386 | g_return_if_fail(remote_user != NULL); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
387 | |
| 15884 | 388 | ui_ops = purple_accounts_get_ui_ops(); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
389 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
390 | if (ui_ops != NULL && ui_ops->notify_added != NULL) |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
391 | ui_ops->notify_added(account, remote_user, id, alias, message); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
392 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
393 | |
| 12285 | 394 | void |
| 15884 | 395 | purple_account_request_add(PurpleAccount *account, const char *remote_user, |
| 12285 | 396 | const char *id, const char *alias, |
| 397 | const char *message) | |
| 398 | { | |
| 15884 | 399 | PurpleAccountUiOps *ui_ops; |
| 12285 | 400 | |
| 401 | g_return_if_fail(account != NULL); | |
| 402 | g_return_if_fail(remote_user != NULL); | |
| 403 | ||
| 15884 | 404 | ui_ops = purple_accounts_get_ui_ops(); |
| 12285 | 405 | |
| 406 | if (ui_ops != NULL && ui_ops->request_add != NULL) | |
| 407 | ui_ops->request_add(account, remote_user, id, alias, message); | |
| 408 | } | |
| 409 | ||
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
410 | static PurpleAccountRequestInfo * |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
411 | purple_account_request_info_unref(PurpleAccountRequestInfo *info) |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
412 | { |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
413 | if (--info->ref) |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
414 | return info; |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
415 | |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
416 | /* TODO: This will leak info->user_data, but there is no callback to just clean that up */ |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
417 | g_free(info->user); |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
418 | g_free(info); |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
419 | return NULL; |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
420 | } |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
421 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
422 | static void |
| 15884 | 423 | purple_account_request_close_info(PurpleAccountRequestInfo *info) |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
424 | { |
| 15884 | 425 | PurpleAccountUiOps *ops; |
| 426 | ||
| 427 | ops = purple_accounts_get_ui_ops(); | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
428 | |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
429 | if (ops != NULL && ops->close_account_request != NULL) |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
430 | ops->close_account_request(info->ui_handle); |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
431 | |
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
432 | purple_account_request_info_unref(info); |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
433 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
434 | |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
435 | void |
| 15884 | 436 | purple_account_request_close_with_account(PurpleAccount *account) |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
437 | { |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
438 | GList *l, *l_next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
439 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
440 | g_return_if_fail(account != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
441 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
442 | for (l = handles; l != NULL; l = l_next) { |
| 15884 | 443 | PurpleAccountRequestInfo *info = l->data; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
444 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
445 | l_next = l->next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
446 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
447 | if (info->account == account) { |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
448 | handles = g_list_remove(handles, info); |
| 15884 | 449 | purple_account_request_close_info(info); |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
450 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
451 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
452 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
453 | |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
454 | void |
| 15884 | 455 | purple_account_request_close(void *ui_handle) |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
456 | { |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
457 | GList *l, *l_next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
458 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
459 | g_return_if_fail(ui_handle != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
460 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
461 | for (l = handles; l != NULL; l = l_next) { |
| 15884 | 462 | PurpleAccountRequestInfo *info = l->data; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
463 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
464 | l_next = l->next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
465 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
466 | if (info->ui_handle == ui_handle) { |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
467 | handles = g_list_remove(handles, info); |
| 15884 | 468 | purple_account_request_close_info(info); |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
469 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
470 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
471 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
472 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
473 | static void |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
474 | request_auth_cb(const char *message, void *data) |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
475 | { |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
476 | PurpleAccountRequestInfo *info = data; |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
477 | |
|
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
478 | handles = g_list_remove(handles, info); |
|
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
479 | |
|
29046
1cae96b8e674
*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465):
Daniel Atallah <datallah@pidgin.im>
parents:
28764
diff
changeset
|
480 | if (info->auth_cb != NULL) |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
481 | info->auth_cb(message, info->userdata); |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
482 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
483 | purple_signal_emit(purple_accounts_get_handle(), |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
484 | "account-authorization-granted", info->account, info->user, message); |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
485 | |
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
486 | purple_account_request_info_unref(info); |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
487 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
488 | |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
489 | static void |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
490 | request_deny_cb(const char *message, void *data) |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
491 | { |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
492 | PurpleAccountRequestInfo *info = data; |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
493 | |
|
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
494 | handles = g_list_remove(handles, info); |
|
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
495 | |
|
29046
1cae96b8e674
*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465):
Daniel Atallah <datallah@pidgin.im>
parents:
28764
diff
changeset
|
496 | if (info->deny_cb != NULL) |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
497 | info->deny_cb(message, info->userdata); |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
498 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
499 | purple_signal_emit(purple_accounts_get_handle(), |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
500 | "account-authorization-denied", info->account, info->user, message); |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22104
diff
changeset
|
501 | |
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
502 | purple_account_request_info_unref(info); |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
503 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
504 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
505 | void * |
| 15884 | 506 | purple_account_request_authorization(PurpleAccount *account, const char *remote_user, |
|
19335
4613b53d5741
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents:
18636
diff
changeset
|
507 | const char *id, const char *alias, const char *message, gboolean on_list, |
|
4613b53d5741
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents:
18636
diff
changeset
|
508 | PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data) |
| 15119 | 509 | { |
| 15884 | 510 | PurpleAccountUiOps *ui_ops; |
| 511 | PurpleAccountRequestInfo *info; | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
512 | int plugin_return; |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
513 | char *response = NULL; |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
514 | |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
515 | g_return_val_if_fail(account != NULL, NULL); |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
516 | g_return_val_if_fail(remote_user != NULL, NULL); |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
517 | |
| 15884 | 518 | ui_ops = purple_accounts_get_ui_ops(); |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
519 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
520 | plugin_return = GPOINTER_TO_INT( |
|
31325
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
521 | purple_signal_emit_return_1( |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
522 | purple_accounts_get_handle(), |
|
33686
0f6df320414b
Remove duplicate account-authorization-requested-with-message signal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32722
diff
changeset
|
523 | "account-authorization-requested", |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
524 | account, remote_user, message, &response |
|
31325
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
525 | )); |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
526 | |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
527 | switch (plugin_return) |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
528 | { |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
529 | case PURPLE_ACCOUNT_RESPONSE_IGNORE: |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
530 | g_free(response); |
|
31325
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
531 | return NULL; |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
532 | case PURPLE_ACCOUNT_RESPONSE_ACCEPT: |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
533 | if (auth_cb != NULL) |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
534 | auth_cb(response, user_data); |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
535 | g_free(response); |
|
31325
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
536 | return NULL; |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
537 | case PURPLE_ACCOUNT_RESPONSE_DENY: |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
538 | if (deny_cb != NULL) |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
539 | deny_cb(response, user_data); |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
540 | g_free(response); |
|
31325
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
541 | return NULL; |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
542 | } |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
543 | |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
544 | g_free(response); |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
545 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
546 | if (ui_ops != NULL && ui_ops->request_authorize != NULL) { |
| 15884 | 547 | info = g_new0(PurpleAccountRequestInfo, 1); |
| 548 | info->type = PURPLE_ACCOUNT_REQUEST_AUTHORIZATION; | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
549 | info->account = account; |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
550 | info->auth_cb = auth_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
551 | info->deny_cb = deny_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
552 | info->userdata = user_data; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
553 | info->user = g_strdup(remote_user); |
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
554 | info->ref = 2; /* We hold an extra ref to make sure info remains valid |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
555 | if any of the callbacks are called synchronously. We |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
556 | unref it after the function call */ |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
557 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
558 | info->ui_handle = ui_ops->request_authorize(account, remote_user, id, alias, message, |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
559 | on_list, request_auth_cb, request_deny_cb, info); |
|
19335
4613b53d5741
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents:
18636
diff
changeset
|
560 | |
|
25113
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
561 | info = purple_account_request_info_unref(info); |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
562 | if (info) { |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
563 | handles = g_list_append(handles, info); |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
564 | return info->ui_handle; |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
565 | } |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
566 | } |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
567 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15482
diff
changeset
|
568 | return NULL; |
| 15119 | 569 | } |
| 570 | ||
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
571 | static void |
| 15884 | 572 | change_password_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
573 | { |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
574 | const char *orig_pass, *new_pass_1, *new_pass_2; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
575 | |
| 15884 | 576 | orig_pass = purple_request_fields_get_string(fields, "password"); |
| 577 | new_pass_1 = purple_request_fields_get_string(fields, "new_password_1"); | |
| 578 | new_pass_2 = purple_request_fields_get_string(fields, "new_password_2"); | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
579 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
580 | if (g_utf8_collate(new_pass_1, new_pass_2)) |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
581 | { |
| 15884 | 582 | purple_notify_error(account, NULL, |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
583 | _("New passwords do not match."), NULL); |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
584 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
585 | return; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
586 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
587 | |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
588 | if ((purple_request_fields_is_field_required(fields, "password") && |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
589 | (orig_pass == NULL || *orig_pass == '\0')) || |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
590 | (purple_request_fields_is_field_required(fields, "new_password_1") && |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
591 | (new_pass_1 == NULL || *new_pass_1 == '\0')) || |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
592 | (purple_request_fields_is_field_required(fields, "new_password_2") && |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
593 | (new_pass_2 == NULL || *new_pass_2 == '\0'))) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
594 | { |
| 15884 | 595 | purple_notify_error(account, NULL, |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
596 | _("Fill out all fields completely."), NULL); |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
597 | return; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
598 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
599 | |
| 15884 | 600 | purple_account_change_password(account, orig_pass, new_pass_1); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
601 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
602 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
603 | void |
| 15884 | 604 | purple_account_request_change_password(PurpleAccount *account) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
605 | { |
| 15884 | 606 | PurpleRequestFields *fields; |
| 607 | PurpleRequestFieldGroup *group; | |
| 608 | PurpleRequestField *field; | |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
609 | PurpleConnection *gc; |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
610 | PurplePlugin *prpl = NULL; |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
611 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
612 | char primary[256]; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
613 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
614 | g_return_if_fail(account != NULL); |
| 15884 | 615 | g_return_if_fail(purple_account_is_connected(account)); |
| 616 | ||
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
617 | gc = purple_account_get_connection(account); |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
618 | if (gc != NULL) |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
619 | prpl = purple_connection_get_prpl(gc); |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
620 | if (prpl != NULL) |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
621 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
622 | |
| 15884 | 623 | fields = purple_request_fields_new(); |
| 624 | ||
| 625 | group = purple_request_field_group_new(NULL); | |
| 626 | purple_request_fields_add_group(fields, group); | |
| 627 | ||
| 628 | field = purple_request_field_string_new("password", _("Original password"), | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
629 | NULL, FALSE); |
| 15884 | 630 | purple_request_field_string_set_masked(field, TRUE); |
|
33786
909e73523124
libpurple: fix incorrect check for password being optional (it was always being
Daniel Atallah <datallah@pidgin.im>
parents:
31885
diff
changeset
|
631 | if (!prpl_info || !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
632 | purple_request_field_set_required(field, TRUE); |
| 15884 | 633 | purple_request_field_group_add_field(group, field); |
| 634 | ||
| 635 | field = purple_request_field_string_new("new_password_1", | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
636 | _("New password"), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
637 | NULL, FALSE); |
| 15884 | 638 | purple_request_field_string_set_masked(field, TRUE); |
|
33786
909e73523124
libpurple: fix incorrect check for password being optional (it was always being
Daniel Atallah <datallah@pidgin.im>
parents:
31885
diff
changeset
|
639 | if (!prpl_info || !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
640 | purple_request_field_set_required(field, TRUE); |
| 15884 | 641 | purple_request_field_group_add_field(group, field); |
| 642 | ||
| 643 | field = purple_request_field_string_new("new_password_2", | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
644 | _("New password (again)"), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
645 | NULL, FALSE); |
| 15884 | 646 | purple_request_field_string_set_masked(field, TRUE); |
|
33786
909e73523124
libpurple: fix incorrect check for password being optional (it was always being
Daniel Atallah <datallah@pidgin.im>
parents:
31885
diff
changeset
|
647 | if (!prpl_info || !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
648 | purple_request_field_set_required(field, TRUE); |
| 15884 | 649 | purple_request_field_group_add_field(group, field); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
650 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
651 | g_snprintf(primary, sizeof(primary), _("Change password for %s"), |
| 15884 | 652 | purple_account_get_username(account)); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
653 | |
|
7755
a08288ab4e5f
[gaim-migrate @ 8400]
Mark Doliner <markdoliner@pidgin.im>
parents:
7654
diff
changeset
|
654 | /* I'm sticking this somewhere in the code: bologna */ |
|
a08288ab4e5f
[gaim-migrate @ 8400]
Mark Doliner <markdoliner@pidgin.im>
parents:
7654
diff
changeset
|
655 | |
| 15884 | 656 | purple_request_fields(purple_account_get_connection(account), |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
657 | NULL, |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
658 | primary, |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
659 | _("Please enter your current password and your " |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
660 | "new password."), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
661 | fields, |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
662 | _("OK"), G_CALLBACK(change_password_cb), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
663 | _("Cancel"), NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16180
diff
changeset
|
664 | account, NULL, NULL, |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
665 | account); |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
666 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
667 | |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
668 | static void |
| 15884 | 669 | set_user_info_cb(PurpleAccount *account, const char *user_info) |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
670 | { |
| 15884 | 671 | PurpleConnection *gc; |
| 672 | ||
| 673 | purple_account_set_user_info(account, user_info); | |
| 674 | gc = purple_account_get_connection(account); | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
675 | serv_set_info(gc, user_info); |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
676 | } |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
677 | |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
678 | void |
| 15884 | 679 | purple_account_request_change_user_info(PurpleAccount *account) |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
680 | { |
| 15884 | 681 | PurpleConnection *gc; |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
682 | char primary[256]; |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
683 | |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
684 | g_return_if_fail(account != NULL); |
| 15884 | 685 | g_return_if_fail(purple_account_is_connected(account)); |
| 686 | ||
| 687 | gc = purple_account_get_connection(account); | |
| 8697 | 688 | |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
689 | g_snprintf(primary, sizeof(primary), |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
690 | _("Change user information for %s"), |
| 15884 | 691 | purple_account_get_username(account)); |
| 692 | ||
| 693 | purple_request_input(gc, _("Set User Info"), primary, NULL, | |
| 694 | purple_account_get_user_info(account), | |
| 8697 | 695 | TRUE, FALSE, ((gc != NULL) && |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32634
diff
changeset
|
696 | (purple_connection_get_flags(gc) & PURPLE_CONNECTION_HTML) ? "html" : NULL), |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
697 | _("Save"), G_CALLBACK(set_user_info_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16180
diff
changeset
|
698 | _("Cancel"), NULL, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16180
diff
changeset
|
699 | account, NULL, NULL, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16180
diff
changeset
|
700 | account); |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
701 | } |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
702 | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
703 | void |
| 15884 | 704 | purple_account_set_username(PurpleAccount *account, const char *username) |
| 5563 | 705 | { |
|
27969
ed5bf3c3e328
Add blist ui-ops to overload the saving of data to blist.xml. Closes #9630.
Jan Kaluza <hanzz.k@gmail.com>
parents:
27638
diff
changeset
|
706 | PurpleBlistUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
707 | PurpleAccountPrivate *priv; |
|
27969
ed5bf3c3e328
Add blist ui-ops to overload the saving of data to blist.xml. Closes #9630.
Jan Kaluza <hanzz.k@gmail.com>
parents:
27638
diff
changeset
|
708 | |
|
5711
5aa3984f5f80
[gaim-migrate @ 6132]
Christian Hammond <chipx86@chipx86.com>
parents:
5710
diff
changeset
|
709 | g_return_if_fail(account != NULL); |
| 5563 | 710 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
711 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
712 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
713 | g_free(priv->username); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
714 | priv->username = g_strdup(username); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
715 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
716 | purple_accounts_schedule_save(); |
| 15163 | 717 | |
| 718 | /* if the name changes, we should re-write the buddy list | |
| 719 | * to disk with the new name */ | |
|
27969
ed5bf3c3e328
Add blist ui-ops to overload the saving of data to blist.xml. Closes #9630.
Jan Kaluza <hanzz.k@gmail.com>
parents:
27638
diff
changeset
|
720 | blist_ops = purple_blist_get_ui_ops(); |
|
ed5bf3c3e328
Add blist ui-ops to overload the saving of data to blist.xml. Closes #9630.
Jan Kaluza <hanzz.k@gmail.com>
parents:
27638
diff
changeset
|
721 | if (blist_ops != NULL && blist_ops->save_account != NULL) |
|
ed5bf3c3e328
Add blist ui-ops to overload the saving of data to blist.xml. Closes #9630.
Jan Kaluza <hanzz.k@gmail.com>
parents:
27638
diff
changeset
|
722 | blist_ops->save_account(account); |
| 5563 | 723 | } |
| 724 | ||
|
33987
9beebdbf44d6
Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33983
diff
changeset
|
725 | void |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
726 | purple_account_set_password(PurpleAccount *account, const gchar *password, |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
727 | PurpleKeyringSaveCallback cb, gpointer data) |
| 5563 | 728 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
729 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
730 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
731 | g_return_if_fail(account != NULL); |
| 5563 | 732 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
733 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
734 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
735 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
736 | priv->password = g_strdup(password); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
737 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
738 | purple_accounts_schedule_save(); |
|
34056
07643afffcdc
Replace one hack with another. Maybe we want to think about something
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
739 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
740 | if (!purple_account_get_remember_password(account)) { |
|
33997
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
741 | purple_debug_info("account", |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
742 | "Password for %s set, not sent to keyring.\n", |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
743 | purple_account_get_username(account)); |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
744 | |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
745 | if (cb != NULL) |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
746 | cb(account, NULL, data); |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
747 | } else { |
|
34029
059c1270db1f
Remove the silly destroy argument from purple_account_set_password and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34028
diff
changeset
|
748 | purple_keyring_set_password(account, password, cb, data); |
|
33987
9beebdbf44d6
Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33983
diff
changeset
|
749 | } |
| 5563 | 750 | } |
| 751 | ||
| 752 | void | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
753 | purple_account_set_private_alias(PurpleAccount *account, const char *alias) |
| 5563 | 754 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
755 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
756 | |
| 5563 | 757 | g_return_if_fail(account != NULL); |
| 758 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
759 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
760 | |
|
13731
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
761 | /* |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
762 | * Do nothing if alias and priv->alias are both NULL. Or if |
|
13731
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
763 | * they're the exact same string. |
|
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
764 | */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
765 | if (alias == priv->alias) |
|
13731
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
766 | return; |
|
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
767 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
768 | if ((!alias && priv->alias) || (alias && !priv->alias) || |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
769 | g_utf8_collate(priv->alias, alias)) |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
770 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
771 | char *old = priv->alias; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
772 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
773 | priv->alias = g_strdup(alias); |
| 15884 | 774 | purple_signal_emit(purple_accounts_get_handle(), "account-alias-changed", |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
775 | account, old); |
|
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
776 | g_free(old); |
|
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
777 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
778 | purple_accounts_schedule_save(); |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
779 | } |
| 5563 | 780 | } |
| 781 | ||
| 782 | void | |
| 15884 | 783 | purple_account_set_user_info(PurpleAccount *account, const char *user_info) |
| 5563 | 784 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
785 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
786 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
787 | g_return_if_fail(account != NULL); |
| 5563 | 788 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
789 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
790 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
791 | g_free(priv->user_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
792 | priv->user_info = g_strdup(user_info); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
793 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
794 | purple_accounts_schedule_save(); |
| 5563 | 795 | } |
| 796 | ||
| 15884 | 797 | void purple_account_set_buddy_icon_path(PurpleAccount *account, const char *path) |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
798 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
799 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
800 | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
801 | g_return_if_fail(account != NULL); |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
802 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
803 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
804 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
805 | g_free(priv->buddy_icon_path); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
806 | priv->buddy_icon_path = g_strdup(path); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
807 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
808 | purple_accounts_schedule_save(); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
809 | } |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
810 | |
| 5563 | 811 | void |
| 15884 | 812 | purple_account_set_protocol_id(PurpleAccount *account, const char *protocol_id) |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
813 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
814 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
815 | |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
816 | g_return_if_fail(account != NULL); |
|
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
817 | g_return_if_fail(protocol_id != NULL); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
818 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
819 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
820 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
821 | g_free(priv->protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
822 | priv->protocol_id = g_strdup(protocol_id); |
|
5665
0115e8068f51
[gaim-migrate @ 6081]
Christian Hammond <chipx86@chipx86.com>
parents:
5659
diff
changeset
|
823 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
824 | purple_accounts_schedule_save(); |
| 5563 | 825 | } |
| 826 | ||
| 827 | void | |
| 15884 | 828 | purple_account_set_connection(PurpleAccount *account, PurpleConnection *gc) |
| 5563 | 829 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
830 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
831 | |
| 5563 | 832 | g_return_if_fail(account != NULL); |
| 833 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
834 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
835 | priv->gc = gc; |
| 5563 | 836 | } |
| 837 | ||
| 838 | void | |
| 15884 | 839 | purple_account_set_remember_password(PurpleAccount *account, gboolean value) |
| 5563 | 840 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
841 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
842 | |
| 5563 | 843 | g_return_if_fail(account != NULL); |
| 844 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
845 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
846 | priv->remember_pass = value; |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
847 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
848 | purple_accounts_schedule_save(); |
| 5563 | 849 | } |
| 850 | ||
| 851 | void | |
| 15884 | 852 | purple_account_set_check_mail(PurpleAccount *account, gboolean value) |
|
5659
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
853 | { |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
854 | g_return_if_fail(account != NULL); |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
855 | |
| 15884 | 856 | purple_account_set_bool(account, "check-mail", value); |
|
5659
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
857 | } |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
858 | |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
859 | void |
| 15884 | 860 | purple_account_set_enabled(PurpleAccount *account, const char *ui, |
| 10400 | 861 | gboolean value) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
862 | { |
| 15884 | 863 | PurpleConnection *gc; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
864 | PurpleAccountPrivate *priv; |
| 12070 | 865 | gboolean was_enabled = FALSE; |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
866 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
867 | g_return_if_fail(account != NULL); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
868 | g_return_if_fail(ui != NULL); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
869 | |
| 15884 | 870 | was_enabled = purple_account_get_enabled(account, ui); |
| 871 | ||
| 872 | purple_account_set_ui_bool(account, ui, "auto-login", value); | |
| 873 | gc = purple_account_get_connection(account); | |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
874 | |
| 12070 | 875 | if(was_enabled && !value) |
| 15884 | 876 | purple_signal_emit(purple_accounts_get_handle(), "account-disabled", account); |
| 12070 | 877 | else if(!was_enabled && value) |
| 15884 | 878 | purple_signal_emit(purple_accounts_get_handle(), "account-enabled", account); |
| 12070 | 879 | |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
880 | if ((gc != NULL) && (gc->wants_to_die == TRUE)) |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
881 | return; |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
882 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
883 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
884 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
885 | if (value && purple_presence_is_online(priv->presence)) |
| 15884 | 886 | purple_account_connect(account); |
| 887 | else if (!value && !purple_account_is_disconnected(account)) | |
| 888 | purple_account_disconnect(account); | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
889 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
890 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
891 | void |
| 15884 | 892 | purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
893 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
894 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
895 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
896 | g_return_if_fail(account != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
897 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
898 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
899 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
900 | if (priv->proxy_info != NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
901 | purple_proxy_info_destroy(priv->proxy_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
902 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
903 | priv->proxy_info = info; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
904 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
905 | purple_accounts_schedule_save(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
906 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
907 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
908 | void |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
909 | purple_account_set_privacy_type(PurpleAccount *account, PurpleAccountPrivacyType privacy_type) |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
910 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
911 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
912 | |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
913 | g_return_if_fail(account != NULL); |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
914 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
915 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34590
9da48e98a77a
Renamed PurpleAccount's private member perm_deny to privacy_type
Ankit Vani <a@nevitus.org>
parents:
34589
diff
changeset
|
916 | priv->privacy_type = privacy_type; |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
917 | } |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
918 | |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
919 | void |
| 15884 | 920 | purple_account_set_status_types(PurpleAccount *account, GList *status_types) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
921 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
922 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
923 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
924 | g_return_if_fail(account != NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
925 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
926 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
927 | |
| 14724 | 928 | /* Out with the old... */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
929 | if (priv->status_types != NULL) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
930 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
931 | g_list_foreach(priv->status_types, (GFunc)purple_status_type_destroy, NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
932 | g_list_free(priv->status_types); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
933 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
934 | |
|
10005
1d711ab1de4e
[gaim-migrate @ 10922]
Mark Doliner <markdoliner@pidgin.im>
parents:
9989
diff
changeset
|
935 | /* In with the new... */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
936 | priv->status_types = status_types; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
937 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
938 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
939 | void |
| 15884 | 940 | purple_account_set_status(PurpleAccount *account, const char *status_id, |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
941 | gboolean active, ...) |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
942 | { |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
943 | GList *attrs = NULL; |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
944 | const gchar *id; |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
945 | gpointer data; |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
946 | va_list args; |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
947 | |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
948 | va_start(args, active); |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
949 | while ((id = va_arg(args, const char *)) != NULL) |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
950 | { |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
951 | attrs = g_list_append(attrs, (char *)id); |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
952 | data = va_arg(args, void *); |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
953 | attrs = g_list_append(attrs, data); |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
954 | } |
| 15884 | 955 | purple_account_set_status_list(account, status_id, active, attrs); |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
956 | g_list_free(attrs); |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
957 | va_end(args); |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
958 | } |
|
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
959 | |
|
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
960 | void |
| 15884 | 961 | purple_account_set_status_list(PurpleAccount *account, const char *status_id, |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
962 | gboolean active, GList *attrs) |
|
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
963 | { |
| 15884 | 964 | PurpleStatus *status; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
965 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
966 | g_return_if_fail(account != NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
967 | g_return_if_fail(status_id != NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
968 | |
| 15884 | 969 | status = purple_account_get_status(account, status_id); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
970 | if (status == NULL) |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
971 | { |
| 15884 | 972 | purple_debug_error("account", |
|
22055
95cdc03c44be
Infinitesimally better debug message
Mark Doliner <markdoliner@pidgin.im>
parents:
21961
diff
changeset
|
973 | "Invalid status ID '%s' for account %s (%s)\n", |
| 15884 | 974 | status_id, purple_account_get_username(account), |
| 975 | purple_account_get_protocol_id(account)); | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
976 | return; |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
977 | } |
|
10720
e8c25145480c
[gaim-migrate @ 12318]
Mark Doliner <markdoliner@pidgin.im>
parents:
10714
diff
changeset
|
978 | |
| 15884 | 979 | if (active || purple_status_is_independent(status)) |
| 980 | purple_status_set_active_with_attrs_list(status, active, attrs); | |
|
10862
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
981 | |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
982 | /* |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
983 | * Our current statuses are saved to accounts.xml (so that when we |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
984 | * reconnect, we go back to the previous status). |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
985 | */ |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
986 | purple_accounts_schedule_save(); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
987 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
988 | |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
989 | struct public_alias_closure |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
990 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
991 | PurpleAccount *account; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
992 | gpointer failure_cb; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
993 | }; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
994 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
995 | static gboolean |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
996 | set_public_alias_unsupported(gpointer data) |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
997 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
998 | struct public_alias_closure *closure = data; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
999 | PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1000 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1001 | failure_cb(closure->account, |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1002 | _("This protocol does not support setting a public alias.")); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1003 | g_free(closure); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1004 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1005 | return FALSE; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1006 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1007 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1008 | void |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1009 | purple_account_set_public_alias(PurpleAccount *account, |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1010 | const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1011 | PurpleSetPublicAliasFailureCallback failure_cb) |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1012 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1013 | PurpleConnection *gc; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1014 | PurplePlugin *prpl = NULL; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1015 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1016 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1017 | g_return_if_fail(account != NULL); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1018 | g_return_if_fail(purple_account_is_connected(account)); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1019 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1020 | gc = purple_account_get_connection(account); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1021 | prpl = purple_connection_get_prpl(gc); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1022 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1023 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1024 | if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, set_public_alias)) |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1025 | prpl_info->set_public_alias(gc, alias, success_cb, failure_cb); |
|
30456
feb80e82b728
Only call failure_cb if it exists for the [gs]et_public_alias functions.
Paul Aurich <darkrain42@pidgin.im>
parents:
30138
diff
changeset
|
1026 | else if (failure_cb) { |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1027 | struct public_alias_closure *closure = |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1028 | g_new0(struct public_alias_closure, 1); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1029 | closure->account = account; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1030 | closure->failure_cb = failure_cb; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1031 | purple_timeout_add(0, set_public_alias_unsupported, closure); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1032 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1033 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1034 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1035 | static gboolean |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1036 | get_public_alias_unsupported(gpointer data) |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1037 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1038 | struct public_alias_closure *closure = data; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1039 | PurpleGetPublicAliasFailureCallback failure_cb = closure->failure_cb; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1040 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1041 | failure_cb(closure->account, |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1042 | _("This protocol does not support fetching the public alias.")); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1043 | g_free(closure); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1044 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1045 | return FALSE; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1046 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1047 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1048 | void |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1049 | purple_account_get_public_alias(PurpleAccount *account, |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1050 | PurpleGetPublicAliasSuccessCallback success_cb, |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1051 | PurpleGetPublicAliasFailureCallback failure_cb) |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1052 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1053 | PurpleConnection *gc; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1054 | PurplePlugin *prpl = NULL; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1055 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1056 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1057 | g_return_if_fail(account != NULL); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1058 | g_return_if_fail(purple_account_is_connected(account)); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1059 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1060 | gc = purple_account_get_connection(account); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1061 | prpl = purple_connection_get_prpl(gc); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1062 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1063 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1064 | if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_public_alias)) |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1065 | prpl_info->get_public_alias(gc, success_cb, failure_cb); |
|
30456
feb80e82b728
Only call failure_cb if it exists for the [gs]et_public_alias functions.
Paul Aurich <darkrain42@pidgin.im>
parents:
30138
diff
changeset
|
1066 | else if (failure_cb) { |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1067 | struct public_alias_closure *closure = |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1068 | g_new0(struct public_alias_closure, 1); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1069 | closure->account = account; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1070 | closure->failure_cb = failure_cb; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1071 | purple_timeout_add(0, get_public_alias_unsupported, closure); |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1072 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1073 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1074 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1075 | gboolean |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1076 | purple_account_get_silence_suppression(const PurpleAccount *account) |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1077 | { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1078 | return purple_account_get_bool(account, "silence-suppression", FALSE); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1079 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1080 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1081 | void |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1082 | purple_account_set_silence_suppression(PurpleAccount *account, gboolean value) |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1083 | { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1084 | g_return_if_fail(account != NULL); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1085 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1086 | purple_account_set_bool(account, "silence-suppression", value); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1087 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1088 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1089 | static void |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1090 | delete_setting(void *data) |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1091 | { |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1092 | PurpleAccountSetting *setting = (PurpleAccountSetting *)data; |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1093 | |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1094 | g_free(setting->ui); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1095 | g_value_unset(&setting->value); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1096 | |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1097 | g_free(setting); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1098 | } |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1099 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1100 | void |
| 15884 | 1101 | purple_account_clear_settings(PurpleAccount *account) |
|
5694
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1102 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1103 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1104 | |
|
5694
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1105 | g_return_if_fail(account != NULL); |
|
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1106 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1107 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1108 | g_hash_table_destroy(priv->settings); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1109 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1110 | priv->settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1111 | g_free, delete_setting); |
|
5694
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1112 | } |
|
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1113 | |
|
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1114 | void |
|
27562
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1115 | purple_account_remove_setting(PurpleAccount *account, const char *setting) |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1116 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1117 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1118 | |
|
27562
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1119 | g_return_if_fail(account != NULL); |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1120 | g_return_if_fail(setting != NULL); |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1121 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1122 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1123 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1124 | g_hash_table_remove(priv->settings, setting); |
|
27562
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1125 | } |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1126 | |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1127 | void |
| 15884 | 1128 | purple_account_set_int(PurpleAccount *account, const char *name, int value) |
| 5563 | 1129 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1130 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1131 | PurpleAccountPrivate *priv; |
| 5563 | 1132 | |
| 1133 | g_return_if_fail(account != NULL); | |
| 1134 | g_return_if_fail(name != NULL); | |
| 1135 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1136 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1137 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1138 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1139 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1140 | g_value_init(&setting->value, G_TYPE_INT); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1141 | g_value_set_int(&setting->value, value); |
| 5563 | 1142 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1143 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1144 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1145 | purple_accounts_schedule_save(); |
| 5563 | 1146 | } |
| 1147 | ||
| 1148 | void | |
| 15884 | 1149 | purple_account_set_string(PurpleAccount *account, const char *name, |
| 5563 | 1150 | const char *value) |
| 1151 | { | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1152 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1153 | PurpleAccountPrivate *priv; |
| 5563 | 1154 | |
| 1155 | g_return_if_fail(account != NULL); | |
| 1156 | g_return_if_fail(name != NULL); | |
| 1157 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1158 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1159 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1160 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1161 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1162 | g_value_init(&setting->value, G_TYPE_STRING); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1163 | g_value_set_string(&setting->value, value); |
| 5563 | 1164 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1165 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1166 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1167 | purple_accounts_schedule_save(); |
| 5563 | 1168 | } |
| 1169 | ||
| 1170 | void | |
| 15884 | 1171 | purple_account_set_bool(PurpleAccount *account, const char *name, gboolean value) |
| 5563 | 1172 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1173 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1174 | PurpleAccountPrivate *priv; |
| 5563 | 1175 | |
| 1176 | g_return_if_fail(account != NULL); | |
| 1177 | g_return_if_fail(name != NULL); | |
| 1178 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1179 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1180 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1181 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1182 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1183 | g_value_init(&setting->value, G_TYPE_BOOLEAN); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1184 | g_value_set_boolean(&setting->value, value); |
| 5563 | 1185 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1186 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1187 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1188 | purple_accounts_schedule_save(); |
| 5563 | 1189 | } |
| 1190 | ||
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1191 | static GHashTable * |
| 15884 | 1192 | get_ui_settings_table(PurpleAccount *account, const char *ui) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1193 | { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1194 | GHashTable *table; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1195 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1196 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1197 | table = g_hash_table_lookup(priv->ui_settings, ui); |
|
5979
d51d697d27fb
[gaim-migrate @ 6426]
Christian Hammond <chipx86@chipx86.com>
parents:
5977
diff
changeset
|
1198 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1199 | if (table == NULL) { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1200 | table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1201 | delete_setting); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1202 | g_hash_table_insert(priv->ui_settings, g_strdup(ui), table); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1203 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1204 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1205 | return table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1206 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1207 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1208 | void |
| 15884 | 1209 | purple_account_set_ui_int(PurpleAccount *account, const char *ui, |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1210 | const char *name, int value) |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1211 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1212 | PurpleAccountSetting *setting; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1213 | GHashTable *table; |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1214 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1215 | g_return_if_fail(account != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1216 | g_return_if_fail(ui != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1217 | g_return_if_fail(name != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1218 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1219 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1220 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1221 | setting->ui = g_strdup(ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1222 | g_value_init(&setting->value, G_TYPE_INT); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1223 | g_value_set_int(&setting->value, value); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1224 | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1225 | table = get_ui_settings_table(account, ui); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1226 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1227 | g_hash_table_insert(table, g_strdup(name), setting); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1228 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1229 | purple_accounts_schedule_save(); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1230 | } |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1231 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1232 | void |
| 15884 | 1233 | purple_account_set_ui_string(PurpleAccount *account, const char *ui, |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1234 | const char *name, const char *value) |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1235 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1236 | PurpleAccountSetting *setting; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1237 | GHashTable *table; |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1238 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1239 | g_return_if_fail(account != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1240 | g_return_if_fail(ui != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1241 | g_return_if_fail(name != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1242 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1243 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1244 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1245 | setting->ui = g_strdup(ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1246 | g_value_init(&setting->value, G_TYPE_STRING); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1247 | g_value_set_string(&setting->value, value); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1248 | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1249 | table = get_ui_settings_table(account, ui); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1250 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1251 | g_hash_table_insert(table, g_strdup(name), setting); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1252 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1253 | purple_accounts_schedule_save(); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1254 | } |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1255 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1256 | void |
| 15884 | 1257 | purple_account_set_ui_bool(PurpleAccount *account, const char *ui, |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1258 | const char *name, gboolean value) |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1259 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1260 | PurpleAccountSetting *setting; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1261 | GHashTable *table; |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1262 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1263 | g_return_if_fail(account != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1264 | g_return_if_fail(ui != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1265 | g_return_if_fail(name != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1266 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1267 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1268 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1269 | setting->ui = g_strdup(ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1270 | g_value_init(&setting->value, G_TYPE_BOOLEAN); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1271 | g_value_set_boolean(&setting->value, value); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1272 | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1273 | table = get_ui_settings_table(account, ui); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1274 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1275 | g_hash_table_insert(table, g_strdup(name), setting); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1276 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1277 | purple_accounts_schedule_save(); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1278 | } |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1279 | |
| 15884 | 1280 | static PurpleConnectionState |
| 1281 | purple_account_get_state(const PurpleAccount *account) | |
| 5563 | 1282 | { |
| 15884 | 1283 | PurpleConnection *gc; |
| 1284 | ||
| 1285 | g_return_val_if_fail(account != NULL, PURPLE_DISCONNECTED); | |
| 1286 | ||
| 1287 | gc = purple_account_get_connection(account); | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1288 | if (!gc) |
| 15884 | 1289 | return PURPLE_DISCONNECTED; |
| 1290 | ||
| 1291 | return purple_connection_get_state(gc); | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1292 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1293 | |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1294 | gboolean |
| 15884 | 1295 | purple_account_is_connected(const PurpleAccount *account) |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1296 | { |
| 15884 | 1297 | return (purple_account_get_state(account) == PURPLE_CONNECTED); |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1298 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1299 | |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1300 | gboolean |
| 15884 | 1301 | purple_account_is_connecting(const PurpleAccount *account) |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1302 | { |
| 15884 | 1303 | return (purple_account_get_state(account) == PURPLE_CONNECTING); |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1304 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1305 | |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1306 | gboolean |
| 15884 | 1307 | purple_account_is_disconnected(const PurpleAccount *account) |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1308 | { |
| 15884 | 1309 | return (purple_account_get_state(account) == PURPLE_DISCONNECTED); |
| 5563 | 1310 | } |
| 1311 | ||
| 1312 | const char * | |
| 15884 | 1313 | purple_account_get_username(const PurpleAccount *account) |
| 5563 | 1314 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1315 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1316 | |
| 5563 | 1317 | g_return_val_if_fail(account != NULL, NULL); |
| 1318 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1319 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1320 | return priv->username; |
| 5563 | 1321 | } |
| 1322 | ||
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1323 | static void |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1324 | purple_account_get_password_got(PurpleAccount *account, |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
1325 | const gchar *password, GError *error, gpointer data) |
| 5563 | 1326 | { |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1327 | PurpleCallbackBundle *cbb = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1328 | PurpleKeyringReadCallback cb; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1329 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1330 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1331 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1332 | "Read password for account %s from async keyring.\n", |
|
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1333 | purple_account_get_username(account)); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1334 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1335 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1336 | priv->password = g_strdup(password); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1337 | |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1338 | cb = (PurpleKeyringReadCallback)cbb->cb; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1339 | if (cb != NULL) |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1340 | cb(account, password, error, cbb->data); |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1341 | |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1342 | g_free(cbb); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1343 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1344 | |
|
34028
a3050b6df38e
Remove deprecated API since we're targeting 3.0.0 here. Don't mind the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34023
diff
changeset
|
1345 | void |
|
a3050b6df38e
Remove deprecated API since we're targeting 3.0.0 here. Don't mind the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34023
diff
changeset
|
1346 | purple_account_get_password(PurpleAccount *account, |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
1347 | PurpleKeyringReadCallback cb, gpointer data) |
| 5563 | 1348 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1349 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1350 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1351 | if (account == NULL) { |
|
33997
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
1352 | cb(NULL, NULL, NULL, data); |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
1353 | return; |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
1354 | } |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
1355 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1356 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1357 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1358 | if (priv->password != NULL) { |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1359 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1360 | "Reading password for account %s from cache.\n", |
|
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1361 | purple_account_get_username(account)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1362 | cb(account, priv->password, NULL, data); |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
1363 | } else { |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1364 | PurpleCallbackBundle *cbb = g_new0(PurpleCallbackBundle, 1); |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1365 | cbb->cb = PURPLE_CALLBACK(cb); |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1366 | cbb->data = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1367 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1368 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1369 | "Reading password for account %s from async keyring.\n", |
|
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1370 | purple_account_get_username(account)); |
|
34028
a3050b6df38e
Remove deprecated API since we're targeting 3.0.0 here. Don't mind the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34023
diff
changeset
|
1371 | purple_keyring_get_password(account, |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1372 | purple_account_get_password_got, cbb); |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
1373 | } |
| 5563 | 1374 | } |
| 1375 | ||
| 1376 | const char * | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
1377 | purple_account_get_private_alias(const PurpleAccount *account) |
| 5563 | 1378 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1379 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1380 | |
| 5563 | 1381 | g_return_val_if_fail(account != NULL, NULL); |
| 1382 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1383 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1384 | return priv->alias; |
| 5563 | 1385 | } |
| 1386 | ||
| 1387 | const char * | |
| 15884 | 1388 | purple_account_get_user_info(const PurpleAccount *account) |
| 5563 | 1389 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1390 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1391 | |
| 5563 | 1392 | g_return_val_if_fail(account != NULL, NULL); |
| 1393 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1394 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1395 | return priv->user_info; |
| 5563 | 1396 | } |
| 1397 | ||
| 1398 | const char * | |
| 15884 | 1399 | purple_account_get_buddy_icon_path(const PurpleAccount *account) |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1400 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1401 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1402 | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1403 | g_return_val_if_fail(account != NULL, NULL); |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1404 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1405 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1406 | return priv->buddy_icon_path; |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1407 | } |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1408 | |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1409 | const char * |
| 15884 | 1410 | purple_account_get_protocol_id(const PurpleAccount *account) |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1411 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1412 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1413 | |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1414 | g_return_val_if_fail(account != NULL, NULL); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1415 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1416 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1417 | return priv->protocol_id; |
| 5563 | 1418 | } |
| 1419 | ||
|
9699
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1420 | const char * |
| 15884 | 1421 | purple_account_get_protocol_name(const PurpleAccount *account) |
|
9699
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1422 | { |
| 15884 | 1423 | PurplePlugin *p; |
|
9720
02c64e22341e
[gaim-migrate @ 10581]
Mark Doliner <markdoliner@pidgin.im>
parents:
9699
diff
changeset
|
1424 | |
|
9699
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1425 | g_return_val_if_fail(account != NULL, NULL); |
|
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1426 | |
| 15884 | 1427 | p = purple_find_prpl(purple_account_get_protocol_id(account)); |
| 9988 | 1428 | |
| 1429 | return ((p && p->info->name) ? _(p->info->name) : _("Unknown")); | |
| 1430 | } | |
| 1431 | ||
| 15884 | 1432 | PurpleConnection * |
| 1433 | purple_account_get_connection(const PurpleAccount *account) | |
| 5563 | 1434 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1435 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1436 | |
| 5563 | 1437 | g_return_val_if_fail(account != NULL, NULL); |
| 1438 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1439 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1440 | return priv->gc; |
| 5563 | 1441 | } |
| 1442 | ||
|
29515
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1443 | const gchar * |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1444 | purple_account_get_name_for_display(const PurpleAccount *account) |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1445 | { |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1446 | PurpleBuddy *self = NULL; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1447 | PurpleConnection *gc = NULL; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1448 | const gchar *name = NULL, *username = NULL, *displayname = NULL; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1449 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
1450 | name = purple_account_get_private_alias(account); |
|
29515
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1451 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1452 | if (name) { |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1453 | return name; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1454 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1455 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1456 | username = purple_account_get_username(account); |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1457 | self = purple_find_buddy((PurpleAccount *)account, username); |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1458 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1459 | if (self) { |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1460 | const gchar *calias= purple_buddy_get_contact_alias(self); |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1461 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1462 | /* We don't want to return the buddy name if the buddy/contact |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1463 | * doesn't have an alias set. */ |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1464 | if (!purple_strequal(username, calias)) { |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1465 | return calias; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1466 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1467 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1468 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1469 | gc = purple_account_get_connection(account); |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1470 | displayname = purple_connection_get_display_name(gc); |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1471 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1472 | if (displayname) { |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1473 | return displayname; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1474 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1475 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1476 | return username; |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1477 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1478 | |
| 5563 | 1479 | gboolean |
| 15884 | 1480 | purple_account_get_remember_password(const PurpleAccount *account) |
| 5563 | 1481 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1482 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1483 | |
| 5563 | 1484 | g_return_val_if_fail(account != NULL, FALSE); |
| 1485 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1486 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1487 | return priv->remember_pass; |
| 5563 | 1488 | } |
| 1489 | ||
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1490 | gboolean |
| 15884 | 1491 | purple_account_get_check_mail(const PurpleAccount *account) |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1492 | { |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1493 | g_return_val_if_fail(account != NULL, FALSE); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1494 | |
| 15884 | 1495 | return purple_account_get_bool(account, "check-mail", FALSE); |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1496 | } |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1497 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1498 | gboolean |
| 15884 | 1499 | purple_account_get_enabled(const PurpleAccount *account, const char *ui) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1500 | { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1501 | g_return_val_if_fail(account != NULL, FALSE); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1502 | g_return_val_if_fail(ui != NULL, FALSE); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1503 | |
| 15884 | 1504 | return purple_account_get_ui_bool(account, ui, "auto-login", FALSE); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1505 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1506 | |
| 15884 | 1507 | PurpleProxyInfo * |
| 1508 | purple_account_get_proxy_info(const PurpleAccount *account) | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1509 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1510 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1511 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1512 | g_return_val_if_fail(account != NULL, NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1513 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1514 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1515 | return priv->proxy_info; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1516 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1517 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1518 | PurpleAccountPrivacyType |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1519 | purple_account_get_privacy_type(const PurpleAccount *account) |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1520 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1521 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1522 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1523 | g_return_val_if_fail(account != NULL, PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL); |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1524 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1525 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34590
9da48e98a77a
Renamed PurpleAccount's private member perm_deny to privacy_type
Ankit Vani <a@nevitus.org>
parents:
34589
diff
changeset
|
1526 | return priv->privacy_type; |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1527 | } |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1528 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1529 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1530 | purple_account_privacy_permit_add(PurpleAccount *account, const char *who, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1531 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1532 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1533 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1534 | char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1535 | PurpleBuddy *buddy; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1536 | PurpleBlistUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1537 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1538 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1539 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1540 | g_return_val_if_fail(account != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1541 | g_return_val_if_fail(who != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1542 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1543 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1544 | name = g_strdup(purple_normalize(account, who)); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1545 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1546 | for (l = priv->permit; l != NULL; l = l->next) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1547 | if (g_str_equal(name, l->data)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1548 | /* This buddy already exists */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1549 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1550 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1551 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1552 | if (l != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1553 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1554 | /* This buddy already exists, so bail out */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1555 | g_free(name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1556 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1557 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1558 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1559 | priv->permit = g_slist_append(priv->permit, name); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1560 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1561 | if (!local_only && purple_account_is_connected(account)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1562 | serv_add_permit(purple_account_get_connection(account), who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1563 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1564 | if (ui_ops != NULL && ui_ops->permit_added != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1565 | ui_ops->permit_added(account, who); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1566 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1567 | blist_ops = purple_blist_get_ui_ops(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1568 | if (blist_ops != NULL && blist_ops->save_account != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1569 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1570 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1571 | /* This lets the UI know a buddy has had its privacy setting changed */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1572 | buddy = purple_find_buddy(account, name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1573 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1574 | purple_signal_emit(purple_blist_get_handle(), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1575 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1576 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1577 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1578 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1579 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1580 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1581 | purple_account_privacy_permit_remove(PurpleAccount *account, const char *who, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1582 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1583 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1584 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1585 | const char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1586 | PurpleBuddy *buddy; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1587 | char *del; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1588 | PurpleBlistUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1589 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1590 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1591 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1592 | g_return_val_if_fail(account != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1593 | g_return_val_if_fail(who != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1594 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1595 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1596 | name = purple_normalize(account, who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1597 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1598 | for (l = priv->permit; l != NULL; l = l->next) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1599 | if (g_str_equal(name, l->data)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1600 | /* We found the buddy we were looking for */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1601 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1602 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1603 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1604 | if (l == NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1605 | /* We didn't find the buddy we were looking for, so bail out */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1606 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1607 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1608 | /* We should not free l->data just yet. There can be occasions where |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1609 | * l->data == who. In such cases, freeing l->data here can cause crashes |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1610 | * later when who is used. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1611 | del = l->data; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1612 | priv->permit = g_slist_delete_link(priv->permit, l); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1613 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1614 | if (!local_only && purple_account_is_connected(account)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1615 | serv_rem_permit(purple_account_get_connection(account), who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1616 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1617 | if (ui_ops != NULL && ui_ops->permit_removed != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1618 | ui_ops->permit_removed(account, who); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1619 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1620 | blist_ops = purple_blist_get_ui_ops(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1621 | if (blist_ops != NULL && blist_ops->save_account != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1622 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1623 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1624 | buddy = purple_find_buddy(account, name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1625 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1626 | purple_signal_emit(purple_blist_get_handle(), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1627 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1628 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1629 | g_free(del); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1630 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1631 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1632 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1633 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1634 | purple_account_privacy_deny_add(PurpleAccount *account, const char *who, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1635 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1636 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1637 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1638 | char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1639 | PurpleBuddy *buddy; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1640 | PurpleBlistUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1641 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1642 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1643 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1644 | g_return_val_if_fail(account != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1645 | g_return_val_if_fail(who != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1646 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1647 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1648 | name = g_strdup(purple_normalize(account, who)); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1649 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1650 | for (l = priv->deny; l != NULL; l = l->next) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1651 | if (g_str_equal(name, l->data)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1652 | /* This buddy already exists */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1653 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1654 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1655 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1656 | if (l != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1657 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1658 | /* This buddy already exists, so bail out */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1659 | g_free(name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1660 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1661 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1662 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1663 | priv->deny = g_slist_append(priv->deny, name); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1664 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1665 | if (!local_only && purple_account_is_connected(account)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1666 | serv_add_deny(purple_account_get_connection(account), who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1667 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1668 | if (ui_ops != NULL && ui_ops->deny_added != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1669 | ui_ops->deny_added(account, who); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1670 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1671 | blist_ops = purple_blist_get_ui_ops(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1672 | if (blist_ops != NULL && blist_ops->save_account != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1673 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1674 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1675 | buddy = purple_find_buddy(account, name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1676 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1677 | purple_signal_emit(purple_blist_get_handle(), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1678 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1679 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1680 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1681 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1682 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1683 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1684 | purple_account_privacy_deny_remove(PurpleAccount *account, const char *who, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1685 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1686 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1687 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1688 | const char *normalized; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1689 | char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1690 | PurpleBuddy *buddy; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1691 | PurpleBlistUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1692 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1693 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1694 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1695 | g_return_val_if_fail(account != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1696 | g_return_val_if_fail(who != NULL, FALSE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1697 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1698 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1699 | normalized = purple_normalize(account, who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1700 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1701 | for (l = priv->deny; l != NULL; l = l->next) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1702 | if (g_str_equal(normalized, l->data)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1703 | /* We found the buddy we were looking for */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1704 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1705 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1706 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1707 | if (l == NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1708 | /* We didn't find the buddy we were looking for, so bail out */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1709 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1710 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1711 | buddy = purple_find_buddy(account, normalized); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1712 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1713 | name = l->data; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1714 | priv->deny = g_slist_delete_link(priv->deny, l); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1715 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1716 | if (!local_only && purple_account_is_connected(account)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1717 | serv_rem_deny(purple_account_get_connection(account), name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1718 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1719 | if (ui_ops != NULL && ui_ops->deny_removed != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1720 | ui_ops->deny_removed(account, who); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1721 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1722 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1723 | purple_signal_emit(purple_blist_get_handle(), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1724 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1725 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1726 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1727 | g_free(name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1728 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1729 | blist_ops = purple_blist_get_ui_ops(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1730 | if (blist_ops != NULL && blist_ops->save_account != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1731 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1732 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1733 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1734 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1735 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1736 | /** |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1737 | * This makes sure your permit list contains all buddies from your |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1738 | * buddy list and ONLY buddies from your buddy list. |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1739 | */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1740 | static void |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1741 | add_all_buddies_to_permit_list(PurpleAccount *account, gboolean local) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1742 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1743 | GSList *list; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1744 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1745 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1746 | /* Remove anyone in the permit list who is not in the buddylist */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1747 | for (list = priv->permit; list != NULL; ) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1748 | char *person = list->data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1749 | list = list->next; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1750 | if (!purple_find_buddy(account, person)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1751 | purple_account_privacy_permit_remove(account, person, local); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1752 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1753 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1754 | /* Now make sure everyone in the buddylist is in the permit list */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1755 | list = purple_find_buddies(account, NULL); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1756 | while (list != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1757 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1758 | PurpleBuddy *buddy = list->data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1759 | const gchar *name = purple_buddy_get_name(buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1760 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1761 | if (!g_slist_find_custom(priv->permit, name, (GCompareFunc)g_utf8_collate)) |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1762 | purple_account_privacy_permit_add(account, name, local); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1763 | list = g_slist_delete_link(list, list); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1764 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1765 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1766 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1767 | void |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1768 | purple_account_privacy_allow(PurpleAccount *account, const char *who) |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1769 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1770 | GSList *list; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1771 | PurpleAccountPrivacyType type = purple_account_get_privacy_type(account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1772 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1773 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1774 | switch (type) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1775 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1776 | return; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1777 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS: |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1778 | purple_account_privacy_permit_add(account, who, FALSE); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1779 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1780 | case PURPLE_ACCOUNT_PRIVACY_DENY_USERS: |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1781 | purple_account_privacy_deny_remove(account, who, FALSE); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1782 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1783 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1784 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1785 | /* Empty the allow-list. */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1786 | const char *norm = purple_normalize(account, who); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1787 | for (list = priv->permit; list != NULL;) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1788 | char *person = list->data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1789 | list = list->next; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1790 | if (!purple_strequal(norm, person)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1791 | purple_account_privacy_permit_remove(account, person, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1792 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1793 | purple_account_privacy_permit_add(account, who, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1794 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1795 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1796 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1797 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1798 | if (!purple_find_buddy(account, who)) { |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1799 | add_all_buddies_to_permit_list(account, FALSE); |
|
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1800 | purple_account_privacy_permit_add(account, who, FALSE); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1801 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1802 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1803 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1804 | default: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1805 | g_return_if_reached(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1806 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1807 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1808 | /* Notify the server if the privacy setting was changed */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1809 | if (type != purple_account_get_privacy_type(account) && purple_account_is_connected(account)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1810 | serv_set_permit_deny(purple_account_get_connection(account)); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1811 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1812 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1813 | void |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1814 | purple_account_privacy_deny(PurpleAccount *account, const char *who) |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1815 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1816 | GSList *list; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1817 | PurpleAccountPrivacyType type = purple_account_get_privacy_type(account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1818 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1819 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1820 | switch (type) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1821 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1822 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1823 | /* Empty the deny-list. */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1824 | const char *norm = purple_normalize(account, who); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1825 | for (list = priv->deny; list != NULL; ) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1826 | char *person = list->data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1827 | list = list->next; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1828 | if (!purple_strequal(norm, person)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1829 | purple_account_privacy_deny_remove(account, person, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1830 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1831 | purple_account_privacy_deny_add(account, who, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1832 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_DENY_USERS); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1833 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1834 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1835 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS: |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1836 | purple_account_privacy_permit_remove(account, who, FALSE); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1837 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1838 | case PURPLE_ACCOUNT_PRIVACY_DENY_USERS: |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1839 | purple_account_privacy_deny_add(account, who, FALSE); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1840 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1841 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1842 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1843 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1844 | if (purple_find_buddy(account, who)) { |
|
34576
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1845 | add_all_buddies_to_permit_list(account, FALSE); |
|
216613e5e368
Removed local and restore arguments to purple_account_privacy_[allow,deny]() as all calls to this function pass them as FALSE. purple_account_privacy_[permit,deny]_[add,remove] can be used to make local privacy changes.
Ankit Vani <a@nevitus.org>
parents:
34574
diff
changeset
|
1846 | purple_account_privacy_permit_remove(account, who, FALSE); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1847 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1848 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1849 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1850 | default: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1851 | g_return_if_reached(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1852 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1853 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1854 | /* Notify the server if the privacy setting was changed */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1855 | if (type != purple_account_get_privacy_type(account) && purple_account_is_connected(account)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1856 | serv_set_permit_deny(purple_account_get_connection(account)); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1857 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1858 | |
|
34577
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1859 | GSList * |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1860 | purple_account_privacy_get_permitted(PurpleAccount *account) |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1861 | { |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1862 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1863 | g_return_val_if_fail(priv != NULL, NULL); |
|
34577
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1864 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1865 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1866 | |
|
34577
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1867 | return priv->permit; |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1868 | } |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1869 | |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1870 | GSList * |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1871 | purple_account_privacy_get_denied(PurpleAccount *account) |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1872 | { |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1873 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1874 | g_return_val_if_fail(priv != NULL, NULL); |
|
34577
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1875 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1876 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1877 | |
|
34577
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1878 | return priv->deny; |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1879 | } |
|
cd4e77521c9c
Added purple_account_privacy_get_[permitted,denied] functions to return the permit and deny lists
Ankit Vani <a@nevitus.org>
parents:
34576
diff
changeset
|
1880 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1881 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1882 | purple_account_privacy_check(PurpleAccount *account, const char *who) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1883 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1884 | GSList *list; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1885 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1886 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1887 | switch (purple_account_get_privacy_type(account)) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1888 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1889 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1890 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1891 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1892 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1893 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1894 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1895 | who = purple_normalize(account, who); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1896 | for (list=priv->permit; list!=NULL; list=list->next) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1897 | if (g_str_equal(who, list->data)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1898 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1899 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1900 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1901 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1902 | case PURPLE_ACCOUNT_PRIVACY_DENY_USERS: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1903 | who = purple_normalize(account, who); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1904 | for (list=priv->deny; list!=NULL; list=list->next) { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1905 | if (g_str_equal(who, list->data)) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1906 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1907 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1908 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1909 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1910 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1911 | return (purple_find_buddy(account, who) != NULL); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1912 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1913 | default: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1914 | g_return_val_if_reached(TRUE); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1915 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1916 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1917 | |
| 15884 | 1918 | PurpleStatus * |
| 1919 | purple_account_get_active_status(const PurpleAccount *account) | |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1920 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1921 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1922 | |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1923 | g_return_val_if_fail(account != NULL, NULL); |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1924 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1925 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1926 | return purple_presence_get_active_status(priv->presence); |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1927 | } |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1928 | |
| 15884 | 1929 | PurpleStatus * |
| 1930 | purple_account_get_status(const PurpleAccount *account, const char *status_id) | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1931 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1932 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1933 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1934 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1935 | g_return_val_if_fail(status_id != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1936 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1937 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1938 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1939 | return purple_presence_get_status(priv->presence, status_id); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1940 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1941 | |
| 15884 | 1942 | PurpleStatusType * |
| 1943 | purple_account_get_status_type(const PurpleAccount *account, const char *id) | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1944 | { |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
1945 | GList *l; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1946 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1947 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1948 | g_return_val_if_fail(id != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1949 | |
| 15884 | 1950 | for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1951 | { |
| 15884 | 1952 | PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
| 1953 | ||
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
25140
diff
changeset
|
1954 | if (purple_strequal(purple_status_type_get_id(status_type), id)) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1955 | return status_type; |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1956 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1957 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1958 | return NULL; |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1959 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1960 | |
| 15884 | 1961 | PurpleStatusType * |
| 1962 | purple_account_get_status_type_with_primitive(const PurpleAccount *account, PurpleStatusPrimitive primitive) | |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1963 | { |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
1964 | GList *l; |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1965 | |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1966 | g_return_val_if_fail(account != NULL, NULL); |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1967 | |
| 15884 | 1968 | for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1969 | { |
| 15884 | 1970 | PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
| 1971 | ||
| 1972 | if (purple_status_type_get_primitive(status_type) == primitive) | |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1973 | return status_type; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1974 | } |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1975 | |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1976 | return NULL; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1977 | } |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1978 | |
| 15884 | 1979 | PurplePresence * |
| 1980 | purple_account_get_presence(const PurpleAccount *account) | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1981 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1982 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1983 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1984 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1985 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1986 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1987 | return priv->presence; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1988 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1989 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1990 | gboolean |
| 15884 | 1991 | purple_account_is_status_active(const PurpleAccount *account, |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1992 | const char *status_id) |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1993 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1994 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1995 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1996 | g_return_val_if_fail(account != NULL, FALSE); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1997 | g_return_val_if_fail(status_id != NULL, FALSE); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1998 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1999 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2000 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2001 | return purple_presence_is_status_active(priv->presence, status_id); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2002 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2003 | |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
2004 | GList * |
| 15884 | 2005 | purple_account_get_status_types(const PurpleAccount *account) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2006 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2007 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2008 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2009 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2010 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2011 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2012 | return priv->status_types; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2013 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2014 | |
| 5563 | 2015 | int |
| 15884 | 2016 | purple_account_get_int(const PurpleAccount *account, const char *name, |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2017 | int default_value) |
| 5563 | 2018 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2019 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2020 | PurpleAccountPrivate *priv; |
| 5563 | 2021 | |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2022 | g_return_val_if_fail(account != NULL, default_value); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2023 | g_return_val_if_fail(name != NULL, default_value); |
| 5563 | 2024 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2025 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2026 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2027 | setting = g_hash_table_lookup(priv->settings, name); |
| 5563 | 2028 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2029 | if (setting == NULL) |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2030 | return default_value; |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2031 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2032 | g_return_val_if_fail(G_VALUE_HOLDS_INT(&setting->value), default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2033 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2034 | return g_value_get_int(&setting->value); |
| 5563 | 2035 | } |
| 2036 | ||
| 2037 | const char * | |
| 15884 | 2038 | purple_account_get_string(const PurpleAccount *account, const char *name, |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2039 | const char *default_value) |
| 5563 | 2040 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2041 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2042 | PurpleAccountPrivate *priv; |
| 5563 | 2043 | |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2044 | g_return_val_if_fail(account != NULL, default_value); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2045 | g_return_val_if_fail(name != NULL, default_value); |
| 5563 | 2046 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2047 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2048 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2049 | setting = g_hash_table_lookup(priv->settings, name); |
| 5563 | 2050 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2051 | if (setting == NULL) |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2052 | return default_value; |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2053 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2054 | g_return_val_if_fail(G_VALUE_HOLDS_STRING(&setting->value), default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2055 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2056 | return g_value_get_string(&setting->value); |
| 5563 | 2057 | } |
| 2058 | ||
| 2059 | gboolean | |
| 15884 | 2060 | purple_account_get_bool(const PurpleAccount *account, const char *name, |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2061 | gboolean default_value) |
| 5563 | 2062 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2063 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2064 | PurpleAccountPrivate *priv; |
| 5563 | 2065 | |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2066 | g_return_val_if_fail(account != NULL, default_value); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2067 | g_return_val_if_fail(name != NULL, default_value); |
| 5563 | 2068 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2069 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2070 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2071 | setting = g_hash_table_lookup(priv->settings, name); |
| 5563 | 2072 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2073 | if (setting == NULL) |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2074 | return default_value; |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2075 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2076 | g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&setting->value), default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2077 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2078 | return g_value_get_boolean(&setting->value); |
| 5563 | 2079 | } |
| 2080 | ||
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2081 | int |
| 15884 | 2082 | purple_account_get_ui_int(const PurpleAccount *account, const char *ui, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2083 | const char *name, int default_value) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2084 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2085 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2086 | PurpleAccountPrivate *priv; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2087 | GHashTable *table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2088 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2089 | g_return_val_if_fail(account != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2090 | g_return_val_if_fail(ui != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2091 | g_return_val_if_fail(name != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2092 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2093 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2094 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2095 | if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2096 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2097 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2098 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2099 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2100 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2101 | g_return_val_if_fail(G_VALUE_HOLDS_INT(&setting->value), default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2102 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2103 | return g_value_get_int(&setting->value); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2104 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2105 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2106 | const char * |
| 15884 | 2107 | purple_account_get_ui_string(const PurpleAccount *account, const char *ui, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2108 | const char *name, const char *default_value) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2109 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2110 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2111 | PurpleAccountPrivate *priv; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2112 | GHashTable *table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2113 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2114 | g_return_val_if_fail(account != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2115 | g_return_val_if_fail(ui != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2116 | g_return_val_if_fail(name != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2117 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2118 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2119 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2120 | if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2121 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2122 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2123 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2124 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2125 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2126 | g_return_val_if_fail(G_VALUE_HOLDS_STRING(&setting->value), default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2127 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2128 | return g_value_get_string(&setting->value); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2129 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2130 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2131 | gboolean |
| 15884 | 2132 | purple_account_get_ui_bool(const PurpleAccount *account, const char *ui, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2133 | const char *name, gboolean default_value) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2134 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2135 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2136 | PurpleAccountPrivate *priv; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2137 | GHashTable *table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2138 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2139 | g_return_val_if_fail(account != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2140 | g_return_val_if_fail(ui != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2141 | g_return_val_if_fail(name != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2142 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2143 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2144 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2145 | if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2146 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2147 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2148 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2149 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2150 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2151 | g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&setting->value), default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2152 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2153 | return g_value_get_boolean(&setting->value); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2154 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2155 | |
| 15884 | 2156 | PurpleLog * |
| 2157 | purple_account_get_log(PurpleAccount *account, gboolean create) | |
| 8573 | 2158 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2159 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2160 | |
| 8573 | 2161 | g_return_val_if_fail(account != NULL, NULL); |
| 2162 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2163 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2164 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2165 | if(!priv->system_log && create){ |
| 15884 | 2166 | PurplePresence *presence; |
|
11973
42a29ebcf30b
[gaim-migrate @ 14266]
Mark Doliner <markdoliner@pidgin.im>
parents:
11920
diff
changeset
|
2167 | int login_time; |
|
42a29ebcf30b
[gaim-migrate @ 14266]
Mark Doliner <markdoliner@pidgin.im>
parents:
11920
diff
changeset
|
2168 | |
| 15884 | 2169 | presence = purple_account_get_presence(account); |
| 2170 | login_time = purple_presence_get_login_time(presence); | |
| 2171 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2172 | priv->system_log = purple_log_new(PURPLE_LOG_SYSTEM, |
| 15884 | 2173 | purple_account_get_username(account), account, NULL, |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
12975
diff
changeset
|
2174 | (login_time != 0) ? login_time : time(NULL), NULL); |
| 8573 | 2175 | } |
| 2176 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2177 | return priv->system_log; |
| 8573 | 2178 | } |
| 2179 | ||
| 2180 | void | |
| 15884 | 2181 | purple_account_destroy_log(PurpleAccount *account) |
| 8573 | 2182 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2183 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2184 | |
| 8573 | 2185 | g_return_if_fail(account != NULL); |
| 2186 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2187 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2188 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2189 | if(priv->system_log){ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2190 | purple_log_free(priv->system_log); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2191 | priv->system_log = NULL; |
| 8573 | 2192 | } |
| 2193 | } | |
| 2194 | ||
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
2195 | void |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2196 | purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy, const char *message) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2197 | { |
| 15884 | 2198 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
28392
4f4042de6782
Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.
Paul Aurich <darkrain42@pidgin.im>
parents:
28373
diff
changeset
|
2199 | PurpleConnection *gc; |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2200 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2201 | |
|
28392
4f4042de6782
Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.
Paul Aurich <darkrain42@pidgin.im>
parents:
28373
diff
changeset
|
2202 | g_return_if_fail(account != NULL); |
|
4f4042de6782
Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.
Paul Aurich <darkrain42@pidgin.im>
parents:
28373
diff
changeset
|
2203 | g_return_if_fail(buddy != NULL); |
|
4f4042de6782
Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.
Paul Aurich <darkrain42@pidgin.im>
parents:
28373
diff
changeset
|
2204 | |
|
4f4042de6782
Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.
Paul Aurich <darkrain42@pidgin.im>
parents:
28373
diff
changeset
|
2205 | gc = purple_account_get_connection(account); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2206 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2207 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2208 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2209 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2210 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2211 | |
|
31594
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2212 | if (prpl_info != NULL) { |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2213 | if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, add_buddy)) |
|
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2214 | prpl_info->add_buddy(gc, buddy, purple_buddy_get_group(buddy), message); |
|
31594
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2215 | } |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2216 | } |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2217 | |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2218 | void |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2219 | purple_account_add_buddies(PurpleAccount *account, GList *buddies, const char *message) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2220 | { |
| 15884 | 2221 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2222 | PurpleConnection *gc = purple_account_get_connection(account); | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2223 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2224 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2225 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2226 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2227 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2228 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2229 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2230 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2231 | if (prpl_info) { |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2232 | GList *cur, *groups = NULL; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2233 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2234 | /* Make a list of what group each buddy is in */ |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2235 | for (cur = buddies; cur != NULL; cur = cur->next) { |
|
24957
647853a842da
A couple of minor fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24955
diff
changeset
|
2236 | PurpleBuddy *buddy = cur->data; |
|
647853a842da
A couple of minor fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24955
diff
changeset
|
2237 | groups = g_list_append(groups, purple_buddy_get_group(buddy)); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2238 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2239 | |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2240 | if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, add_buddies)) |
|
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2241 | prpl_info->add_buddies(gc, buddies, groups, message); |
|
31594
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2242 | else if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, add_buddy)) { |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2243 | GList *curb = buddies, *curg = groups; |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2244 | |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2245 | while ((curb != NULL) && (curg != NULL)) { |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2246 | prpl_info->add_buddy(gc, curb->data, curg->data, message); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2247 | curb = curb->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2248 | curg = curg->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2249 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2250 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2251 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2252 | g_list_free(groups); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2253 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2254 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2255 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2256 | void |
| 15884 | 2257 | purple_account_remove_buddy(PurpleAccount *account, PurpleBuddy *buddy, |
| 2258 | PurpleGroup *group) | |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2259 | { |
| 15884 | 2260 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2261 | PurpleConnection *gc = purple_account_get_connection(account); | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2262 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2263 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2264 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2265 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2266 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2267 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2268 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2269 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2270 | if (prpl_info && prpl_info->remove_buddy) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2271 | prpl_info->remove_buddy(gc, buddy, group); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2272 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2273 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2274 | void |
| 15884 | 2275 | purple_account_remove_buddies(PurpleAccount *account, GList *buddies, GList *groups) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2276 | { |
| 15884 | 2277 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2278 | PurpleConnection *gc = purple_account_get_connection(account); | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2279 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2280 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2281 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2282 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2283 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2284 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2285 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2286 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2287 | if (prpl_info) { |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2288 | if (prpl_info->remove_buddies) |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2289 | prpl_info->remove_buddies(gc, buddies, groups); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2290 | else { |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2291 | GList *curb = buddies; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2292 | GList *curg = groups; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2293 | while ((curb != NULL) && (curg != NULL)) { |
| 15884 | 2294 | purple_account_remove_buddy(account, curb->data, curg->data); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2295 | curb = curb->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2296 | curg = curg->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2297 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2298 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2299 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2300 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2301 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2302 | void |
| 15884 | 2303 | purple_account_remove_group(PurpleAccount *account, PurpleGroup *group) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2304 | { |
| 15884 | 2305 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2306 | PurpleConnection *gc = purple_account_get_connection(account); | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2307 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2308 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2309 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2310 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2311 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2312 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2313 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2314 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2315 | if (prpl_info && prpl_info->remove_group) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2316 | prpl_info->remove_group(gc, group); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2317 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2318 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2319 | void |
| 15884 | 2320 | purple_account_change_password(PurpleAccount *account, const char *orig_pw, |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2321 | const char *new_pw) |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2322 | { |
| 15884 | 2323 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2324 | PurpleConnection *gc = purple_account_get_connection(account); | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2325 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2326 | |
|
34029
059c1270db1f
Remove the silly destroy argument from purple_account_set_password and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34028
diff
changeset
|
2327 | purple_account_set_password(account, new_pw, NULL, NULL); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2328 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2329 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2330 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2331 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2332 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2333 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2334 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2335 | if (prpl_info && prpl_info->change_passwd) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2336 | prpl_info->change_passwd(gc, orig_pw, new_pw); |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
2337 | } |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2338 | |
| 15884 | 2339 | gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy) |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2340 | { |
| 15884 | 2341 | PurpleConnection *gc; |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2342 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2343 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2344 | |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2345 | g_return_val_if_fail(account, FALSE); |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2346 | g_return_val_if_fail(buddy, FALSE); |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2347 | |
| 15884 | 2348 | gc = purple_account_get_connection(account); |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2349 | if (gc == NULL) |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2350 | return FALSE; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2351 | |
|
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2352 | prpl = purple_connection_get_prpl(gc); |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2353 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2354 | if (prpl != NULL) |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2355 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2356 | |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2357 | if (!prpl_info || !prpl_info->offline_message) |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2358 | return FALSE; |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2359 | return prpl_info->offline_message(buddy); |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2360 | } |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2361 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2362 | void |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2363 | purple_account_set_current_error(PurpleAccount *account, |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2364 | PurpleConnectionErrorInfo *new_err) |
|
21312
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2365 | { |
|
22469
b8c7242bd6a2
I'm going to pretend this solves all my problems, except I can't see how
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22357
diff
changeset
|
2366 | PurpleConnectionErrorInfo *old_err; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2367 | PurpleAccountPrivate *priv; |
|
22469
b8c7242bd6a2
I'm going to pretend this solves all my problems, except I can't see how
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22357
diff
changeset
|
2368 | |
|
b8c7242bd6a2
I'm going to pretend this solves all my problems, except I can't see how
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22357
diff
changeset
|
2369 | g_return_if_fail(account != NULL); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2370 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2371 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2372 | old_err = priv->current_error; |
|
21312
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2373 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2374 | if(new_err == old_err) |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2375 | return; |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2376 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2377 | priv->current_error = new_err; |
|
21312
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2378 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2379 | purple_signal_emit(purple_accounts_get_handle(), |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2380 | "account-error-changed", |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2381 | account, old_err, new_err); |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2382 | purple_accounts_schedule_save(); |
|
21312
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2383 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2384 | if(old_err) |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2385 | g_free(old_err->description); |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2386 | |
|
22467
151133154190
Register and unregister the PurpleConnectionErrorInfo pointers with dbus, I
Etan Reisner <deryni@pidgin.im>
parents:
22357
diff
changeset
|
2387 | PURPLE_DBUS_UNREGISTER_POINTER(old_err); |
|
21312
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2388 | g_free(old_err); |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2389 | } |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2390 | |
|
21298
d0d9cfaf3fe7
Mark pointed out that PurpleConnectionErrorPair is not a very good name for the
Will Thompson <resiak@pidgin.im>
parents:
21295
diff
changeset
|
2391 | const PurpleConnectionErrorInfo * |
|
21287
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
2392 | purple_account_get_current_error(PurpleAccount *account) |
|
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
2393 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2394 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2395 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2396 | return priv->current_error; |
|
21287
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
2397 | } |
|
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
2398 | |
|
21504
0c78851f576b
Propagating ipp to im.pidgin.cpw.resiak.disconnectreason caused
Will Thompson <resiak@pidgin.im>
parents:
21503
diff
changeset
|
2399 | void |
|
0c78851f576b
Propagating ipp to im.pidgin.cpw.resiak.disconnectreason caused
Will Thompson <resiak@pidgin.im>
parents:
21503
diff
changeset
|
2400 | purple_account_clear_current_error(PurpleAccount *account) |
|
21311
bca57f8144a1
Add purple_account_clear_current_error(), which does what it says on the tin.
Will Thompson <resiak@pidgin.im>
parents:
21300
diff
changeset
|
2401 | { |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2402 | purple_account_set_current_error(account, NULL); |
|
21311
bca57f8144a1
Add purple_account_clear_current_error(), which does what it says on the tin.
Will Thompson <resiak@pidgin.im>
parents:
21300
diff
changeset
|
2403 | } |
|
21504
0c78851f576b
Propagating ipp to im.pidgin.cpw.resiak.disconnectreason caused
Will Thompson <resiak@pidgin.im>
parents:
21503
diff
changeset
|
2404 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2405 | static xmlnode * |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2406 | status_attr_to_xmlnode(const PurpleStatus *status, const PurpleStatusType *type, |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2407 | const PurpleStatusAttr *attr) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2408 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2409 | xmlnode *node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2410 | const char *id; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2411 | char *value = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2412 | PurpleStatusAttr *default_attr; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2413 | PurpleValue *default_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2414 | PurpleType attr_type; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2415 | PurpleValue *attr_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2416 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2417 | id = purple_status_attr_get_id(attr); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2418 | g_return_val_if_fail(id, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2419 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2420 | attr_value = purple_status_get_attr_value(status, id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2421 | g_return_val_if_fail(attr_value, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2422 | attr_type = purple_value_get_type(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2423 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2424 | /* |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2425 | * If attr_value is a different type than it should be |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2426 | * then don't write it to the file. |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2427 | */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2428 | default_attr = purple_status_type_get_attr(type, id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2429 | default_value = purple_status_attr_get_value(default_attr); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2430 | if (attr_type != purple_value_get_type(default_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2431 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2432 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2433 | /* |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2434 | * If attr_value is the same as the default for this status |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2435 | * then there is no need to write it to the file. |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2436 | */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2437 | if (attr_type == PURPLE_TYPE_STRING) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2438 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2439 | const char *string_value = purple_value_get_string(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2440 | const char *default_string_value = purple_value_get_string(default_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2441 | if (purple_strequal(string_value, default_string_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2442 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2443 | value = g_strdup(purple_value_get_string(attr_value)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2444 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2445 | else if (attr_type == PURPLE_TYPE_INT) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2446 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2447 | int int_value = purple_value_get_int(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2448 | if (int_value == purple_value_get_int(default_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2449 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2450 | value = g_strdup_printf("%d", int_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2451 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2452 | else if (attr_type == PURPLE_TYPE_BOOLEAN) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2453 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2454 | gboolean boolean_value = purple_value_get_boolean(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2455 | if (boolean_value == purple_value_get_boolean(default_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2456 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2457 | value = g_strdup(boolean_value ? |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2458 | "true" : "false"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2459 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2460 | else |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2461 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2462 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2463 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2464 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2465 | g_return_val_if_fail(value, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2466 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2467 | node = xmlnode_new("attribute"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2468 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2469 | xmlnode_set_attrib(node, "id", id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2470 | xmlnode_set_attrib(node, "value", value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2471 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2472 | g_free(value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2473 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2474 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2475 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2476 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2477 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2478 | status_attrs_to_xmlnode(const PurpleStatus *status) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2479 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2480 | PurpleStatusType *type = purple_status_get_type(status); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2481 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2482 | GList *attrs, *attr; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2483 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2484 | node = xmlnode_new("attributes"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2485 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2486 | attrs = purple_status_type_get_attrs(type); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2487 | for (attr = attrs; attr != NULL; attr = attr->next) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2488 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2489 | child = status_attr_to_xmlnode(status, type, (const PurpleStatusAttr *)attr->data); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2490 | if (child) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2491 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2492 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2493 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2494 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2495 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2496 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2497 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2498 | status_to_xmlnode(const PurpleStatus *status) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2499 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2500 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2501 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2502 | node = xmlnode_new("status"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2503 | xmlnode_set_attrib(node, "type", purple_status_get_id(status)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2504 | if (purple_status_get_name(status) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2505 | xmlnode_set_attrib(node, "name", purple_status_get_name(status)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2506 | xmlnode_set_attrib(node, "active", purple_status_is_active(status) ? "true" : "false"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2507 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2508 | child = status_attrs_to_xmlnode(status); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2509 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2510 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2511 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2512 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2513 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2514 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2515 | statuses_to_xmlnode(const PurplePresence *presence) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2516 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2517 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2518 | GList *statuses; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2519 | PurpleStatus *status; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2520 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2521 | node = xmlnode_new("statuses"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2522 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2523 | statuses = purple_presence_get_statuses(presence); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2524 | for (; statuses != NULL; statuses = statuses->next) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2525 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2526 | status = statuses->data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2527 | if (purple_status_type_is_saveable(purple_status_get_type(status))) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2528 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2529 | child = status_to_xmlnode(status); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2530 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2531 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2532 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2533 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2534 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2535 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2536 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2537 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2538 | proxy_settings_to_xmlnode(PurpleProxyInfo *proxy_info) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2539 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2540 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2541 | PurpleProxyType proxy_type; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2542 | const char *value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2543 | int int_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2544 | char buf[21]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2545 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2546 | proxy_type = purple_proxy_info_get_type(proxy_info); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2547 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2548 | node = xmlnode_new("proxy"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2549 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2550 | child = xmlnode_new_child(node, "type"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2551 | xmlnode_insert_data(child, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2552 | (proxy_type == PURPLE_PROXY_USE_GLOBAL ? "global" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2553 | proxy_type == PURPLE_PROXY_NONE ? "none" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2554 | proxy_type == PURPLE_PROXY_HTTP ? "http" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2555 | proxy_type == PURPLE_PROXY_SOCKS4 ? "socks4" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2556 | proxy_type == PURPLE_PROXY_SOCKS5 ? "socks5" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2557 | proxy_type == PURPLE_PROXY_TOR ? "tor" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2558 | proxy_type == PURPLE_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2559 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2560 | if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2561 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2562 | child = xmlnode_new_child(node, "host"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2563 | xmlnode_insert_data(child, value, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2564 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2565 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2566 | if ((int_value = purple_proxy_info_get_port(proxy_info)) != 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2567 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2568 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2569 | child = xmlnode_new_child(node, "port"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2570 | xmlnode_insert_data(child, buf, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2571 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2572 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2573 | if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2574 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2575 | child = xmlnode_new_child(node, "username"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2576 | xmlnode_insert_data(child, value, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2577 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2578 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2579 | if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2580 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2581 | child = xmlnode_new_child(node, "password"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2582 | xmlnode_insert_data(child, value, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2583 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2584 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2585 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2586 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2587 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2588 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2589 | current_error_to_xmlnode(PurpleConnectionErrorInfo *err) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2590 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2591 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2592 | char type_str[3]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2593 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2594 | node = xmlnode_new("current_error"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2595 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2596 | if(err == NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2597 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2598 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2599 | /* It doesn't make sense to have transient errors persist across a |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2600 | * restart. |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2601 | */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2602 | if(!purple_connection_error_is_fatal (err->type)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2603 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2604 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2605 | child = xmlnode_new_child(node, "type"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2606 | g_snprintf(type_str, sizeof(type_str), "%u", err->type); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2607 | xmlnode_insert_data(child, type_str, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2608 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2609 | child = xmlnode_new_child(node, "description"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2610 | if(err->description) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2611 | char *utf8ized = purple_utf8_try_convert(err->description); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2612 | if(utf8ized == NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2613 | utf8ized = purple_utf8_salvage(err->description); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2614 | xmlnode_insert_data(child, utf8ized, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2615 | g_free(utf8ized); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2616 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2617 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2618 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2619 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2620 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2621 | static void |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2622 | setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2623 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2624 | const char *name; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2625 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2626 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2627 | char buf[21]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2628 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2629 | name = (const char *)key; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2630 | setting = (PurpleAccountSetting *)value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2631 | node = (xmlnode *)user_data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2632 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2633 | child = xmlnode_new_child(node, "setting"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2634 | xmlnode_set_attrib(child, "name", name); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2635 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2636 | if (G_VALUE_HOLDS_INT(&setting->value)) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2637 | xmlnode_set_attrib(child, "type", "int"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2638 | g_snprintf(buf, sizeof(buf), "%d", g_value_get_int(&setting->value)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2639 | xmlnode_insert_data(child, buf, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2640 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2641 | else if (G_VALUE_HOLDS_STRING(&setting->value) && g_value_get_string(&setting->value) != NULL) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2642 | xmlnode_set_attrib(child, "type", "string"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2643 | xmlnode_insert_data(child, g_value_get_string(&setting->value), -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2644 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2645 | else if (G_VALUE_HOLDS_BOOLEAN(&setting->value)) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2646 | xmlnode_set_attrib(child, "type", "bool"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2647 | g_snprintf(buf, sizeof(buf), "%d", g_value_get_boolean(&setting->value)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2648 | xmlnode_insert_data(child, buf, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2649 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2650 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2651 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2652 | static void |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2653 | ui_setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2654 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2655 | const char *ui; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2656 | GHashTable *table; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2657 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2658 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2659 | ui = (const char *)key; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2660 | table = (GHashTable *)value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2661 | node = (xmlnode *)user_data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2662 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2663 | if (g_hash_table_size(table) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2664 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2665 | child = xmlnode_new_child(node, "settings"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2666 | xmlnode_set_attrib(child, "ui", ui); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2667 | g_hash_table_foreach(table, setting_to_xmlnode, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2668 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2669 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2670 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2671 | xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2672 | purple_account_to_xmlnode(PurpleAccount *account) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2673 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2674 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2675 | const char *tmp; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2676 | PurplePresence *presence; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2677 | PurpleProxyInfo *proxy_info; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2678 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2679 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2680 | node = xmlnode_new("account"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2681 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2682 | child = xmlnode_new_child(node, "protocol"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2683 | xmlnode_insert_data(child, purple_account_get_protocol_id(account), -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2684 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2685 | child = xmlnode_new_child(node, "name"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2686 | xmlnode_insert_data(child, purple_account_get_username(account), -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2687 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2688 | if (purple_account_get_remember_password(account)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2689 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2690 | const char *keyring_id = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2691 | const char *mode = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2692 | char *data = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2693 | GError *error = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2694 | GDestroyNotify destroy = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2695 | gboolean exported = purple_keyring_export_password(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2696 | &keyring_id, &mode, &data, &error, &destroy); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2697 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2698 | if (error != NULL) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2699 | purple_debug_error("account", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2700 | "Failed to export password for account %s: %s.\n", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2701 | purple_account_get_username(account), |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2702 | error->message); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2703 | } else if (exported) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2704 | child = xmlnode_new_child(node, "password"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2705 | if (keyring_id != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2706 | xmlnode_set_attrib(child, "keyring_id", keyring_id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2707 | if (mode != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2708 | xmlnode_set_attrib(child, "mode", mode); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2709 | if (data != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2710 | xmlnode_insert_data(child, data, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2711 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2712 | if (destroy != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2713 | destroy(data); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2714 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2715 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2716 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
2717 | if ((tmp = purple_account_get_private_alias(account)) != NULL) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2718 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2719 | child = xmlnode_new_child(node, "alias"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2720 | xmlnode_insert_data(child, tmp, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2721 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2722 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2723 | if ((presence = purple_account_get_presence(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2724 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2725 | child = statuses_to_xmlnode(presence); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2726 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2727 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2728 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2729 | if ((tmp = purple_account_get_user_info(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2730 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2731 | /* TODO: Do we need to call purple_str_strip_char(tmp, '\r') here? */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2732 | child = xmlnode_new_child(node, "userinfo"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2733 | xmlnode_insert_data(child, tmp, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2734 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2735 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2736 | if (g_hash_table_size(priv->settings) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2737 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2738 | child = xmlnode_new_child(node, "settings"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2739 | g_hash_table_foreach(priv->settings, setting_to_xmlnode, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2740 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2741 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2742 | if (g_hash_table_size(priv->ui_settings) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2743 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2744 | g_hash_table_foreach(priv->ui_settings, ui_setting_to_xmlnode, node); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2745 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2746 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2747 | if ((proxy_info = purple_account_get_proxy_info(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2748 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2749 | child = proxy_settings_to_xmlnode(proxy_info); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2750 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2751 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2752 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2753 | child = current_error_to_xmlnode(priv->current_error); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2754 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2755 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2756 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2757 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2758 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2759 | /**************** |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2760 | * GObject Code * |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2761 | ****************/ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2762 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2763 | /* GObject Property names */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2764 | #define PROP_USERNAME_S "username" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2765 | #define PROP_PRIVATE_ALIAS_S "private-alias" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2766 | #define PROP_ENABLED_S "enabled" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2767 | #define PROP_CONNECTION_S "connection" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2768 | #define PROP_PROTOCOL_ID_S "protocol-id" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2769 | #define PROP_USER_INFO_S "userinfo" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2770 | #define PROP_BUDDY_ICON_PATH_S "buddy-icon-path" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2771 | #define PROP_REMEMBER_PASSWORD_S "remember-password" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2772 | #define PROP_CHECK_MAIL_S "check-mail" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2773 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2774 | /* Set method for GObject properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2775 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2776 | purple_account_set_property(GObject *obj, guint param_id, const GValue *value, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2777 | GParamSpec *pspec) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2778 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2779 | PurpleAccount *account = PURPLE_ACCOUNT(obj); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2780 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2781 | switch (param_id) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2782 | case PROP_USERNAME: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2783 | purple_account_set_username(account, g_value_get_string(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2784 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2785 | case PROP_PRIVATE_ALIAS: |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
2786 | purple_account_set_private_alias(account, g_value_get_string(value)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2787 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2788 | case PROP_ENABLED: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2789 | purple_account_set_enabled(account, purple_core_get_ui(), |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2790 | g_value_get_boolean(value)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2791 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2792 | case PROP_CONNECTION: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2793 | #warning TODO: change get_pointer to get_object when PurpleConnection is a GObject |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2794 | purple_account_set_connection(account, g_value_get_pointer(value)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2795 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2796 | case PROP_PROTOCOL_ID: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2797 | purple_account_set_protocol_id(account, g_value_get_string(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2798 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2799 | case PROP_USER_INFO: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2800 | purple_account_set_user_info(account, g_value_get_string(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2801 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2802 | case PROP_BUDDY_ICON_PATH: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2803 | purple_account_set_buddy_icon_path(account, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2804 | g_value_get_string(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2805 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2806 | case PROP_REMEMBER_PASSWORD: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2807 | purple_account_set_remember_password(account, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2808 | g_value_get_boolean(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2809 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2810 | case PROP_CHECK_MAIL: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2811 | purple_account_set_check_mail(account, g_value_get_boolean(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2812 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2813 | default: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2814 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2815 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2816 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2817 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2818 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2819 | /* Get method for GObject properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2820 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2821 | purple_account_get_property(GObject *obj, guint param_id, GValue *value, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2822 | GParamSpec *pspec) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2823 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2824 | PurpleAccount *account = PURPLE_ACCOUNT(obj); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2825 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2826 | switch (param_id) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2827 | case PROP_USERNAME: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2828 | g_value_set_string(value, purple_account_get_username(account)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2829 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2830 | case PROP_PRIVATE_ALIAS: |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
2831 | g_value_set_string(value, purple_account_get_private_alias(account)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2832 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2833 | case PROP_ENABLED: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2834 | g_value_set_boolean(value, purple_account_get_enabled(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2835 | purple_core_get_ui())); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2836 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2837 | case PROP_CONNECTION: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2838 | #warning TODO: change set_pointer to set_object when PurpleConnection is a GObject |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2839 | g_value_set_pointer(value, purple_account_get_connection(account)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2840 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2841 | case PROP_PROTOCOL_ID: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2842 | g_value_set_string(value, purple_account_get_protocol_id(account)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2843 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2844 | case PROP_USER_INFO: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2845 | g_value_set_string(value, purple_account_get_user_info(account)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2846 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2847 | case PROP_BUDDY_ICON_PATH: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2848 | g_value_set_string(value, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2849 | purple_account_get_buddy_icon_path(account)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2850 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2851 | case PROP_REMEMBER_PASSWORD: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2852 | g_value_set_boolean(value, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2853 | purple_account_get_remember_password(account)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2854 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2855 | case PROP_CHECK_MAIL: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2856 | g_value_set_boolean(value, purple_account_get_check_mail(account)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2857 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2858 | default: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2859 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2860 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2861 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2862 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2863 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2864 | /* GObject initialization function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2865 | static void purple_account_init(GTypeInstance *instance, gpointer klass) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2866 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2867 | PurpleAccount *account = PURPLE_ACCOUNT(instance); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2868 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2869 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2870 | priv->settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2871 | g_free, delete_setting); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2872 | priv->ui_settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2873 | g_free, (GDestroyNotify)g_hash_table_destroy); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2874 | priv->system_log = NULL; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2875 | |
|
34590
9da48e98a77a
Renamed PurpleAccount's private member perm_deny to privacy_type
Ankit Vani <a@nevitus.org>
parents:
34589
diff
changeset
|
2876 | priv->privacy_type = PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2877 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2878 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2879 | /* GObject dispose function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2880 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2881 | purple_account_dispose(GObject *object) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2882 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2883 | GList *l; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2884 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2885 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2886 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2887 | purple_debug_info("account", "Destroying account %p\n", account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2888 | purple_signal_emit(purple_accounts_get_handle(), "account-destroying", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2889 | account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2890 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2891 | for (l = purple_get_conversations(); l != NULL; l = l->next) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2892 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2893 | PurpleConversation *conv = (PurpleConversation *)l->data; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2894 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2895 | if (purple_conversation_get_account(conv) == account) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2896 | purple_conversation_set_account(conv, NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2897 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2898 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2899 | purple_account_set_status_types(account, NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2900 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2901 | if (priv->proxy_info) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2902 | purple_proxy_info_destroy(priv->proxy_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2903 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2904 | if (priv->presence) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2905 | purple_presence_destroy(priv->presence); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2906 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2907 | if(priv->system_log) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2908 | purple_log_free(priv->system_log); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2909 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2910 | if (priv->current_error) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2911 | g_free(priv->current_error->description); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2912 | g_free(priv->current_error); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2913 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2914 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2915 | PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2916 | PURPLE_DBUS_UNREGISTER_POINTER(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2917 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2918 | parent_class->dispose(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2919 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2920 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2921 | /* GObject finalize function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2922 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2923 | purple_account_finalize(GObject *object) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2924 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2925 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2926 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2927 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2928 | g_free(priv->username); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2929 | g_free(priv->alias); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2930 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2931 | g_free(priv->user_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2932 | g_free(priv->buddy_icon_path); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2933 | g_free(priv->protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2934 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2935 | g_hash_table_destroy(priv->settings); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2936 | g_hash_table_destroy(priv->ui_settings); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2937 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2938 | while (priv->deny) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2939 | g_free(priv->deny->data); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2940 | priv->deny = g_slist_delete_link(priv->deny, priv->deny); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2941 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2942 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2943 | while (priv->permit) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2944 | g_free(priv->permit->data); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2945 | priv->permit = g_slist_delete_link(priv->permit, priv->permit); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2946 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2947 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2948 | parent_class->finalize(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2949 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2950 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2951 | /* Class initializer function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2952 | static void purple_account_class_init(PurpleAccountClass *klass) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2953 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2954 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2955 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2956 | parent_class = g_type_class_peek_parent(klass); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2957 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2958 | obj_class->dispose = purple_account_dispose; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2959 | obj_class->finalize = purple_account_finalize; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2960 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2961 | /* Setup properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2962 | obj_class->get_property = purple_account_get_property; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2963 | obj_class->set_property = purple_account_set_property; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2964 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2965 | g_object_class_install_property(obj_class, PROP_USERNAME, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2966 | g_param_spec_string(PROP_USERNAME_S, _("Username"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2967 | _("The username for the account."), NULL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2968 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2969 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2970 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2971 | g_object_class_install_property(obj_class, PROP_PRIVATE_ALIAS, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2972 | g_param_spec_string(PROP_PRIVATE_ALIAS_S, _("Private Alias"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2973 | _("The private alias for the account."), NULL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2974 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2975 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2976 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2977 | g_object_class_install_property(obj_class, PROP_USER_INFO, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2978 | g_param_spec_string(PROP_USER_INFO_S, _("User information"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2979 | _("Detailed user information for the account."), NULL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2980 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2981 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2982 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2983 | g_object_class_install_property(obj_class, PROP_BUDDY_ICON_PATH, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2984 | g_param_spec_string(PROP_BUDDY_ICON_PATH_S, _("Buddy icon path"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2985 | _("Path to the buddyicon for the account."), NULL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2986 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2987 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2988 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2989 | g_object_class_install_property(obj_class, PROP_ENABLED, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2990 | g_param_spec_boolean(PROP_ENABLED_S, _("Enabled"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2991 | _("Whether the account is enabled or not."), FALSE, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2992 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2993 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2994 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2995 | g_object_class_install_property(obj_class, PROP_REMEMBER_PASSWORD, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2996 | g_param_spec_boolean(PROP_REMEMBER_PASSWORD_S, _("Remember password"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2997 | _("Whether to remember and store the password for this account."), FALSE, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2998 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2999 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3000 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3001 | g_object_class_install_property(obj_class, PROP_CHECK_MAIL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3002 | g_param_spec_boolean(PROP_CHECK_MAIL_S, _("Check mail"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3003 | _("Whether to check mails for this account."), FALSE, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3004 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3005 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3006 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3007 | #warning TODO: change spec_pointer to spec_object when PurpleConnection is a GObject |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3008 | g_object_class_install_property(obj_class, PROP_CONNECTION, |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3009 | g_param_spec_pointer(PROP_CONNECTION_S, _("Connection"), |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3010 | _("The PurpleConnection object for the account."), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3011 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3012 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3013 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3014 | g_object_class_install_property(obj_class, PROP_PROTOCOL_ID, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3015 | g_param_spec_string(PROP_PROTOCOL_ID_S, _("Protocol ID"), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3016 | _("ID of the protocol that is responsible for the account."), NULL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3017 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3018 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3019 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3020 | g_type_class_add_private(klass, sizeof(PurpleAccountPrivate)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3021 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3022 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3023 | GType |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3024 | purple_account_get_type(void) |
|
6368
ab9f99269dfe
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
3025 | { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3026 | static GType type = 0; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3027 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3028 | if(type == 0) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3029 | static const GTypeInfo info = { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3030 | sizeof(PurpleAccountClass), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3031 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3032 | NULL, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3033 | (GClassInitFunc)purple_account_class_init, |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3034 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3035 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3036 | sizeof(PurpleAccount), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3037 | 0, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3038 | (GInstanceInitFunc)purple_account_init, |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3039 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3040 | }; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3041 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3042 | type = g_type_register_static(G_TYPE_OBJECT, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3043 | "PurpleAccount", |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3044 | &info, 0); |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
3045 | } |
|
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
3046 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3047 | return type; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
3048 | } |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3049 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3050 | PurpleAccount * |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3051 | purple_account_new(const char *username, const char *protocol_id) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3052 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3053 | PurpleAccount *account = NULL; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3054 | PurplePlugin *prpl = NULL; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3055 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3056 | PurpleStatusType *status_type; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3057 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3058 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3059 | g_return_val_if_fail(username != NULL, NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3060 | g_return_val_if_fail(protocol_id != NULL, NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3061 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3062 | account = purple_accounts_find(username, protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3063 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3064 | if (account != NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3065 | return account; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3066 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3067 | account = g_object_new(PURPLE_TYPE_ACCOUNT, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3068 | PROP_USERNAME_S, username, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3069 | PROP_PROTOCOL_ID_S, protocol_id, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3070 | NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3071 | PURPLE_DBUS_REGISTER_POINTER(account, PurpleAccount); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3072 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3073 | purple_signal_emit(purple_accounts_get_handle(), "account-created", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3074 | account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3075 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3076 | prpl = purple_find_prpl(protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3077 | if (prpl == NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3078 | return account; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3079 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3080 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3081 | if (prpl_info != NULL && prpl_info->status_types != NULL) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3082 | purple_account_set_status_types(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3083 | prpl_info->status_types(account)); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3084 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3085 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3086 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3087 | priv->presence = purple_presence_new_for_account(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3088 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3089 | status_type = purple_account_get_status_type_with_primitive(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
3090 | PURPLE_STATUS_AVAILABLE); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3091 | if (status_type != NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3092 | purple_presence_set_status_active(priv->presence, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3093 | purple_status_type_get_id(status_type), |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3094 | TRUE); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3095 | else |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3096 | purple_presence_set_status_active(priv->presence, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3097 | "offline", |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3098 | TRUE); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3099 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3100 | return account; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3101 | } |