Fri, 12 Jul 2013 05:02:37 +0530
GObjectified the PurpleConnection source
|
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 | |
|
34593
318dcc5ef8e8
Added reminder to replace protocol_id member of account by a GObject
Ankit Vani <a@nevitus.org>
parents:
34591
diff
changeset
|
54 | /* |
|
318dcc5ef8e8
Added reminder to replace protocol_id member of account by a GObject
Ankit Vani <a@nevitus.org>
parents:
34591
diff
changeset
|
55 | * TODO: After a GObject representing a protocol is ready, use it |
|
318dcc5ef8e8
Added reminder to replace protocol_id member of account by a GObject
Ankit Vani <a@nevitus.org>
parents:
34591
diff
changeset
|
56 | * here instead of the protocol ID. |
|
318dcc5ef8e8
Added reminder to replace protocol_id member of account by a GObject
Ankit Vani <a@nevitus.org>
parents:
34591
diff
changeset
|
57 | */ |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
58 | 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
|
59 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
60 | PurpleConnection *gc; /**< The connection handle. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
61 | 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
|
62 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
63 | GHashTable *settings; /**< Protocol-specific settings. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
64 | 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
|
65 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
66 | 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
|
67 | /* 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
|
68 | /* proxy settings from global prefs. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
69 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
70 | /* |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
71 | * 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
|
72 | * 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
|
73 | * 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
|
74 | * 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
|
75 | * 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
|
76 | * 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
|
77 | * Or maybe use a GTree. |
|
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 | GSList *permit; /**< Permit list. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
80 | 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
|
81 | 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
|
82 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
83 | GList *status_types; /**< Status types. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
84 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
85 | PurplePresence *presence; /**< Presence. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
86 | 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
|
87 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
88 | PurpleAccountRegistrationCb registration_cb; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
89 | void *registration_cb_user_data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
90 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
91 | PurpleConnectionErrorInfo *current_error; /**< Errors */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
92 | } PurpleAccountPrivate; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
93 | |
|
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
|
94 | 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
|
95 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
96 | char *ui; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
97 | GValue value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
98 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
99 | } PurpleAccountSetting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
100 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
101 | typedef struct |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
102 | { |
| 15884 | 103 | PurpleAccountRequestType type; |
| 104 | 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
|
105 | void *ui_handle; |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
106 | char *user; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
107 | gpointer userdata; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
108 | PurpleAccountRequestAuthorizationCb auth_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
109 | 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
|
110 | guint ref; |
| 15884 | 111 | } PurpleAccountRequestInfo; |
| 112 | ||
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
113 | 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
|
114 | { |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
115 | 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
|
116 | 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
|
117 | } 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
|
118 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
119 | /* GObject Property enums */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
120 | enum |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
121 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
122 | PROP_0, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
123 | PROP_USERNAME, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
124 | PROP_PRIVATE_ALIAS, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
125 | PROP_ENABLED, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
126 | PROP_CONNECTION, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
127 | PROP_PROTOCOL_ID, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
128 | PROP_USER_INFO, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
129 | PROP_BUDDY_ICON_PATH, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
130 | PROP_REMEMBER_PASSWORD, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
131 | PROP_CHECK_MAIL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
132 | PROP_LAST |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
133 | }; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
134 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
135 | static GObjectClass *parent_class = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
136 | static GList *handles = NULL; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
137 | |
| 5563 | 138 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
139 | 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
|
140 | 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
|
141 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
142 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
143 | |
|
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
|
144 | g_return_if_fail(account != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
145 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
146 | 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
|
147 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
148 | priv->registration_cb = cb; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
149 | 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
|
150 | } |
|
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
|
151 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
152 | static void |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
153 | 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
|
154 | 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
|
155 | { |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
156 | g_return_if_fail(account != NULL); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
157 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
158 | _purple_connection_new(account, TRUE, password); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
159 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
160 | |
|
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
|
161 | void |
| 15884 | 162 | purple_account_register(PurpleAccount *account) |
| 6581 | 163 | { |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
164 | g_return_if_fail(account != NULL); |
| 6581 | 165 | |
| 15884 | 166 | purple_debug_info("account", "Registering account %s\n", |
| 167 | purple_account_get_username(account)); | |
| 168 | ||
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
169 | 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
|
170 | purple_account_register_got_password_cb, NULL); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
171 | } |
| 6581 | 172 | |
|
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
|
173 | static void |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
174 | 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
|
175 | 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
|
176 | { |
|
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
|
177 | PurpleCallbackBundle *cbb = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
178 | PurpleAccountUnregistrationCb cb; |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
179 | |
|
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
|
180 | 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
|
181 | _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
|
182 | |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
183 | g_free(cbb); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
184 | } |
| 6581 | 185 | |
|
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
|
186 | void |
|
32721
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
187 | 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
|
188 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
189 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
190 | |
|
32721
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
191 | 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
|
192 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
193 | 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
|
194 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
195 | if (priv->registration_cb) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
196 | (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
|
197 | } |
|
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
198 | |
|
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
199 | 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
|
200 | 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
|
201 | { |
|
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
|
202 | 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
|
203 | |
|
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
|
204 | g_return_if_fail(account != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
205 | |
|
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
|
206 | 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
|
207 | purple_account_get_username(account)); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
208 | |
|
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
|
209 | 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
|
210 | 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
|
211 | 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
|
212 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
213 | 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
|
214 | 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
|
215 | } |
|
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
|
216 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
217 | static void |
| 15884 | 218 | request_password_ok_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
219 | { |
|
11042
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
220 | const char *entry; |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
221 | gboolean remember; |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
222 | |
| 15884 | 223 | entry = purple_request_fields_get_string(fields, "password"); |
| 224 | remember = purple_request_fields_get_bool(fields, "remember"); | |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
225 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
226 | if (!entry || !*entry) |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
227 | { |
| 15884 | 228 | 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
|
229 | return; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
230 | } |
| 6581 | 231 | |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
232 | 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
|
233 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
234 | 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
|
235 | _purple_connection_new(account, FALSE, entry); |
| 6581 | 236 | } |
| 237 | ||
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
238 | static void |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
239 | request_password_cancel_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
240 | { |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30456
diff
changeset
|
241 | /* Disable the account as the user has cancelled connecting */ |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
242 | purple_account_set_enabled(account, purple_core_get_ui(), FALSE); |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
243 | } |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
244 | |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
245 | |
|
16180
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
246 | void |
|
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
247 | 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
|
248 | GCallback cancel_cb, void *user_data) |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
249 | { |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
250 | gchar *primary; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
251 | const gchar *username; |
| 15884 | 252 | PurpleRequestFieldGroup *group; |
| 253 | PurpleRequestField *field; | |
| 254 | PurpleRequestFields *fields; | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
255 | |
|
10758
b4554ec8d126
[gaim-migrate @ 12361]
Mark Doliner <markdoliner@pidgin.im>
parents:
10754
diff
changeset
|
256 | /* Close any previous password request windows */ |
| 15884 | 257 | purple_request_close_with_handle(account); |
| 258 | ||
| 259 | username = purple_account_get_username(account); | |
|
10774
f4238d6312ff
[gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10760
diff
changeset
|
260 | primary = g_strdup_printf(_("Enter password for %s (%s)"), username, |
| 15884 | 261 | purple_account_get_protocol_name(account)); |
| 262 | ||
| 263 | fields = purple_request_fields_new(); | |
| 264 | group = purple_request_field_group_new(NULL); | |
| 265 | purple_request_fields_add_group(fields, group); | |
| 266 | ||
| 267 | field = purple_request_field_string_new("password", _("Enter Password"), NULL, FALSE); | |
| 268 | purple_request_field_string_set_masked(field, TRUE); | |
| 269 | purple_request_field_set_required(field, TRUE); | |
| 270 | purple_request_field_group_add_field(group, field); | |
| 271 | ||
| 272 | field = purple_request_field_bool_new("remember", _("Save password"), FALSE); | |
| 273 | purple_request_field_group_add_field(group, field); | |
| 274 | ||
| 275 | purple_request_fields(account, | |
|
11042
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
276 | NULL, |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
277 | primary, |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
278 | NULL, |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
279 | fields, |
|
16180
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
280 | _("OK"), ok_cb, |
|
82761882c366
patch from Simon Wilkinson to support Jabber/XMPP w/o passwords
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
281 | _("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
|
282 | 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
|
283 | user_data); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
284 | g_free(primary); |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
285 | } |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
286 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
287 | static void |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
288 | 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
|
289 | 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
|
290 | { |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
291 | PurplePluginProtocolInfo *prpl_info = data; |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
292 | |
|
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
|
293 | if ((password == NULL || *password == '\0') && |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
294 | !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
295 | !(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
|
296 | 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
|
297 | 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
|
298 | 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
|
299 | else |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
300 | _purple_connection_new(account, FALSE, password); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
301 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
302 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
303 | void |
| 15884 | 304 | purple_account_connect(PurpleAccount *account) |
| 5563 | 305 | { |
| 15884 | 306 | PurplePlugin *prpl; |
|
34022
c49f6e9ea27d
Make all the prpls build.
Paul Aurich <darkrain42@pidgin.im>
parents:
34021
diff
changeset
|
307 | const char *username; |
| 15884 | 308 | PurplePluginProtocolInfo *prpl_info; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
309 | PurpleAccountPrivate *priv; |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
310 | |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
311 | g_return_if_fail(account != NULL); |
| 5563 | 312 | |
|
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
|
313 | 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
|
314 | |
|
206581aed04f
Don't debug print that we are connecting an account until we are reasonably
Etan Reisner <deryni@pidgin.im>
parents:
25888
diff
changeset
|
315 | 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
|
316 | 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
|
317 | "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
|
318 | username); |
|
11722
8cad41c3c5b9
[gaim-migrate @ 14013]
Mark Doliner <markdoliner@pidgin.im>
parents:
11643
diff
changeset
|
319 | 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
|
320 | } |
|
11722
8cad41c3c5b9
[gaim-migrate @ 14013]
Mark Doliner <markdoliner@pidgin.im>
parents:
11643
diff
changeset
|
321 | |
| 15884 | 322 | 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
|
323 | if (prpl == NULL) { |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
324 | gchar *message; |
|
6036
285e48913c72
[gaim-migrate @ 6486]
Mark Doliner <markdoliner@pidgin.im>
parents:
5979
diff
changeset
|
325 | |
|
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
|
326 | message = g_strdup_printf(_("Missing protocol plugin for %s"), username); |
| 15884 | 327 | purple_notify_error(account, _("Connection Error"), message, NULL); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
328 | g_free(message); |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
329 | return; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
330 | } |
| 5563 | 331 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
332 | 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
|
333 | |
|
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
|
334 | 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
|
335 | |
| 15884 | 336 | 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
|
337 | 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
|
338 | 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
|
339 | 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
|
340 | } 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
|
341 | 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
|
342 | 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
|
343 | } |
| 5563 | 344 | } |
| 345 | ||
| 346 | void | |
| 15884 | 347 | purple_account_disconnect(PurpleAccount *account) |
| 5563 | 348 | { |
| 15884 | 349 | PurpleConnection *gc; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
350 | PurpleAccountPrivate *priv; |
|
28373
14e79bd71ac3
Display the username in the debug log when disconnecting an account.
Paul Aurich <darkrain42@pidgin.im>
parents:
27969
diff
changeset
|
351 | const char *username; |
|
5926
f0c5bbf16793
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5879
diff
changeset
|
352 | |
| 5563 | 353 | g_return_if_fail(account != NULL); |
| 15884 | 354 | g_return_if_fail(!purple_account_is_disconnected(account)); |
| 355 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
356 | 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
|
357 | |
|
28373
14e79bd71ac3
Display the username in the debug log when disconnecting an account.
Paul Aurich <darkrain42@pidgin.im>
parents:
27969
diff
changeset
|
358 | 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
|
359 | 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
|
360 | username ? username : "(null)", account); |
|
5930
cdd2e5397cd3
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
361 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
362 | priv->disconnecting = TRUE; |
| 5563 | 363 | |
| 15884 | 364 | gc = purple_account_get_connection(account); |
|
34751
374a9500c430
Added _purple_connection_wants_to_die() to internal.h to be used by account.c. Removed _purple_connection_destroy().
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
365 | g_object_unref(gc); |
| 15884 | 366 | purple_account_set_connection(account, NULL); |
| 10384 | 367 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
368 | priv->disconnecting = FALSE; |
| 5563 | 369 | } |
| 370 | ||
|
32722
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
371 | gboolean |
|
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
372 | 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
|
373 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
374 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
375 | |
|
32722
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
376 | 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
|
377 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
378 | 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
|
379 | return priv->disconnecting; |
|
32722
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
380 | } |
|
50ed95d90d55
Add purple_account_is_disconnecting() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32721
diff
changeset
|
381 | |
| 5563 | 382 | void |
| 15884 | 383 | purple_account_notify_added(PurpleAccount *account, const char *remote_user, |
| 12287 | 384 | const char *id, const char *alias, |
| 12286 | 385 | const char *message) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
386 | { |
| 15884 | 387 | PurpleAccountUiOps *ui_ops; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
388 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
389 | g_return_if_fail(account != NULL); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
390 | g_return_if_fail(remote_user != NULL); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
391 | |
| 15884 | 392 | ui_ops = purple_accounts_get_ui_ops(); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
393 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
394 | if (ui_ops != NULL && ui_ops->notify_added != NULL) |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
395 | ui_ops->notify_added(account, remote_user, id, alias, message); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
396 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
397 | |
| 12285 | 398 | void |
| 15884 | 399 | purple_account_request_add(PurpleAccount *account, const char *remote_user, |
| 12285 | 400 | const char *id, const char *alias, |
| 401 | const char *message) | |
| 402 | { | |
| 15884 | 403 | PurpleAccountUiOps *ui_ops; |
| 12285 | 404 | |
| 405 | g_return_if_fail(account != NULL); | |
| 406 | g_return_if_fail(remote_user != NULL); | |
| 407 | ||
| 15884 | 408 | ui_ops = purple_accounts_get_ui_ops(); |
| 12285 | 409 | |
| 410 | if (ui_ops != NULL && ui_ops->request_add != NULL) | |
| 411 | ui_ops->request_add(account, remote_user, id, alias, message); | |
| 412 | } | |
| 413 | ||
|
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
|
414 | 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
|
415 | 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
|
416 | { |
|
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 | 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
|
418 | 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
|
419 | |
|
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 | /* 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
|
421 | 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
|
422 | 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
|
423 | 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
|
424 | } |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
425 | |
|
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
|
426 | static void |
| 15884 | 427 | 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
|
428 | { |
| 15884 | 429 | PurpleAccountUiOps *ops; |
| 430 | ||
| 431 | 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
|
432 | |
|
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 | 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
|
434 | 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
|
435 | |
|
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
|
436 | 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
|
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 | |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
439 | void |
| 15884 | 440 | 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
|
441 | { |
|
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 | GList *l, *l_next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
443 | |
|
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
|
444 | g_return_if_fail(account != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
445 | |
|
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
|
446 | for (l = handles; l != NULL; l = l_next) { |
| 15884 | 447 | PurpleAccountRequestInfo *info = l->data; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
448 | |
|
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
|
449 | l_next = l->next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
450 | |
|
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
|
451 | 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
|
452 | handles = g_list_remove(handles, info); |
| 15884 | 453 | 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
|
454 | } |
|
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
|
455 | } |
|
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 | |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
458 | void |
| 15884 | 459 | 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
|
460 | { |
|
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 | GList *l, *l_next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
462 | |
|
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
|
463 | g_return_if_fail(ui_handle != NULL); |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
464 | |
|
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
|
465 | for (l = handles; l != NULL; l = l_next) { |
| 15884 | 466 | PurpleAccountRequestInfo *info = l->data; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
467 | |
|
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
|
468 | l_next = l->next; |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
469 | |
|
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
|
470 | 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
|
471 | handles = g_list_remove(handles, info); |
| 15884 | 472 | 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
|
473 | } |
|
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
|
474 | } |
|
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
|
475 | } |
|
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
|
476 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
477 | static void |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
478 | 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
|
479 | { |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
480 | 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
|
481 | |
|
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 | 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
|
483 | |
|
29046
1cae96b8e674
*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465):
Daniel Atallah <datallah@pidgin.im>
parents:
28764
diff
changeset
|
484 | 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
|
485 | 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
|
486 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
487 | 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
|
488 | "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
|
489 | |
|
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
|
490 | 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
|
491 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
492 | |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
493 | static void |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
494 | 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
|
495 | { |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
496 | 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
|
497 | |
|
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 | 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
|
499 | |
|
29046
1cae96b8e674
*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465):
Daniel Atallah <datallah@pidgin.im>
parents:
28764
diff
changeset
|
500 | 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
|
501 | 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
|
502 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
503 | 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
|
504 | "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
|
505 | |
|
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
|
506 | 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
|
507 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
508 | |
|
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
|
509 | void * |
| 15884 | 510 | 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
|
511 | 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
|
512 | PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data) |
| 15119 | 513 | { |
| 15884 | 514 | PurpleAccountUiOps *ui_ops; |
| 515 | PurpleAccountRequestInfo *info; | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
516 | int plugin_return; |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
517 | 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
|
518 | |
|
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 | 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
|
520 | 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
|
521 | |
| 15884 | 522 | 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
|
523 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
524 | 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
|
525 | 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
|
526 | 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
|
527 | "account-authorization-requested", |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
528 | 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
|
529 | )); |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
530 | |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
531 | 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
|
532 | { |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
533 | case PURPLE_ACCOUNT_RESPONSE_IGNORE: |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
534 | 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
|
535 | return NULL; |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
536 | 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
|
537 | if (auth_cb != NULL) |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
538 | auth_cb(response, user_data); |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
539 | 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
|
540 | return NULL; |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
541 | 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
|
542 | if (deny_cb != NULL) |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
543 | deny_cb(response, user_data); |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
544 | 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
|
545 | return NULL; |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
546 | } |
|
2bb18e0658e7
Patch from Stefan Ott to add the account-authorization-requested-with-message
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31137
diff
changeset
|
547 | |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
548 | g_free(response); |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
549 | |
|
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
|
550 | if (ui_ops != NULL && ui_ops->request_authorize != NULL) { |
| 15884 | 551 | info = g_new0(PurpleAccountRequestInfo, 1); |
| 552 | 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
|
553 | info->account = account; |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
554 | info->auth_cb = auth_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
555 | info->deny_cb = deny_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
556 | info->userdata = user_data; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
557 | 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
|
558 | 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
|
559 | 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
|
560 | 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
|
561 | |
|
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
|
562 | 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
|
563 | 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
|
564 | |
|
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
|
565 | 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
|
566 | 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
|
567 | 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
|
568 | 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
|
569 | } |
|
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
|
570 | } |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
571 | |
|
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
|
572 | return NULL; |
| 15119 | 573 | } |
| 574 | ||
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
575 | static void |
| 15884 | 576 | change_password_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
577 | { |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
578 | const char *orig_pass, *new_pass_1, *new_pass_2; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
579 | |
| 15884 | 580 | orig_pass = purple_request_fields_get_string(fields, "password"); |
| 581 | new_pass_1 = purple_request_fields_get_string(fields, "new_password_1"); | |
| 582 | 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
|
583 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
584 | if (g_utf8_collate(new_pass_1, new_pass_2)) |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
585 | { |
| 15884 | 586 | purple_notify_error(account, NULL, |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
587 | _("New passwords do not match."), NULL); |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
588 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
589 | return; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
590 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
591 | |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
592 | 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
|
593 | (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
|
594 | (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
|
595 | (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
|
596 | (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
|
597 | (new_pass_2 == NULL || *new_pass_2 == '\0'))) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
598 | { |
| 15884 | 599 | purple_notify_error(account, NULL, |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
600 | _("Fill out all fields completely."), NULL); |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
601 | return; |
|
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 | |
| 15884 | 604 | purple_account_change_password(account, orig_pass, new_pass_1); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
605 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
606 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
607 | void |
| 15884 | 608 | purple_account_request_change_password(PurpleAccount *account) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
609 | { |
| 15884 | 610 | PurpleRequestFields *fields; |
| 611 | PurpleRequestFieldGroup *group; | |
| 612 | 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
|
613 | PurpleConnection *gc; |
|
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
614 | 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
|
615 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
616 | char primary[256]; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
617 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
618 | g_return_if_fail(account != NULL); |
| 15884 | 619 | g_return_if_fail(purple_account_is_connected(account)); |
| 620 | ||
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
621 | 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
|
622 | 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
|
623 | 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
|
624 | 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
|
625 | 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
|
626 | |
| 15884 | 627 | fields = purple_request_fields_new(); |
| 628 | ||
| 629 | group = purple_request_field_group_new(NULL); | |
| 630 | purple_request_fields_add_group(fields, group); | |
| 631 | ||
| 632 | field = purple_request_field_string_new("password", _("Original password"), | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
633 | NULL, FALSE); |
| 15884 | 634 | 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
|
635 | 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
|
636 | purple_request_field_set_required(field, TRUE); |
| 15884 | 637 | purple_request_field_group_add_field(group, field); |
| 638 | ||
| 639 | field = purple_request_field_string_new("new_password_1", | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
640 | _("New password"), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
641 | NULL, FALSE); |
| 15884 | 642 | 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
|
643 | 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
|
644 | purple_request_field_set_required(field, TRUE); |
| 15884 | 645 | purple_request_field_group_add_field(group, field); |
| 646 | ||
| 647 | field = purple_request_field_string_new("new_password_2", | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
648 | _("New password (again)"), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
649 | NULL, FALSE); |
| 15884 | 650 | 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
|
651 | 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
|
652 | purple_request_field_set_required(field, TRUE); |
| 15884 | 653 | purple_request_field_group_add_field(group, field); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
654 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
655 | g_snprintf(primary, sizeof(primary), _("Change password for %s"), |
| 15884 | 656 | purple_account_get_username(account)); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
657 | |
|
7755
a08288ab4e5f
[gaim-migrate @ 8400]
Mark Doliner <markdoliner@pidgin.im>
parents:
7654
diff
changeset
|
658 | /* I'm sticking this somewhere in the code: bologna */ |
|
a08288ab4e5f
[gaim-migrate @ 8400]
Mark Doliner <markdoliner@pidgin.im>
parents:
7654
diff
changeset
|
659 | |
| 15884 | 660 | purple_request_fields(purple_account_get_connection(account), |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
661 | NULL, |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
662 | primary, |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
663 | _("Please enter your current password and your " |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
664 | "new password."), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
665 | fields, |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
666 | _("OK"), G_CALLBACK(change_password_cb), |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
667 | _("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
|
668 | account, NULL, NULL, |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
669 | account); |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
670 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
671 | |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
672 | static void |
| 15884 | 673 | set_user_info_cb(PurpleAccount *account, const char *user_info) |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
674 | { |
| 15884 | 675 | PurpleConnection *gc; |
| 676 | ||
| 677 | purple_account_set_user_info(account, user_info); | |
| 678 | gc = purple_account_get_connection(account); | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
679 | serv_set_info(gc, user_info); |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
680 | } |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
681 | |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
682 | void |
| 15884 | 683 | purple_account_request_change_user_info(PurpleAccount *account) |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
684 | { |
| 15884 | 685 | PurpleConnection *gc; |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
686 | char primary[256]; |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
687 | |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
688 | g_return_if_fail(account != NULL); |
| 15884 | 689 | g_return_if_fail(purple_account_is_connected(account)); |
| 690 | ||
| 691 | gc = purple_account_get_connection(account); | |
| 8697 | 692 | |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
693 | g_snprintf(primary, sizeof(primary), |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
694 | _("Change user information for %s"), |
| 15884 | 695 | purple_account_get_username(account)); |
| 696 | ||
| 697 | purple_request_input(gc, _("Set User Info"), primary, NULL, | |
| 698 | purple_account_get_user_info(account), | |
| 8697 | 699 | TRUE, FALSE, ((gc != NULL) && |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
700 | (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_HTML) ? "html" : NULL), |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
701 | _("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
|
702 | _("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
|
703 | 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
|
704 | account); |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
705 | } |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
706 | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
707 | void |
| 15884 | 708 | purple_account_set_username(PurpleAccount *account, const char *username) |
| 5563 | 709 | { |
|
34709
3484aac07f02
Replaced PurpleBlistUiOps with PurpleBListUiOps for uniform naming
Ankit Vani <a@nevitus.org>
parents:
34686
diff
changeset
|
710 | PurpleBListUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
711 | 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
|
712 | |
|
5711
5aa3984f5f80
[gaim-migrate @ 6132]
Christian Hammond <chipx86@chipx86.com>
parents:
5710
diff
changeset
|
713 | g_return_if_fail(account != NULL); |
| 5563 | 714 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
715 | 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
|
716 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
717 | g_free(priv->username); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
718 | priv->username = g_strdup(username); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
719 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
720 | purple_accounts_schedule_save(); |
| 15163 | 721 | |
| 722 | /* if the name changes, we should re-write the buddy list | |
| 723 | * 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
|
724 | 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
|
725 | 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
|
726 | blist_ops->save_account(account); |
| 5563 | 727 | } |
| 728 | ||
|
33987
9beebdbf44d6
Fixed many bugs and crashes in the keyring subsystem.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33983
diff
changeset
|
729 | void |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
730 | 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
|
731 | PurpleKeyringSaveCallback cb, gpointer data) |
| 5563 | 732 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
733 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
734 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
735 | g_return_if_fail(account != NULL); |
| 5563 | 736 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
737 | 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
|
738 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
739 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
740 | priv->password = g_strdup(password); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
741 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
742 | 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
|
743 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
744 | 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
|
745 | 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
|
746 | "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
|
747 | 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
|
748 | |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
749 | 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
|
750 | 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
|
751 | } 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
|
752 | 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
|
753 | } |
| 5563 | 754 | } |
| 755 | ||
| 756 | 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
|
757 | purple_account_set_private_alias(PurpleAccount *account, const char *alias) |
| 5563 | 758 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
759 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
760 | |
| 5563 | 761 | g_return_if_fail(account != NULL); |
| 762 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
763 | 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
|
764 | |
|
13731
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
765 | /* |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
766 | * 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
|
767 | * they're the exact same string. |
|
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
768 | */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
769 | if (alias == priv->alias) |
|
13731
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
770 | return; |
|
220d399fc026
[gaim-migrate @ 16140]
Mark Doliner <markdoliner@pidgin.im>
parents:
13678
diff
changeset
|
771 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
772 | 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
|
773 | g_utf8_collate(priv->alias, alias)) |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
774 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
775 | char *old = priv->alias; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
776 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
777 | priv->alias = g_strdup(alias); |
| 15884 | 778 | 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
|
779 | account, old); |
|
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
780 | g_free(old); |
|
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
781 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
782 | purple_accounts_schedule_save(); |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
783 | } |
| 5563 | 784 | } |
| 785 | ||
| 786 | void | |
| 15884 | 787 | purple_account_set_user_info(PurpleAccount *account, const char *user_info) |
| 5563 | 788 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
789 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
790 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
791 | g_return_if_fail(account != NULL); |
| 5563 | 792 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
793 | 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
|
794 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
795 | g_free(priv->user_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
796 | priv->user_info = g_strdup(user_info); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
797 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
798 | purple_accounts_schedule_save(); |
| 5563 | 799 | } |
| 800 | ||
| 15884 | 801 | 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
|
802 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
803 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
804 | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
805 | g_return_if_fail(account != NULL); |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
806 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
807 | 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
|
808 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
809 | 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
|
810 | priv->buddy_icon_path = g_strdup(path); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
811 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
812 | purple_accounts_schedule_save(); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
813 | } |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
814 | |
| 5563 | 815 | void |
| 15884 | 816 | 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
|
817 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
818 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
819 | |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
820 | g_return_if_fail(account != NULL); |
|
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
821 | g_return_if_fail(protocol_id != NULL); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
822 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
823 | 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
|
824 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
825 | g_free(priv->protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
826 | priv->protocol_id = g_strdup(protocol_id); |
|
5665
0115e8068f51
[gaim-migrate @ 6081]
Christian Hammond <chipx86@chipx86.com>
parents:
5659
diff
changeset
|
827 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
828 | purple_accounts_schedule_save(); |
| 5563 | 829 | } |
| 830 | ||
| 831 | void | |
| 15884 | 832 | purple_account_set_connection(PurpleAccount *account, PurpleConnection *gc) |
| 5563 | 833 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
834 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
835 | |
| 5563 | 836 | g_return_if_fail(account != NULL); |
| 837 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
838 | 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
|
839 | priv->gc = gc; |
| 5563 | 840 | } |
| 841 | ||
| 842 | void | |
| 15884 | 843 | purple_account_set_remember_password(PurpleAccount *account, gboolean value) |
| 5563 | 844 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
845 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
846 | |
| 5563 | 847 | g_return_if_fail(account != NULL); |
| 848 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
849 | 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
|
850 | priv->remember_pass = value; |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
851 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
852 | purple_accounts_schedule_save(); |
| 5563 | 853 | } |
| 854 | ||
| 855 | void | |
| 15884 | 856 | purple_account_set_check_mail(PurpleAccount *account, gboolean 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 | g_return_if_fail(account != NULL); |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
859 | |
| 15884 | 860 | purple_account_set_bool(account, "check-mail", value); |
|
5659
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
861 | } |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
862 | |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5643
diff
changeset
|
863 | void |
| 15884 | 864 | purple_account_set_enabled(PurpleAccount *account, const char *ui, |
| 10400 | 865 | gboolean value) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
866 | { |
| 15884 | 867 | PurpleConnection *gc; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
868 | PurpleAccountPrivate *priv; |
| 12070 | 869 | gboolean was_enabled = FALSE; |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
870 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
871 | g_return_if_fail(account != NULL); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
872 | g_return_if_fail(ui != NULL); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
873 | |
| 15884 | 874 | was_enabled = purple_account_get_enabled(account, ui); |
| 875 | ||
| 876 | purple_account_set_ui_bool(account, ui, "auto-login", value); | |
| 877 | gc = purple_account_get_connection(account); | |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
878 | |
| 12070 | 879 | if(was_enabled && !value) |
| 15884 | 880 | purple_signal_emit(purple_accounts_get_handle(), "account-disabled", account); |
| 12070 | 881 | else if(!was_enabled && value) |
| 15884 | 882 | purple_signal_emit(purple_accounts_get_handle(), "account-enabled", account); |
| 12070 | 883 | |
|
34751
374a9500c430
Added _purple_connection_wants_to_die() to internal.h to be used by account.c. Removed _purple_connection_destroy().
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
884 | if ((gc != NULL) && (_purple_connection_wants_to_die(gc))) |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
885 | return; |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11628
diff
changeset
|
886 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
887 | 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
|
888 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
889 | if (value && purple_presence_is_online(priv->presence)) |
| 15884 | 890 | purple_account_connect(account); |
| 891 | else if (!value && !purple_account_is_disconnected(account)) | |
| 892 | purple_account_disconnect(account); | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
893 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
894 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
895 | void |
| 15884 | 896 | purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info) |
|
5681
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 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
899 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
900 | g_return_if_fail(account != NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
901 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
902 | 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
|
903 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
904 | if (priv->proxy_info != NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
905 | 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
|
906 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
907 | priv->proxy_info = info; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
908 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
909 | purple_accounts_schedule_save(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
910 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
911 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
912 | void |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
913 | 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
|
914 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
915 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
916 | |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
917 | 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
|
918 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
919 | 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
|
920 | 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
|
921 | } |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
922 | |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
923 | void |
| 15884 | 924 | purple_account_set_status_types(PurpleAccount *account, GList *status_types) |
|
9944
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 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
927 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
928 | g_return_if_fail(account != NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
929 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
930 | 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
|
931 | |
| 14724 | 932 | /* Out with the old... */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
933 | if (priv->status_types != NULL) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
934 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
935 | 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
|
936 | g_list_free(priv->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 | |
|
10005
1d711ab1de4e
[gaim-migrate @ 10922]
Mark Doliner <markdoliner@pidgin.im>
parents:
9989
diff
changeset
|
939 | /* In with the new... */ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
940 | priv->status_types = status_types; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
941 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
942 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
943 | void |
| 15884 | 944 | purple_account_set_status(PurpleAccount *account, const char *status_id, |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
945 | gboolean active, ...) |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
946 | { |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
947 | GList *attrs = NULL; |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
948 | const gchar *id; |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
949 | gpointer data; |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
950 | va_list args; |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
951 | |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
952 | va_start(args, active); |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
953 | while ((id = va_arg(args, const char *)) != NULL) |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
954 | { |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
955 | attrs = g_list_append(attrs, (char *)id); |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
956 | data = va_arg(args, void *); |
|
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
957 | attrs = g_list_append(attrs, data); |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
958 | } |
| 15884 | 959 | 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
|
960 | g_list_free(attrs); |
|
14705
c7b02232f020
[gaim-migrate @ 17389]
Mark Doliner <markdoliner@pidgin.im>
parents:
14669
diff
changeset
|
961 | va_end(args); |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
962 | } |
|
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
963 | |
|
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
964 | void |
| 15884 | 965 | 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
|
966 | gboolean active, GList *attrs) |
|
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
967 | { |
| 15884 | 968 | PurpleStatus *status; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
969 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
970 | g_return_if_fail(account != NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
971 | g_return_if_fail(status_id != NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
972 | |
| 15884 | 973 | status = purple_account_get_status(account, status_id); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
974 | if (status == NULL) |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
975 | { |
| 15884 | 976 | purple_debug_error("account", |
|
22055
95cdc03c44be
Infinitesimally better debug message
Mark Doliner <markdoliner@pidgin.im>
parents:
21961
diff
changeset
|
977 | "Invalid status ID '%s' for account %s (%s)\n", |
| 15884 | 978 | status_id, purple_account_get_username(account), |
| 979 | purple_account_get_protocol_id(account)); | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
980 | return; |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
981 | } |
|
10720
e8c25145480c
[gaim-migrate @ 12318]
Mark Doliner <markdoliner@pidgin.im>
parents:
10714
diff
changeset
|
982 | |
| 15884 | 983 | if (active || purple_status_is_independent(status)) |
| 984 | purple_status_set_active_with_attrs_list(status, active, attrs); | |
|
10862
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
985 | |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
986 | /* |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
987 | * 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
|
988 | * reconnect, we go back to the previous status). |
|
74aef8a7afcb
[gaim-migrate @ 12545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10774
diff
changeset
|
989 | */ |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
990 | purple_accounts_schedule_save(); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
991 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
992 | |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
993 | 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
|
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 | 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
|
996 | 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
|
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 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
999 | 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
|
1000 | 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
|
1001 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1002 | 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
|
1003 | 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
|
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 | 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
|
1006 | _("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
|
1007 | 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
|
1008 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1009 | 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
|
1010 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1011 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1012 | void |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1013 | 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
|
1014 | 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
|
1015 | 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
|
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 | 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
|
1018 | 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
|
1019 | 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
|
1020 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1021 | 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
|
1022 | 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
|
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 | 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
|
1025 | 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
|
1026 | 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
|
1027 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1028 | 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
|
1029 | 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
|
1030 | 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
|
1031 | 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
|
1032 | 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
|
1033 | 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
|
1034 | 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
|
1035 | 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
|
1036 | } |
|
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 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1039 | 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
|
1040 | 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
|
1041 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1042 | 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
|
1043 | 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
|
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 | 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
|
1046 | _("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
|
1047 | 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
|
1048 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1049 | 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
|
1050 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1051 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1052 | void |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1053 | 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
|
1054 | 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
|
1055 | 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
|
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 | 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
|
1058 | 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
|
1059 | 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
|
1060 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1061 | 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
|
1062 | 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
|
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 | 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
|
1065 | 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
|
1066 | 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
|
1067 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1068 | 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
|
1069 | 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
|
1070 | 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
|
1071 | 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
|
1072 | 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
|
1073 | 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
|
1074 | 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
|
1075 | 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
|
1076 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1077 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
1078 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1079 | gboolean |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1080 | 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
|
1081 | { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1082 | 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
|
1083 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1084 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1085 | void |
|
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_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
|
1087 | { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1088 | 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
|
1089 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1090 | 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
|
1091 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31325
diff
changeset
|
1092 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1093 | static void |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1094 | delete_setting(void *data) |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1095 | { |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1096 | PurpleAccountSetting *setting = (PurpleAccountSetting *)data; |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1097 | |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1098 | g_free(setting->ui); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1099 | 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
|
1100 | |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1101 | g_free(setting); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1102 | } |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1103 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1104 | void |
| 15884 | 1105 | purple_account_clear_settings(PurpleAccount *account) |
|
5694
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 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1108 | |
|
5694
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1109 | g_return_if_fail(account != NULL); |
|
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1110 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1111 | 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
|
1112 | 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
|
1113 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1114 | 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
|
1115 | g_free, delete_setting); |
|
5694
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1116 | } |
|
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1117 | |
|
46768356e6a1
[gaim-migrate @ 6115]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1118 | 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
|
1119 | 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
|
1120 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1121 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1122 | |
|
27562
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1123 | 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
|
1124 | 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
|
1125 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1126 | 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
|
1127 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1128 | 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
|
1129 | } |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1130 | |
|
2e34a10e7135
Migrate Yahoo! JAPAN accounts to the new prpl (in theory). This also adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27497
diff
changeset
|
1131 | void |
| 15884 | 1132 | purple_account_set_int(PurpleAccount *account, const char *name, int value) |
| 5563 | 1133 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1134 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1135 | PurpleAccountPrivate *priv; |
| 5563 | 1136 | |
| 1137 | g_return_if_fail(account != NULL); | |
| 1138 | g_return_if_fail(name != NULL); | |
| 1139 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1140 | 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
|
1141 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1142 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1143 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1144 | g_value_init(&setting->value, G_TYPE_INT); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1145 | g_value_set_int(&setting->value, value); |
| 5563 | 1146 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1147 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1148 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1149 | purple_accounts_schedule_save(); |
| 5563 | 1150 | } |
| 1151 | ||
| 1152 | void | |
| 15884 | 1153 | purple_account_set_string(PurpleAccount *account, const char *name, |
| 5563 | 1154 | const char *value) |
| 1155 | { | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1156 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1157 | PurpleAccountPrivate *priv; |
| 5563 | 1158 | |
| 1159 | g_return_if_fail(account != NULL); | |
| 1160 | g_return_if_fail(name != NULL); | |
| 1161 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1162 | 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
|
1163 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1164 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1165 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1166 | g_value_init(&setting->value, G_TYPE_STRING); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1167 | g_value_set_string(&setting->value, value); |
| 5563 | 1168 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1169 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1170 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1171 | purple_accounts_schedule_save(); |
| 5563 | 1172 | } |
| 1173 | ||
| 1174 | void | |
| 15884 | 1175 | purple_account_set_bool(PurpleAccount *account, const char *name, gboolean value) |
| 5563 | 1176 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1177 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1178 | PurpleAccountPrivate *priv; |
| 5563 | 1179 | |
| 1180 | g_return_if_fail(account != NULL); | |
| 1181 | g_return_if_fail(name != NULL); | |
| 1182 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1183 | 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
|
1184 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1185 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1186 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1187 | g_value_init(&setting->value, G_TYPE_BOOLEAN); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1188 | g_value_set_boolean(&setting->value, value); |
| 5563 | 1189 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1190 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1191 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1192 | purple_accounts_schedule_save(); |
| 5563 | 1193 | } |
| 1194 | ||
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1195 | static GHashTable * |
| 15884 | 1196 | get_ui_settings_table(PurpleAccount *account, const char *ui) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1197 | { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1198 | GHashTable *table; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1199 | 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
|
1200 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1201 | table = g_hash_table_lookup(priv->ui_settings, ui); |
|
5979
d51d697d27fb
[gaim-migrate @ 6426]
Christian Hammond <chipx86@chipx86.com>
parents:
5977
diff
changeset
|
1202 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1203 | if (table == NULL) { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1204 | 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
|
1205 | delete_setting); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1206 | 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
|
1207 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1208 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1209 | return table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1210 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1211 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1212 | void |
| 15884 | 1213 | purple_account_set_ui_int(PurpleAccount *account, const char *ui, |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1214 | const char *name, int value) |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1215 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1216 | PurpleAccountSetting *setting; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1217 | GHashTable *table; |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1218 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1219 | g_return_if_fail(account != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1220 | g_return_if_fail(ui != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1221 | g_return_if_fail(name != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1222 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1223 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1224 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1225 | setting->ui = g_strdup(ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1226 | g_value_init(&setting->value, G_TYPE_INT); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1227 | g_value_set_int(&setting->value, value); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1228 | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1229 | table = get_ui_settings_table(account, ui); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1230 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1231 | g_hash_table_insert(table, g_strdup(name), setting); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1232 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1233 | purple_accounts_schedule_save(); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1234 | } |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1235 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1236 | void |
| 15884 | 1237 | purple_account_set_ui_string(PurpleAccount *account, const char *ui, |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1238 | const char *name, const char *value) |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1239 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1240 | PurpleAccountSetting *setting; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1241 | GHashTable *table; |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1242 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1243 | g_return_if_fail(account != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1244 | g_return_if_fail(ui != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1245 | g_return_if_fail(name != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1246 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1247 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1248 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1249 | setting->ui = g_strdup(ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1250 | g_value_init(&setting->value, G_TYPE_STRING); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1251 | g_value_set_string(&setting->value, value); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1252 | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1253 | table = get_ui_settings_table(account, ui); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1254 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1255 | g_hash_table_insert(table, g_strdup(name), setting); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1256 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1257 | purple_accounts_schedule_save(); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1258 | } |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1259 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1260 | void |
| 15884 | 1261 | purple_account_set_ui_bool(PurpleAccount *account, const char *ui, |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1262 | const char *name, gboolean value) |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1263 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1264 | PurpleAccountSetting *setting; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1265 | GHashTable *table; |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1266 | |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1267 | g_return_if_fail(account != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1268 | g_return_if_fail(ui != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1269 | g_return_if_fail(name != NULL); |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1270 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1271 | setting = g_new0(PurpleAccountSetting, 1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1272 | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1273 | setting->ui = g_strdup(ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1274 | g_value_init(&setting->value, G_TYPE_BOOLEAN); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1275 | g_value_set_boolean(&setting->value, value); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1276 | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5792
diff
changeset
|
1277 | table = get_ui_settings_table(account, ui); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1278 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1279 | g_hash_table_insert(table, g_strdup(name), setting); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1280 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
1281 | purple_accounts_schedule_save(); |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1282 | } |
|
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
1283 | |
| 15884 | 1284 | static PurpleConnectionState |
| 1285 | purple_account_get_state(const PurpleAccount *account) | |
| 5563 | 1286 | { |
| 15884 | 1287 | PurpleConnection *gc; |
| 1288 | ||
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
1289 | g_return_val_if_fail(account != NULL, PURPLE_CONNECTION_DISCONNECTED); |
| 15884 | 1290 | |
| 1291 | gc = purple_account_get_connection(account); | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1292 | if (!gc) |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
1293 | return PURPLE_CONNECTION_DISCONNECTED; |
| 15884 | 1294 | |
| 1295 | return purple_connection_get_state(gc); | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1296 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1297 | |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1298 | gboolean |
| 15884 | 1299 | purple_account_is_connected(const PurpleAccount *account) |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1300 | { |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
1301 | return (purple_account_get_state(account) == PURPLE_CONNECTION_CONNECTED); |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1302 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1303 | |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1304 | gboolean |
| 15884 | 1305 | purple_account_is_connecting(const PurpleAccount *account) |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1306 | { |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
1307 | return (purple_account_get_state(account) == PURPLE_CONNECTION_CONNECTING); |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1308 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1309 | |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1310 | gboolean |
| 15884 | 1311 | purple_account_is_disconnected(const PurpleAccount *account) |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
1312 | { |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
1313 | return (purple_account_get_state(account) == PURPLE_CONNECTION_DISCONNECTED); |
| 5563 | 1314 | } |
| 1315 | ||
| 1316 | const char * | |
| 15884 | 1317 | purple_account_get_username(const PurpleAccount *account) |
| 5563 | 1318 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1319 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1320 | |
| 5563 | 1321 | g_return_val_if_fail(account != NULL, NULL); |
| 1322 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1323 | 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
|
1324 | return priv->username; |
| 5563 | 1325 | } |
| 1326 | ||
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1327 | static void |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1328 | 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
|
1329 | const gchar *password, GError *error, gpointer data) |
| 5563 | 1330 | { |
|
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
|
1331 | PurpleCallbackBundle *cbb = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1332 | PurpleKeyringReadCallback cb; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1333 | 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
|
1334 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1335 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1336 | "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
|
1337 | purple_account_get_username(account)); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1338 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1339 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1340 | priv->password = g_strdup(password); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1341 | |
|
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
|
1342 | cb = (PurpleKeyringReadCallback)cbb->cb; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1343 | 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
|
1344 | 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
|
1345 | |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1346 | g_free(cbb); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1347 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1348 | |
|
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
|
1349 | 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
|
1350 | 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
|
1351 | PurpleKeyringReadCallback cb, gpointer data) |
| 5563 | 1352 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1353 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1354 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1355 | 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
|
1356 | 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
|
1357 | return; |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
1358 | } |
|
035d8594b66a
Wrote a caching system that uses account->password to store password.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33996
diff
changeset
|
1359 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1360 | 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
|
1361 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1362 | if (priv->password != NULL) { |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1363 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1364 | "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
|
1365 | 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
|
1366 | 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
|
1367 | } 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
|
1368 | 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
|
1369 | 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
|
1370 | cbb->data = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1371 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
1372 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
1373 | "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
|
1374 | 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
|
1375 | 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
|
1376 | 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
|
1377 | } |
| 5563 | 1378 | } |
| 1379 | ||
| 1380 | 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
|
1381 | purple_account_get_private_alias(const PurpleAccount *account) |
| 5563 | 1382 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1383 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1384 | |
| 5563 | 1385 | g_return_val_if_fail(account != NULL, NULL); |
| 1386 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1387 | 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
|
1388 | return priv->alias; |
| 5563 | 1389 | } |
| 1390 | ||
| 1391 | const char * | |
| 15884 | 1392 | purple_account_get_user_info(const PurpleAccount *account) |
| 5563 | 1393 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1394 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1395 | |
| 5563 | 1396 | g_return_val_if_fail(account != NULL, NULL); |
| 1397 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1398 | 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
|
1399 | return priv->user_info; |
| 5563 | 1400 | } |
| 1401 | ||
| 1402 | const char * | |
| 15884 | 1403 | purple_account_get_buddy_icon_path(const PurpleAccount *account) |
|
15132
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 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1406 | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1407 | g_return_val_if_fail(account != NULL, NULL); |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1408 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1409 | 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
|
1410 | return priv->buddy_icon_path; |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1411 | } |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1412 | |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
1413 | const char * |
| 15884 | 1414 | purple_account_get_protocol_id(const PurpleAccount *account) |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1415 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1416 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1417 | |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
1418 | 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
|
1419 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1420 | 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
|
1421 | return priv->protocol_id; |
| 5563 | 1422 | } |
| 1423 | ||
|
9699
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1424 | const char * |
| 15884 | 1425 | purple_account_get_protocol_name(const PurpleAccount *account) |
|
9699
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1426 | { |
| 15884 | 1427 | PurplePlugin *p; |
|
9720
02c64e22341e
[gaim-migrate @ 10581]
Mark Doliner <markdoliner@pidgin.im>
parents:
9699
diff
changeset
|
1428 | |
|
9699
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1429 | g_return_val_if_fail(account != NULL, NULL); |
|
d1ca5dd91cc2
[gaim-migrate @ 10558]
Mark Doliner <markdoliner@pidgin.im>
parents:
9619
diff
changeset
|
1430 | |
| 15884 | 1431 | p = purple_find_prpl(purple_account_get_protocol_id(account)); |
| 9988 | 1432 | |
| 1433 | return ((p && p->info->name) ? _(p->info->name) : _("Unknown")); | |
| 1434 | } | |
| 1435 | ||
| 15884 | 1436 | PurpleConnection * |
| 1437 | purple_account_get_connection(const PurpleAccount *account) | |
| 5563 | 1438 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1439 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1440 | |
| 5563 | 1441 | g_return_val_if_fail(account != NULL, NULL); |
| 1442 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1443 | 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
|
1444 | return priv->gc; |
| 5563 | 1445 | } |
| 1446 | ||
|
29515
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1447 | 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
|
1448 | 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
|
1449 | { |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1450 | 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
|
1451 | 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
|
1452 | 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
|
1453 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
1454 | 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
|
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 | 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
|
1457 | 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
|
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 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1460 | username = purple_account_get_username(account); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1461 | self = purple_blist_find_buddy((PurpleAccount *)account, username); |
|
29515
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1462 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1463 | 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
|
1464 | 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
|
1465 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1466 | /* 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
|
1467 | * 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
|
1468 | 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
|
1469 | 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
|
1470 | } |
|
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 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1473 | 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
|
1474 | 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
|
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 | 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
|
1477 | 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
|
1478 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1479 | |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1480 | 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
|
1481 | } |
|
7334e85a7a56
This effectively moves Etan's API addition off im.pidgin.pidgin and onto
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28373
diff
changeset
|
1482 | |
| 5563 | 1483 | gboolean |
| 15884 | 1484 | purple_account_get_remember_password(const PurpleAccount *account) |
| 5563 | 1485 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1486 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1487 | |
| 5563 | 1488 | g_return_val_if_fail(account != NULL, FALSE); |
| 1489 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1490 | 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
|
1491 | return priv->remember_pass; |
| 5563 | 1492 | } |
| 1493 | ||
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1494 | gboolean |
| 15884 | 1495 | purple_account_get_check_mail(const PurpleAccount *account) |
|
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 | g_return_val_if_fail(account != NULL, FALSE); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1498 | |
| 15884 | 1499 | return purple_account_get_bool(account, "check-mail", FALSE); |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1500 | } |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1501 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1502 | gboolean |
| 15884 | 1503 | purple_account_get_enabled(const PurpleAccount *account, const char *ui) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1504 | { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1505 | g_return_val_if_fail(account != NULL, FALSE); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1506 | g_return_val_if_fail(ui != NULL, FALSE); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1507 | |
| 15884 | 1508 | 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
|
1509 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
1510 | |
| 15884 | 1511 | PurpleProxyInfo * |
| 1512 | purple_account_get_proxy_info(const PurpleAccount *account) | |
|
5681
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 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1515 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1516 | g_return_val_if_fail(account != NULL, NULL); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1517 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1518 | 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
|
1519 | return priv->proxy_info; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1520 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5666
diff
changeset
|
1521 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1522 | PurpleAccountPrivacyType |
|
30021
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1523 | 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
|
1524 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1525 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1526 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1527 | 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
|
1528 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1529 | 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
|
1530 | 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
|
1531 | } |
|
3c7a689ae32e
Add getter and setter for account->perm_deny. Patch by Stephen Whitmore.
Mark Doliner <markdoliner@pidgin.im>
parents:
29992
diff
changeset
|
1532 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1533 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1534 | 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
|
1535 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1536 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1537 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1538 | char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1539 | PurpleBuddy *buddy; |
|
34709
3484aac07f02
Replaced PurpleBlistUiOps with PurpleBListUiOps for uniform naming
Ankit Vani <a@nevitus.org>
parents:
34686
diff
changeset
|
1540 | PurpleBListUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1541 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1542 | 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
|
1543 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1544 | 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
|
1545 | 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
|
1546 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1547 | 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
|
1548 | 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
|
1549 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1550 | 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
|
1551 | 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
|
1552 | /* This buddy already exists */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1553 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1554 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1555 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1556 | if (l != NULL) |
|
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 | /* 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
|
1559 | g_free(name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1560 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1561 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1562 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1563 | 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
|
1564 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1565 | 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
|
1566 | 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
|
1567 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1568 | if (ui_ops != NULL && ui_ops->permit_added != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1569 | 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
|
1570 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1571 | 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
|
1572 | 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
|
1573 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1574 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1575 | /* This lets the UI know a buddy has had its privacy setting changed */ |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1576 | buddy = purple_blist_find_buddy(account, name); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1577 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1578 | 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
|
1579 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1580 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1581 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1582 | } |
|
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 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1585 | 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
|
1586 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1587 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1588 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1589 | const char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1590 | PurpleBuddy *buddy; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1591 | char *del; |
|
34709
3484aac07f02
Replaced PurpleBlistUiOps with PurpleBListUiOps for uniform naming
Ankit Vani <a@nevitus.org>
parents:
34686
diff
changeset
|
1592 | PurpleBListUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1593 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1594 | 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
|
1595 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1596 | 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
|
1597 | 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
|
1598 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1599 | 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
|
1600 | name = purple_normalize(account, who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1601 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1602 | 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
|
1603 | 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
|
1604 | /* 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
|
1605 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1606 | } |
|
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 | if (l == NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1609 | /* 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
|
1610 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1611 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1612 | /* 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
|
1613 | * 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
|
1614 | * later when who is used. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1615 | del = l->data; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1616 | 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
|
1617 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1618 | 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
|
1619 | 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
|
1620 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1621 | if (ui_ops != NULL && ui_ops->permit_removed != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1622 | 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
|
1623 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1624 | 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
|
1625 | 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
|
1626 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1627 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1628 | buddy = purple_blist_find_buddy(account, name); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1629 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1630 | 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
|
1631 | "buddy-privacy-changed", buddy); |
|
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 | g_free(del); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1634 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1635 | } |
|
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 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1638 | 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
|
1639 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1640 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1641 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1642 | char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1643 | PurpleBuddy *buddy; |
|
34709
3484aac07f02
Replaced PurpleBlistUiOps with PurpleBListUiOps for uniform naming
Ankit Vani <a@nevitus.org>
parents:
34686
diff
changeset
|
1644 | PurpleBListUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1645 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1646 | 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
|
1647 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1648 | 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
|
1649 | 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
|
1650 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1651 | 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
|
1652 | 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
|
1653 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1654 | 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
|
1655 | 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
|
1656 | /* This buddy already exists */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1657 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1658 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1659 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1660 | if (l != NULL) |
|
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 | /* 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
|
1663 | g_free(name); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1664 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1665 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1666 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1667 | 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
|
1668 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1669 | 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
|
1670 | 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
|
1671 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1672 | if (ui_ops != NULL && ui_ops->deny_added != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1673 | 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
|
1674 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1675 | 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
|
1676 | 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
|
1677 | blist_ops->save_account(account); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1678 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1679 | buddy = purple_blist_find_buddy(account, name); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1680 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1681 | 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
|
1682 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1683 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1684 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1685 | } |
|
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 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1688 | 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
|
1689 | gboolean local_only) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1690 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1691 | GSList *l; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1692 | const char *normalized; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1693 | char *name; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1694 | PurpleBuddy *buddy; |
|
34709
3484aac07f02
Replaced PurpleBlistUiOps with PurpleBListUiOps for uniform naming
Ankit Vani <a@nevitus.org>
parents:
34686
diff
changeset
|
1695 | PurpleBListUiOps *blist_ops; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1696 | PurpleAccountPrivate *priv; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1697 | 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
|
1698 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1699 | 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
|
1700 | 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
|
1701 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1702 | 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
|
1703 | normalized = purple_normalize(account, who); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1704 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1705 | 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
|
1706 | 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
|
1707 | /* 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
|
1708 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1709 | } |
|
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 | if (l == NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1712 | /* 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
|
1713 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1714 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1715 | buddy = purple_blist_find_buddy(account, normalized); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1716 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1717 | name = l->data; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1718 | 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
|
1719 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1720 | 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
|
1721 | 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
|
1722 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1723 | if (ui_ops != NULL && ui_ops->deny_removed != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1724 | 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
|
1725 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1726 | if (buddy != NULL) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1727 | 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
|
1728 | "buddy-privacy-changed", buddy); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1729 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1730 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1731 | g_free(name); |
|
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 | 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
|
1734 | 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
|
1735 | blist_ops->save_account(account); |
|
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 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1738 | } |
|
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 | /** |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1741 | * 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
|
1742 | * 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
|
1743 | */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1744 | static void |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1745 | 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
|
1746 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1747 | GSList *list; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1748 | 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
|
1749 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1750 | /* 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
|
1751 | 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
|
1752 | char *person = list->data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1753 | list = list->next; |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1754 | if (!purple_blist_find_buddy(account, person)) |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1755 | 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
|
1756 | } |
|
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 | /* Now make sure everyone in the buddylist is in the permit list */ |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1759 | list = purple_blist_find_buddies(account, NULL); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1760 | while (list != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1761 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1762 | PurpleBuddy *buddy = list->data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1763 | 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
|
1764 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1765 | 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
|
1766 | 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
|
1767 | 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
|
1768 | } |
|
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 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1771 | 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
|
1772 | 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
|
1773 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1774 | GSList *list; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1775 | 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
|
1776 | 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
|
1777 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1778 | switch (type) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1779 | 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
|
1780 | return; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1781 | 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
|
1782 | 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
|
1783 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1784 | 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
|
1785 | 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
|
1786 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1787 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1788 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1789 | /* Empty the allow-list. */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1790 | const char *norm = purple_normalize(account, who); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1791 | for (list = priv->permit; list != NULL;) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1792 | char *person = list->data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1793 | list = list->next; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1794 | if (!purple_strequal(norm, person)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1795 | purple_account_privacy_permit_remove(account, person, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1796 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1797 | purple_account_privacy_permit_add(account, who, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1798 | 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
|
1799 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1800 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1801 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1802 | if (!purple_blist_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
|
1803 | 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
|
1804 | 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
|
1805 | 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
|
1806 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1807 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1808 | default: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1809 | g_return_if_reached(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1810 | } |
|
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 | /* 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
|
1813 | 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
|
1814 | 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
|
1815 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1816 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1817 | 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
|
1818 | 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
|
1819 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1820 | GSList *list; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1821 | 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
|
1822 | 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
|
1823 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1824 | switch (type) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1825 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1826 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1827 | /* Empty the deny-list. */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1828 | const char *norm = purple_normalize(account, who); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1829 | for (list = priv->deny; list != NULL; ) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1830 | char *person = list->data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1831 | list = list->next; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1832 | if (!purple_strequal(norm, person)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1833 | purple_account_privacy_deny_remove(account, person, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1834 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1835 | purple_account_privacy_deny_add(account, who, FALSE); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1836 | 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
|
1837 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1838 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1839 | 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
|
1840 | 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
|
1841 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1842 | 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
|
1843 | 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
|
1844 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1845 | 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
|
1846 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1847 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1848 | if (purple_blist_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
|
1849 | 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
|
1850 | 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
|
1851 | 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
|
1852 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1853 | break; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1854 | default: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1855 | g_return_if_reached(); |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1856 | } |
|
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 | /* 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
|
1859 | 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
|
1860 | 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
|
1861 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1862 | |
|
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
|
1863 | 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
|
1864 | 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
|
1865 | { |
|
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
|
1866 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
| 34745 | 1867 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1868 | 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
|
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 | 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
|
1871 | } |
|
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 | 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
|
1874 | 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
|
1875 | { |
|
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
|
1876 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
| 34745 | 1877 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1878 | 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
|
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 | 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
|
1881 | } |
|
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
|
1882 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1883 | gboolean |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1884 | 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
|
1885 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1886 | GSList *list; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1887 | 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
|
1888 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1889 | 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
|
1890 | 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
|
1891 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1892 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1893 | 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
|
1894 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1895 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1896 | 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
|
1897 | 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
|
1898 | 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
|
1899 | 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
|
1900 | return TRUE; |
|
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 | return FALSE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1903 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1904 | 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
|
1905 | 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
|
1906 | 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
|
1907 | 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
|
1908 | return FALSE; |
|
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 | return TRUE; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1911 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1912 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
1913 | return (purple_blist_find_buddy(account, who) != NULL); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1914 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1915 | default: |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1916 | 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
|
1917 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1918 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
1919 | |
| 15884 | 1920 | PurpleStatus * |
| 1921 | purple_account_get_active_status(const PurpleAccount *account) | |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1922 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1923 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1924 | |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1925 | g_return_val_if_fail(account != NULL, NULL); |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1926 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1927 | 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
|
1928 | return purple_presence_get_active_status(priv->presence); |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1929 | } |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10720
diff
changeset
|
1930 | |
| 15884 | 1931 | PurpleStatus * |
| 1932 | 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
|
1933 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1934 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1935 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1936 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1937 | g_return_val_if_fail(status_id != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1938 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1939 | 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
|
1940 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1941 | return purple_presence_get_status(priv->presence, status_id); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1942 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1943 | |
| 15884 | 1944 | PurpleStatusType * |
| 1945 | 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
|
1946 | { |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
1947 | GList *l; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1948 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1949 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1950 | g_return_val_if_fail(id != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1951 | |
| 15884 | 1952 | 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
|
1953 | { |
| 15884 | 1954 | PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
| 1955 | ||
|
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
|
1956 | 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
|
1957 | return status_type; |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1958 | } |
|
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 | return NULL; |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1961 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1962 | |
| 15884 | 1963 | PurpleStatusType * |
| 1964 | 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
|
1965 | { |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
1966 | GList *l; |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1967 | |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1968 | g_return_val_if_fail(account != NULL, NULL); |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1969 | |
| 15884 | 1970 | 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
|
1971 | { |
| 15884 | 1972 | PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
| 1973 | ||
| 1974 | if (purple_status_type_get_primitive(status_type) == primitive) | |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1975 | return status_type; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1976 | } |
|
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 | return NULL; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1979 | } |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11736
diff
changeset
|
1980 | |
| 15884 | 1981 | PurplePresence * |
| 1982 | purple_account_get_presence(const PurpleAccount *account) | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1983 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1984 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1985 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1986 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1987 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1988 | 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
|
1989 | return priv->presence; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1990 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1991 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1992 | gboolean |
| 15884 | 1993 | purple_account_is_status_active(const PurpleAccount *account, |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1994 | const char *status_id) |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1995 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1996 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1997 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1998 | g_return_val_if_fail(account != NULL, FALSE); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
1999 | g_return_val_if_fail(status_id != NULL, FALSE); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2000 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2001 | 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
|
2002 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2003 | return purple_presence_is_status_active(priv->presence, status_id); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2004 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2005 | |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
2006 | GList * |
| 15884 | 2007 | purple_account_get_status_types(const PurpleAccount *account) |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2008 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2009 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2010 | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2011 | g_return_val_if_fail(account != NULL, NULL); |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2012 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2013 | 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
|
2014 | return priv->status_types; |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2015 | } |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
2016 | |
| 5563 | 2017 | int |
| 15884 | 2018 | purple_account_get_int(const PurpleAccount *account, const char *name, |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2019 | int default_value) |
| 5563 | 2020 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2021 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2022 | PurpleAccountPrivate *priv; |
| 5563 | 2023 | |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2024 | g_return_val_if_fail(account != NULL, default_value); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2025 | g_return_val_if_fail(name != NULL, default_value); |
| 5563 | 2026 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2027 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2028 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2029 | setting = g_hash_table_lookup(priv->settings, name); |
| 5563 | 2030 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2031 | if (setting == NULL) |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2032 | return default_value; |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2033 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2034 | 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
|
2035 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2036 | return g_value_get_int(&setting->value); |
| 5563 | 2037 | } |
| 2038 | ||
| 2039 | const char * | |
| 15884 | 2040 | purple_account_get_string(const PurpleAccount *account, const char *name, |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2041 | const char *default_value) |
| 5563 | 2042 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2043 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2044 | PurpleAccountPrivate *priv; |
| 5563 | 2045 | |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2046 | g_return_val_if_fail(account != NULL, default_value); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2047 | g_return_val_if_fail(name != NULL, default_value); |
| 5563 | 2048 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2049 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2050 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2051 | setting = g_hash_table_lookup(priv->settings, name); |
| 5563 | 2052 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2053 | if (setting == NULL) |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2054 | return default_value; |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2055 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2056 | 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
|
2057 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2058 | return g_value_get_string(&setting->value); |
| 5563 | 2059 | } |
| 2060 | ||
| 2061 | gboolean | |
| 15884 | 2062 | purple_account_get_bool(const PurpleAccount *account, const char *name, |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2063 | gboolean default_value) |
| 5563 | 2064 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2065 | PurpleAccountSetting *setting; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2066 | PurpleAccountPrivate *priv; |
| 5563 | 2067 | |
|
5565
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2068 | g_return_val_if_fail(account != NULL, default_value); |
|
687cc390b7dc
[gaim-migrate @ 5967]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
2069 | g_return_val_if_fail(name != NULL, default_value); |
| 5563 | 2070 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2071 | priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2072 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2073 | setting = g_hash_table_lookup(priv->settings, name); |
| 5563 | 2074 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2075 | if (setting == NULL) |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2076 | return default_value; |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2077 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2078 | 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
|
2079 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2080 | return g_value_get_boolean(&setting->value); |
| 5563 | 2081 | } |
| 2082 | ||
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2083 | int |
| 15884 | 2084 | 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
|
2085 | const char *name, int default_value) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2086 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2087 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2088 | PurpleAccountPrivate *priv; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2089 | GHashTable *table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2090 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2091 | g_return_val_if_fail(account != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2092 | g_return_val_if_fail(ui != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2093 | g_return_val_if_fail(name != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2094 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2095 | 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
|
2096 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2097 | 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
|
2098 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2099 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2100 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2101 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2102 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2103 | 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
|
2104 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2105 | return g_value_get_int(&setting->value); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2106 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2107 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2108 | const char * |
| 15884 | 2109 | 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
|
2110 | const char *name, const char *default_value) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2111 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2112 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2113 | PurpleAccountPrivate *priv; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2114 | GHashTable *table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2115 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2116 | g_return_val_if_fail(account != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2117 | g_return_val_if_fail(ui != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2118 | g_return_val_if_fail(name != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2119 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2120 | 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
|
2121 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2122 | 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
|
2123 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2124 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2125 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2126 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2127 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2128 | 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
|
2129 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2130 | return g_value_get_string(&setting->value); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2131 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2132 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2133 | gboolean |
| 15884 | 2134 | 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
|
2135 | const char *name, gboolean default_value) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2136 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2137 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2138 | PurpleAccountPrivate *priv; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2139 | GHashTable *table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2140 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2141 | g_return_val_if_fail(account != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2142 | g_return_val_if_fail(ui != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2143 | g_return_val_if_fail(name != NULL, default_value); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2144 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2145 | 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
|
2146 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2147 | 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
|
2148 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2149 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2150 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2151 | return default_value; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2152 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2153 | 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
|
2154 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2155 | return g_value_get_boolean(&setting->value); |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2156 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
2157 | |
|
34682
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2158 | gpointer |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2159 | purple_account_get_ui_data(const PurpleAccount *account) |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2160 | { |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2161 | g_return_val_if_fail(account != NULL, NULL); |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2162 | |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2163 | return account->ui_data; |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2164 | } |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2165 | |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2166 | void |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2167 | purple_account_set_ui_data(PurpleAccount *account, gpointer ui_data) |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2168 | { |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2169 | g_return_if_fail(account != NULL); |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2170 | |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2171 | account->ui_data = ui_data; |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2172 | } |
|
5eed877cb061
Moved ui_data to the object structure, and added back [gs]et_ui_data() methods
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
2173 | |
| 15884 | 2174 | PurpleLog * |
| 2175 | purple_account_get_log(PurpleAccount *account, gboolean create) | |
| 8573 | 2176 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2177 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2178 | |
| 8573 | 2179 | g_return_val_if_fail(account != NULL, NULL); |
| 2180 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2181 | 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
|
2182 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2183 | if(!priv->system_log && create){ |
| 15884 | 2184 | PurplePresence *presence; |
|
11973
42a29ebcf30b
[gaim-migrate @ 14266]
Mark Doliner <markdoliner@pidgin.im>
parents:
11920
diff
changeset
|
2185 | int login_time; |
|
42a29ebcf30b
[gaim-migrate @ 14266]
Mark Doliner <markdoliner@pidgin.im>
parents:
11920
diff
changeset
|
2186 | |
| 15884 | 2187 | presence = purple_account_get_presence(account); |
| 2188 | login_time = purple_presence_get_login_time(presence); | |
| 2189 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2190 | priv->system_log = purple_log_new(PURPLE_LOG_SYSTEM, |
| 15884 | 2191 | purple_account_get_username(account), account, NULL, |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
12975
diff
changeset
|
2192 | (login_time != 0) ? login_time : time(NULL), NULL); |
| 8573 | 2193 | } |
| 2194 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2195 | return priv->system_log; |
| 8573 | 2196 | } |
| 2197 | ||
| 2198 | void | |
| 15884 | 2199 | purple_account_destroy_log(PurpleAccount *account) |
| 8573 | 2200 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2201 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2202 | |
| 8573 | 2203 | g_return_if_fail(account != NULL); |
| 2204 | ||
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2205 | 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
|
2206 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2207 | if(priv->system_log){ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2208 | 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
|
2209 | priv->system_log = NULL; |
| 8573 | 2210 | } |
| 2211 | } | |
| 2212 | ||
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
2213 | void |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2214 | 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
|
2215 | { |
| 15884 | 2216 | 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
|
2217 | 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
|
2218 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2219 | |
|
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
|
2220 | 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
|
2221 | 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
|
2222 | |
|
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
|
2223 | 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
|
2224 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2225 | 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
|
2226 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2227 | 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
|
2228 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2229 | |
|
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
|
2230 | 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
|
2231 | 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
|
2232 | 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
|
2233 | } |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2234 | } |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2235 | |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2236 | void |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2237 | 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
|
2238 | { |
| 15884 | 2239 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2240 | 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
|
2241 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2242 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2243 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2244 | 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
|
2245 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2246 | 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
|
2247 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2248 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2249 | if (prpl_info) { |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2250 | GList *cur, *groups = NULL; |
|
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 | /* Make a list of what group each buddy is in */ |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2253 | 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
|
2254 | PurpleBuddy *buddy = cur->data; |
|
647853a842da
A couple of minor fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24955
diff
changeset
|
2255 | groups = g_list_append(groups, purple_buddy_get_group(buddy)); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2256 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2257 | |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31992
diff
changeset
|
2258 | 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
|
2259 | 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
|
2260 | 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
|
2261 | 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
|
2262 | |
|
ec0856af6477
Add new functions for adding buddies with an invite message. If the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31566
diff
changeset
|
2263 | 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
|
2264 | prpl_info->add_buddy(gc, curb->data, curg->data, message); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2265 | curb = curb->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2266 | curg = curg->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2267 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2268 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2269 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2270 | g_list_free(groups); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2271 | } |
|
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_buddy(PurpleAccount *account, PurpleBuddy *buddy, |
| 2276 | PurpleGroup *group) | |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2277 | { |
| 15884 | 2278 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2279 | 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
|
2280 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2281 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2282 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2283 | 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
|
2284 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2285 | 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
|
2286 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2287 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2288 | if (prpl_info && prpl_info->remove_buddy) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2289 | prpl_info->remove_buddy(gc, buddy, group); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2290 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2291 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2292 | void |
| 15884 | 2293 | purple_account_remove_buddies(PurpleAccount *account, GList *buddies, GList *groups) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2294 | { |
| 15884 | 2295 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2296 | 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
|
2297 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2298 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2299 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2300 | 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
|
2301 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2302 | 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
|
2303 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2304 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2305 | if (prpl_info) { |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2306 | if (prpl_info->remove_buddies) |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2307 | prpl_info->remove_buddies(gc, buddies, groups); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2308 | else { |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2309 | GList *curb = buddies; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2310 | GList *curg = groups; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2311 | while ((curb != NULL) && (curg != NULL)) { |
| 15884 | 2312 | purple_account_remove_buddy(account, curb->data, curg->data); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2313 | curb = curb->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2314 | curg = curg->next; |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2315 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2316 | } |
|
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 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2320 | void |
| 15884 | 2321 | purple_account_remove_group(PurpleAccount *account, PurpleGroup *group) |
|
11643
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 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2327 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2328 | 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
|
2329 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2330 | 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
|
2331 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2332 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2333 | if (prpl_info && prpl_info->remove_group) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2334 | prpl_info->remove_group(gc, group); |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2335 | } |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2336 | |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2337 | void |
| 15884 | 2338 | purple_account_change_password(PurpleAccount *account, const char *orig_pw, |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2339 | const char *new_pw) |
|
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2340 | { |
| 15884 | 2341 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 2342 | 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
|
2343 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2344 | |
|
34029
059c1270db1f
Remove the silly destroy argument from purple_account_set_password and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34028
diff
changeset
|
2345 | purple_account_set_password(account, new_pw, NULL, NULL); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2346 | |
|
22357
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2347 | if (gc != NULL) |
|
29179
e60344f34d03
Fix some funny indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28764
diff
changeset
|
2348 | 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
|
2349 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2350 | 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
|
2351 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2352 | |
|
14669
df3f48ab4aff
[gaim-migrate @ 17335]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
2353 | if (prpl_info && prpl_info->change_passwd) |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2354 | prpl_info->change_passwd(gc, orig_pw, new_pw); |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
2355 | } |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11638
diff
changeset
|
2356 | |
| 15884 | 2357 | 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
|
2358 | { |
| 15884 | 2359 | 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
|
2360 | 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
|
2361 | PurplePlugin *prpl = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2362 | |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2363 | g_return_val_if_fail(account, FALSE); |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2364 | g_return_val_if_fail(buddy, FALSE); |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2365 | |
| 15884 | 2366 | gc = purple_account_get_connection(account); |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2367 | if (gc == NULL) |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2368 | return FALSE; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2369 | |
|
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25871
diff
changeset
|
2370 | 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
|
2371 | |
|
6f3b94a801a5
Made account.c use purple_connection_get_prpl instead of gc->prpl.
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
22235
diff
changeset
|
2372 | 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
|
2373 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
12645
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2374 | |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2375 | if (!prpl_info || !prpl_info->offline_message) |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2376 | return FALSE; |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2377 | return prpl_info->offline_message(buddy); |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2378 | } |
|
a907ba243930
[gaim-migrate @ 14983]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12420
diff
changeset
|
2379 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2380 | void |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2381 | 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
|
2382 | 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
|
2383 | { |
|
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
|
2384 | PurpleConnectionErrorInfo *old_err; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2385 | 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
|
2386 | |
|
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
|
2387 | 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
|
2388 | 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
|
2389 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2390 | 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
|
2391 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2392 | 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
|
2393 | return; |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2394 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2395 | 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
|
2396 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2397 | 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
|
2398 | "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
|
2399 | 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
|
2400 | 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
|
2401 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2402 | 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
|
2403 | 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
|
2404 | |
|
22467
151133154190
Register and unregister the PurpleConnectionErrorInfo pointers with dbus, I
Etan Reisner <deryni@pidgin.im>
parents:
22357
diff
changeset
|
2405 | 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
|
2406 | 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
|
2407 | } |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
2408 | |
|
21298
d0d9cfaf3fe7
Mark pointed out that PurpleConnectionErrorPair is not a very good name for the
Will Thompson <resiak@pidgin.im>
parents:
21295
diff
changeset
|
2409 | 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
|
2410 | 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
|
2411 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2412 | 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
|
2413 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2414 | 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
|
2415 | } |
|
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
2416 | |
|
21504
0c78851f576b
Propagating ipp to im.pidgin.cpw.resiak.disconnectreason caused
Will Thompson <resiak@pidgin.im>
parents:
21503
diff
changeset
|
2417 | void |
|
0c78851f576b
Propagating ipp to im.pidgin.cpw.resiak.disconnectreason caused
Will Thompson <resiak@pidgin.im>
parents:
21503
diff
changeset
|
2418 | 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
|
2419 | { |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2420 | 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
|
2421 | } |
|
21504
0c78851f576b
Propagating ipp to im.pidgin.cpw.resiak.disconnectreason caused
Will Thompson <resiak@pidgin.im>
parents:
21503
diff
changeset
|
2422 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2423 | static xmlnode * |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
2424 | 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
|
2425 | const PurpleStatusAttr *attr) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2426 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2427 | xmlnode *node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2428 | const char *id; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2429 | char *value = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2430 | PurpleStatusAttr *default_attr; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2431 | PurpleValue *default_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2432 | PurpleType attr_type; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2433 | PurpleValue *attr_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2434 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2435 | id = purple_status_attr_get_id(attr); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2436 | g_return_val_if_fail(id, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2437 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2438 | attr_value = purple_status_get_attr_value(status, id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2439 | g_return_val_if_fail(attr_value, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2440 | attr_type = purple_value_get_type(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2441 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2442 | /* |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2443 | * 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
|
2444 | * then don't write it to the file. |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2445 | */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2446 | default_attr = purple_status_type_get_attr(type, id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2447 | default_value = purple_status_attr_get_value(default_attr); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2448 | if (attr_type != purple_value_get_type(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 | |
|
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 | * 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
|
2453 | * 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
|
2454 | */ |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2455 | if (attr_type == PURPLE_TYPE_STRING) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2456 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2457 | const char *string_value = purple_value_get_string(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2458 | 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
|
2459 | if (purple_strequal(string_value, default_string_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2460 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2461 | value = g_strdup(purple_value_get_string(attr_value)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2462 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2463 | else if (attr_type == PURPLE_TYPE_INT) |
|
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 | int int_value = purple_value_get_int(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2466 | if (int_value == purple_value_get_int(default_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2467 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2468 | value = g_strdup_printf("%d", int_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2469 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2470 | else if (attr_type == PURPLE_TYPE_BOOLEAN) |
|
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 | gboolean boolean_value = purple_value_get_boolean(attr_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2473 | if (boolean_value == purple_value_get_boolean(default_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2474 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2475 | value = g_strdup(boolean_value ? |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2476 | "true" : "false"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2477 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2478 | else |
|
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 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2481 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2482 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2483 | g_return_val_if_fail(value, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2484 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2485 | node = xmlnode_new("attribute"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2486 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2487 | xmlnode_set_attrib(node, "id", id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2488 | xmlnode_set_attrib(node, "value", value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2489 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2490 | g_free(value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2491 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2492 | return node; |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2495 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2496 | status_attrs_to_xmlnode(const PurpleStatus *status) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2497 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2498 | PurpleStatusType *type = purple_status_get_type(status); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2499 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2500 | GList *attrs, *attr; |
|
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("attributes"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2503 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2504 | attrs = purple_status_type_get_attrs(type); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2505 | for (attr = attrs; attr != NULL; attr = attr->next) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2506 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2507 | 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
|
2508 | if (child) |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2512 | return node; |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2515 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2516 | status_to_xmlnode(const PurpleStatus *status) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2517 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2518 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2519 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2520 | node = xmlnode_new("status"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2521 | xmlnode_set_attrib(node, "type", purple_status_get_id(status)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2522 | if (purple_status_get_name(status) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2523 | xmlnode_set_attrib(node, "name", purple_status_get_name(status)); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2524 | 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
|
2525 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2526 | child = status_attrs_to_xmlnode(status); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2527 | xmlnode_insert_child(node, child); |
|
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 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2530 | } |
|
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 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2533 | statuses_to_xmlnode(const PurplePresence *presence) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2534 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2535 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2536 | GList *statuses; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2537 | PurpleStatus *status; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2538 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2539 | node = xmlnode_new("statuses"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2540 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2541 | statuses = purple_presence_get_statuses(presence); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2542 | for (; statuses != NULL; statuses = statuses->next) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2543 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2544 | status = statuses->data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2545 | 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
|
2546 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2547 | child = status_to_xmlnode(status); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2548 | xmlnode_insert_child(node, child); |
|
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 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2551 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2552 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2553 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2554 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2555 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2556 | proxy_settings_to_xmlnode(PurpleProxyInfo *proxy_info) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2557 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2558 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2559 | PurpleProxyType proxy_type; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2560 | const char *value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2561 | int int_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2562 | char buf[21]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2563 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2564 | proxy_type = purple_proxy_info_get_type(proxy_info); |
|
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 | node = xmlnode_new("proxy"); |
|
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 | child = xmlnode_new_child(node, "type"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2569 | xmlnode_insert_data(child, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2570 | (proxy_type == PURPLE_PROXY_USE_GLOBAL ? "global" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2571 | proxy_type == PURPLE_PROXY_NONE ? "none" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2572 | proxy_type == PURPLE_PROXY_HTTP ? "http" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2573 | proxy_type == PURPLE_PROXY_SOCKS4 ? "socks4" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2574 | proxy_type == PURPLE_PROXY_SOCKS5 ? "socks5" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2575 | proxy_type == PURPLE_PROXY_TOR ? "tor" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2576 | proxy_type == PURPLE_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -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 | if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2579 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2580 | child = xmlnode_new_child(node, "host"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2581 | xmlnode_insert_data(child, value, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2582 | } |
|
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 | 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
|
2585 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2586 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2587 | child = xmlnode_new_child(node, "port"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2588 | xmlnode_insert_data(child, buf, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2589 | } |
|
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 | if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2592 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2593 | child = xmlnode_new_child(node, "username"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2594 | xmlnode_insert_data(child, value, -1); |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2597 | if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
|
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 | child = xmlnode_new_child(node, "password"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2600 | xmlnode_insert_data(child, value, -1); |
|
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 | |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2606 | static xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2607 | current_error_to_xmlnode(PurpleConnectionErrorInfo *err) |
|
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 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2610 | char type_str[3]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2611 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2612 | node = xmlnode_new("current_error"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2613 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2614 | if(err == NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2615 | return node; |
|
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 | /* 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
|
2618 | * restart. |
|
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 | if(!purple_connection_error_is_fatal (err->type)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2621 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2622 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2623 | child = xmlnode_new_child(node, "type"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2624 | g_snprintf(type_str, sizeof(type_str), "%u", err->type); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2625 | xmlnode_insert_data(child, type_str, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2626 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2627 | child = xmlnode_new_child(node, "description"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2628 | if(err->description) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2629 | char *utf8ized = purple_utf8_try_convert(err->description); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2630 | if(utf8ized == NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2631 | utf8ized = purple_utf8_salvage(err->description); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2632 | xmlnode_insert_data(child, utf8ized, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2633 | g_free(utf8ized); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2634 | } |
|
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 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2637 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2638 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2639 | static void |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2640 | setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2641 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2642 | const char *name; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2643 | PurpleAccountSetting *setting; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2644 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2645 | char buf[21]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2646 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2647 | name = (const char *)key; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2648 | setting = (PurpleAccountSetting *)value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2649 | node = (xmlnode *)user_data; |
|
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 | child = xmlnode_new_child(node, "setting"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2652 | xmlnode_set_attrib(child, "name", name); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2653 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2654 | if (G_VALUE_HOLDS_INT(&setting->value)) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2655 | xmlnode_set_attrib(child, "type", "int"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2656 | 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
|
2657 | xmlnode_insert_data(child, buf, -1); |
|
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 | 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
|
2660 | xmlnode_set_attrib(child, "type", "string"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2661 | 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
|
2662 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2663 | else if (G_VALUE_HOLDS_BOOLEAN(&setting->value)) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2664 | xmlnode_set_attrib(child, "type", "bool"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2665 | 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
|
2666 | xmlnode_insert_data(child, buf, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2667 | } |
|
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 | static void |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2671 | 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
|
2672 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2673 | const char *ui; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2674 | GHashTable *table; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2675 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2676 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2677 | ui = (const char *)key; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2678 | table = (GHashTable *)value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2679 | node = (xmlnode *)user_data; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2680 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2681 | if (g_hash_table_size(table) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2682 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2683 | child = xmlnode_new_child(node, "settings"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2684 | xmlnode_set_attrib(child, "ui", ui); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2685 | g_hash_table_foreach(table, setting_to_xmlnode, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2686 | } |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2689 | xmlnode * |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2690 | purple_account_to_xmlnode(PurpleAccount *account) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2691 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2692 | xmlnode *node, *child; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2693 | const char *tmp; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2694 | PurplePresence *presence; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2695 | PurpleProxyInfo *proxy_info; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2696 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
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 | node = xmlnode_new("account"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2699 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2700 | child = xmlnode_new_child(node, "protocol"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2701 | 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
|
2702 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2703 | child = xmlnode_new_child(node, "name"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2704 | xmlnode_insert_data(child, purple_account_get_username(account), -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2705 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2706 | if (purple_account_get_remember_password(account)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2707 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2708 | const char *keyring_id = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2709 | const char *mode = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2710 | char *data = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2711 | GError *error = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2712 | GDestroyNotify destroy = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2713 | gboolean exported = purple_keyring_export_password(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2714 | &keyring_id, &mode, &data, &error, &destroy); |
|
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 | if (error != NULL) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2717 | purple_debug_error("account", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2718 | "Failed to export password for account %s: %s.\n", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2719 | purple_account_get_username(account), |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2720 | error->message); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2721 | } else if (exported) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2722 | child = xmlnode_new_child(node, "password"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2723 | if (keyring_id != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2724 | xmlnode_set_attrib(child, "keyring_id", keyring_id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2725 | if (mode != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2726 | xmlnode_set_attrib(child, "mode", mode); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2727 | if (data != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2728 | xmlnode_insert_data(child, data, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2729 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2730 | if (destroy != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2731 | destroy(data); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2732 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2733 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2734 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
2735 | if ((tmp = purple_account_get_private_alias(account)) != NULL) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2736 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2737 | child = xmlnode_new_child(node, "alias"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2738 | xmlnode_insert_data(child, tmp, -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2739 | } |
|
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 | if ((presence = purple_account_get_presence(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2742 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2743 | child = statuses_to_xmlnode(presence); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2744 | xmlnode_insert_child(node, child); |
|
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 ((tmp = purple_account_get_user_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 | /* 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
|
2750 | child = xmlnode_new_child(node, "userinfo"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2751 | xmlnode_insert_data(child, tmp, -1); |
|
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 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2754 | if (g_hash_table_size(priv->settings) > 0) |
|
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 | child = xmlnode_new_child(node, "settings"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2757 | g_hash_table_foreach(priv->settings, setting_to_xmlnode, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2758 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2759 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2760 | if (g_hash_table_size(priv->ui_settings) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2761 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2762 | 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
|
2763 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2764 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2765 | if ((proxy_info = purple_account_get_proxy_info(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2766 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2767 | child = proxy_settings_to_xmlnode(proxy_info); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2768 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2769 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2770 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2771 | child = current_error_to_xmlnode(priv->current_error); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2772 | xmlnode_insert_child(node, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2773 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2774 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2775 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2776 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2777 | /**************** |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2778 | * GObject Code * |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2779 | ****************/ |
|
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 | /* GObject Property names */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2782 | #define PROP_USERNAME_S "username" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2783 | #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
|
2784 | #define PROP_ENABLED_S "enabled" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2785 | #define PROP_CONNECTION_S "connection" |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2786 | #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
|
2787 | #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
|
2788 | #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
|
2789 | #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
|
2790 | #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
|
2791 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2792 | /* Set method for GObject properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2793 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2794 | 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
|
2795 | GParamSpec *pspec) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2796 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2797 | PurpleAccount *account = PURPLE_ACCOUNT(obj); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2798 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2799 | switch (param_id) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2800 | case PROP_USERNAME: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2801 | 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
|
2802 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2803 | 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
|
2804 | 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
|
2805 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2806 | case PROP_ENABLED: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2807 | purple_account_set_enabled(account, purple_core_get_ui(), |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2808 | 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
|
2809 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2810 | case PROP_CONNECTION: |
|
34753
b2c73469c1be
GObjectified the PurpleConnection source
Ankit Vani <a@nevitus.org>
parents:
34751
diff
changeset
|
2811 | purple_account_set_connection(account, g_value_get_object(value)); |
|
34580
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 | case PROP_PROTOCOL_ID: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2814 | 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
|
2815 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2816 | case PROP_USER_INFO: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2817 | 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
|
2818 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2819 | case PROP_BUDDY_ICON_PATH: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2820 | 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
|
2821 | g_value_get_string(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2822 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2823 | case PROP_REMEMBER_PASSWORD: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2824 | 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
|
2825 | g_value_get_boolean(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2826 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2827 | case PROP_CHECK_MAIL: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2828 | 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
|
2829 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2830 | default: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2831 | 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
|
2832 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2833 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2834 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2835 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2836 | /* Get method for GObject properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2837 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2838 | 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
|
2839 | GParamSpec *pspec) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2840 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2841 | PurpleAccount *account = PURPLE_ACCOUNT(obj); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2842 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2843 | switch (param_id) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2844 | case PROP_USERNAME: |
|
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_username(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_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
|
2848 | 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
|
2849 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2850 | case PROP_ENABLED: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2851 | g_value_set_boolean(value, purple_account_get_enabled(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2852 | purple_core_get_ui())); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2853 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2854 | case PROP_CONNECTION: |
|
34753
b2c73469c1be
GObjectified the PurpleConnection source
Ankit Vani <a@nevitus.org>
parents:
34751
diff
changeset
|
2855 | g_value_set_object(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
|
2856 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2857 | case PROP_PROTOCOL_ID: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2858 | 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
|
2859 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2860 | case PROP_USER_INFO: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2861 | 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
|
2862 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2863 | case PROP_BUDDY_ICON_PATH: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2864 | g_value_set_string(value, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2865 | 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
|
2866 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2867 | case PROP_REMEMBER_PASSWORD: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2868 | g_value_set_boolean(value, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2869 | 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
|
2870 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2871 | case PROP_CHECK_MAIL: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2872 | 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
|
2873 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2874 | default: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2875 | 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
|
2876 | break; |
|
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 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2880 | /* GObject initialization function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2881 | 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
|
2882 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2883 | PurpleAccount *account = PURPLE_ACCOUNT(instance); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2884 | 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
|
2885 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2886 | 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
|
2887 | g_free, delete_setting); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2888 | 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
|
2889 | 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
|
2890 | priv->system_log = NULL; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2891 | |
|
34590
9da48e98a77a
Renamed PurpleAccount's private member perm_deny to privacy_type
Ankit Vani <a@nevitus.org>
parents:
34589
diff
changeset
|
2892 | priv->privacy_type = PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL; |
|
34647
9e5a7a09e60e
Moved DBUS pointer registration from account_new to account_init
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
2893 | |
|
9e5a7a09e60e
Moved DBUS pointer registration from account_new to account_init
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
2894 | PURPLE_DBUS_REGISTER_POINTER(account, PurpleAccount); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2895 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2896 | |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2897 | /* Called when done constructing */ |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2898 | static void |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2899 | purple_account_constructed(GObject *object) |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2900 | { |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2901 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2902 | PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2903 | gchar *username, *protocol_id; |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2904 | PurplePlugin *prpl = NULL; |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2905 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2906 | PurpleStatusType *status_type; |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2907 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2908 | parent_class->constructed(object); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2909 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2910 | g_object_get(object, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2911 | PROP_USERNAME_S, &username, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2912 | PROP_PROTOCOL_ID_S, &protocol_id, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2913 | NULL); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2914 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2915 | purple_signal_emit(purple_accounts_get_handle(), "account-created", |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2916 | account); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2917 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2918 | prpl = purple_find_prpl(protocol_id); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2919 | if (prpl == NULL) |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2920 | return; |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2921 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2922 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2923 | if (prpl_info != NULL && prpl_info->status_types != NULL) |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2924 | purple_account_set_status_types(account, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2925 | prpl_info->status_types(account)); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2926 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2927 | priv->presence = purple_presence_new_for_account(account); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2928 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2929 | status_type = purple_account_get_status_type_with_primitive(account, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2930 | PURPLE_STATUS_AVAILABLE); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2931 | if (status_type != NULL) |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2932 | purple_presence_set_status_active(priv->presence, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2933 | purple_status_type_get_id(status_type), |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2934 | TRUE); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2935 | else |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2936 | purple_presence_set_status_active(priv->presence, |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2937 | "offline", |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2938 | TRUE); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2939 | } |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
2940 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2941 | /* GObject dispose function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2942 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2943 | purple_account_dispose(GObject *object) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2944 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2945 | GList *l; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2946 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2947 | 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
|
2948 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2949 | purple_debug_info("account", "Destroying account %p\n", account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2950 | purple_signal_emit(purple_accounts_get_handle(), "account-destroying", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
2951 | account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2952 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34647
diff
changeset
|
2953 | for (l = purple_conversations_get_all(); l != NULL; l = l->next) |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2954 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2955 | PurpleConversation *conv = (PurpleConversation *)l->data; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2956 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2957 | 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
|
2958 | 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
|
2959 | } |
|
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 | 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
|
2962 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2963 | if (priv->proxy_info) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2964 | 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
|
2965 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2966 | if (priv->presence) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2967 | purple_presence_destroy(priv->presence); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2968 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2969 | if(priv->system_log) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2970 | 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
|
2971 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2972 | if (priv->current_error) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2973 | 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
|
2974 | g_free(priv->current_error); |
|
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 | 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
|
2978 | PURPLE_DBUS_UNREGISTER_POINTER(account); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2979 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2980 | parent_class->dispose(object); |
|
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 | /* GObject finalize function */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2984 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2985 | purple_account_finalize(GObject *object) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2986 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2987 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2988 | 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
|
2989 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2990 | g_free(priv->username); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2991 | g_free(priv->alias); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2992 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2993 | g_free(priv->user_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2994 | 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
|
2995 | g_free(priv->protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2996 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
2997 | 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
|
2998 | 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
|
2999 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3000 | while (priv->deny) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3001 | g_free(priv->deny->data); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3002 | 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
|
3003 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3004 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3005 | while (priv->permit) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3006 | g_free(priv->permit->data); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3007 | 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
|
3008 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3009 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3010 | parent_class->finalize(object); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3011 | } |
|
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 | /* Class initializer function */ |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3014 | static void |
|
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3015 | purple_account_class_init(PurpleAccountClass *klass) |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3016 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3017 | 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
|
3018 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3019 | 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
|
3020 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3021 | 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
|
3022 | obj_class->finalize = purple_account_finalize; |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3023 | obj_class->constructed = purple_account_constructed; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3024 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3025 | /* Setup properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3026 | 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
|
3027 | 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
|
3028 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3029 | 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
|
3030 | 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
|
3031 | _("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
|
3032 | 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
|
3033 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3034 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3035 | 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
|
3036 | 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
|
3037 | _("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
|
3038 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3039 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3040 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3041 | 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
|
3042 | 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
|
3043 | _("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
|
3044 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3045 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3046 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3047 | 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
|
3048 | 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
|
3049 | _("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
|
3050 | G_PARAM_READWRITE) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3051 | ); |
|
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 | 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
|
3054 | 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
|
3055 | _("Whether the account is enabled or not."), FALSE, |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3056 | G_PARAM_READWRITE) |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3057 | ); |
|
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_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
|
3060 | 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
|
3061 | _("Whether to remember and store the password for this account."), FALSE, |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3062 | G_PARAM_READWRITE) |
|
34580
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 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3065 | 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
|
3066 | 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
|
3067 | _("Whether to check mails for this account."), FALSE, |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3068 | G_PARAM_READWRITE) |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3069 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3070 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3071 | g_object_class_install_property(obj_class, PROP_CONNECTION, |
|
34753
b2c73469c1be
GObjectified the PurpleConnection source
Ankit Vani <a@nevitus.org>
parents:
34751
diff
changeset
|
3072 | g_param_spec_object(PROP_CONNECTION_S, _("Connection"), |
|
b2c73469c1be
GObjectified the PurpleConnection source
Ankit Vani <a@nevitus.org>
parents:
34751
diff
changeset
|
3073 | _("The connection for the account."), PURPLE_TYPE_CONNECTION, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3074 | G_PARAM_READWRITE) |
|
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 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3077 | 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
|
3078 | 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
|
3079 | _("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
|
3080 | 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
|
3081 | ); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3082 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3083 | 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
|
3084 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3085 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3086 | GType |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3087 | purple_account_get_type(void) |
|
6368
ab9f99269dfe
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
3088 | { |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3089 | static GType type = 0; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3090 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3091 | if(type == 0) { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3092 | static const GTypeInfo info = { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3093 | sizeof(PurpleAccountClass), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3094 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3095 | NULL, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3096 | (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
|
3097 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3098 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3099 | sizeof(PurpleAccount), |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3100 | 0, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3101 | (GInstanceInitFunc)purple_account_init, |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3102 | NULL, |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3103 | }; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3104 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3105 | 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
|
3106 | "PurpleAccount", |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3107 | &info, 0); |
|
5943
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
3108 | } |
|
8a052155157a
[gaim-migrate @ 6384]
Christian Hammond <chipx86@chipx86.com>
parents:
5942
diff
changeset
|
3109 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
3110 | return type; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
3111 | } |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3112 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3113 | PurpleAccount * |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3114 | 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
|
3115 | { |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3116 | PurpleAccount *account; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3117 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3118 | 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
|
3119 | 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
|
3120 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3121 | 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
|
3122 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3123 | if (account != NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3124 | return account; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3125 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3126 | account = g_object_new(PURPLE_TYPE_ACCOUNT, |
|
34685
1690f822fbdd
Use purple_account_constructed as a GObject constructed method to initialize account by parameters
Ankit Vani <a@nevitus.org>
parents:
34682
diff
changeset
|
3127 | PROP_USERNAME_S, username, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3128 | 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
|
3129 | NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3130 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3131 | return account; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
3132 | } |