Thu, 03 Dec 2020 04:34:04 -0600
Fix the PurpleProtocolClient interface and split it out to its own file.
Testing Done:
Compile and unit tests.
Reviewed at https://reviews.imfreedom.org/r/193/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20093
diff
changeset
|
1 | /* purple |
| 5563 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
6 | * |
| 5563 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * 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
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5563 | 20 | */ |
|
40441
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
21 | |
|
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
22 | #include <glib/gi18n-lib.h> |
|
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
23 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
24 | #include "internal.h" |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
25 | |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
26 | #include "accounts.h" |
|
11053
6d2abb51e586
[gaim-migrate @ 12991]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11042
diff
changeset
|
27 | #include "core.h" |
| 5717 | 28 | #include "debug.h" |
| 14758 | 29 | #include "network.h" |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
30 | #include "notify.h" |
| 8235 | 31 | #include "pounce.h" |
| 5563 | 32 | #include "prefs.h" |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40521
diff
changeset
|
33 | #include "purpleaccountpresence.h" |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40332
diff
changeset
|
34 | #include "purpleprivate.h" |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
35 | #include "purpleprotocolclient.h" |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
36 | #include "request.h" |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9720
diff
changeset
|
37 | #include "server.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
38 | #include "signals.h" |
| 5717 | 39 | #include "util.h" |
| 5563 | 40 | |
|
39663
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
41 | /** |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
42 | * PurpleAccount: |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
43 | * |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
44 | * Structure representing an account. |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
45 | */ |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
46 | struct _PurpleAccount |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
47 | { |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
48 | GObject gparent; |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
49 | }; |
|
d3c442966920
Remove PurpleAccount->ui_data and accessors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39514
diff
changeset
|
50 | |
|
21287
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
51 | typedef struct |
|
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
52 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
53 | char *username; /* The username. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
54 | char *alias; /* How you appear to yourself. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
55 | char *password; /* The account password. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
56 | char *user_info; /* User information. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
57 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
58 | char *buddy_icon_path; /* The buddy icon's non-cached path. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
59 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
60 | gboolean remember_pass; /* Remember the password. */ |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
61 | |
|
34593
318dcc5ef8e8
Added reminder to replace protocol_id member of account by a GObject
Ankit Vani <a@nevitus.org>
parents:
34591
diff
changeset
|
62 | /* |
|
318dcc5ef8e8
Added reminder to replace protocol_id member of account by a GObject
Ankit Vani <a@nevitus.org>
parents:
34591
diff
changeset
|
63 | * 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
|
64 | * 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
|
65 | */ |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
66 | char *protocol_id; /* The ID of the protocol. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
67 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
68 | PurpleConnection *gc; /* The connection handle. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
69 | gboolean disconnecting; /* The account is currently disconnecting */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
70 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
71 | GHashTable *settings; /* Protocol-specific settings. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
72 | GHashTable *ui_settings; /* UI-specific settings. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
73 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
74 | PurpleProxyInfo *proxy_info; /* Proxy information. This will be set */ |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
75 | /* 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
|
76 | /* proxy settings from global prefs. */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
77 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
78 | /* |
|
35152
bedba98d98f2
Change this comment to say that we should use a single, good-enough data
Mark Doliner <mark@kingant.net>
parents:
35150
diff
changeset
|
79 | * TODO: Instead of linked lists for permit and deny, use a data |
|
bedba98d98f2
Change this comment to say that we should use a single, good-enough data
Mark Doliner <mark@kingant.net>
parents:
35150
diff
changeset
|
80 | * structure that allows fast lookups AND decent performance when |
|
bedba98d98f2
Change this comment to say that we should use a single, good-enough data
Mark Doliner <mark@kingant.net>
parents:
35150
diff
changeset
|
81 | * iterating through all items. Fast lookups should help performance |
|
bedba98d98f2
Change this comment to say that we should use a single, good-enough data
Mark Doliner <mark@kingant.net>
parents:
35150
diff
changeset
|
82 | * for protocols like MSN, where all your buddies exist in your permit |
|
bedba98d98f2
Change this comment to say that we should use a single, good-enough data
Mark Doliner <mark@kingant.net>
parents:
35150
diff
changeset
|
83 | * list therefore the permit list is large. Possibly GTree or |
|
bedba98d98f2
Change this comment to say that we should use a single, good-enough data
Mark Doliner <mark@kingant.net>
parents:
35150
diff
changeset
|
84 | * GHashTable. |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
85 | */ |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
86 | GSList *permit; /* Permit list. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
87 | GSList *deny; /* Deny list. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
88 | PurpleAccountPrivacyType privacy_type; /* The permit/deny setting. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
89 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
90 | GList *status_types; /* Status types. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
91 | |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
92 | PurplePresence *presence; /* Presence. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
93 | PurpleLog *system_log; /* The system log */ |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
94 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
95 | PurpleAccountRegistrationCb registration_cb; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
96 | void *registration_cb_user_data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
97 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
98 | PurpleConnectionErrorInfo *current_error; /* Errors */ |
|
21287
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
99 | } PurpleAccountPrivate; |
|
c4971408eae8
Make PurpleAccount keep track of the last connection error suffered (or not, if
Will Thompson <resiak@pidgin.im>
parents:
21233
diff
changeset
|
100 | |
| 5563 | 101 | typedef struct |
| 102 | { | |
|
5777
2b4e8214a7cd
[gaim-migrate @ 6202]
Christian Hammond <chipx86@chipx86.com>
parents:
5742
diff
changeset
|
103 | char *ui; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
104 | GValue value; |
| 5563 | 105 | |
| 15884 | 106 | } PurpleAccountSetting; |
| 5563 | 107 | |
|
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
|
108 | 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
|
109 | { |
| 15884 | 110 | PurpleAccountRequestType type; |
| 111 | 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
|
112 | void *ui_handle; |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
113 | char *user; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
114 | gpointer userdata; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
115 | PurpleAccountRequestAuthorizationCb auth_cb; |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
116 | 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
|
117 | guint ref; |
| 15884 | 118 | } PurpleAccountRequestInfo; |
| 119 | ||
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
120 | typedef struct |
|
11249
efc82f3e1bd3
[gaim-migrate @ 13418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11247
diff
changeset
|
121 | { |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
122 | 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
|
123 | 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
|
124 | } 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
|
125 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
126 | /* GObject Property enums */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
127 | enum |
|
10427
2ea1412bc75f
[gaim-migrate @ 11679]
Mark Doliner <markdoliner@pidgin.im>
parents:
10426
diff
changeset
|
128 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
129 | PROP_0, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
130 | PROP_USERNAME, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
131 | PROP_PRIVATE_ALIAS, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
132 | PROP_ENABLED, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
133 | PROP_CONNECTION, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
134 | PROP_PROTOCOL_ID, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
135 | PROP_USER_INFO, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
136 | PROP_BUDDY_ICON_PATH, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
137 | PROP_REMEMBER_PASSWORD, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
138 | PROP_CHECK_MAIL, |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
139 | PROP_LAST |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
140 | }; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
141 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
142 | static GParamSpec *properties[PROP_LAST]; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
143 | static GList *handles = NULL; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
144 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
145 | G_DEFINE_TYPE_WITH_PRIVATE(PurpleAccount, purple_account, G_TYPE_OBJECT); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
146 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
147 | /****************************************************************************** |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
148 | * Helpers |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
149 | *****************************************************************************/ |
|
30740
017077f79a0f
jabber: Unify "Require TLS" and "Use old-style (port 5223) SSL" settings
Paul Aurich <darkrain42@pidgin.im>
parents:
30708
diff
changeset
|
150 | static void |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
151 | 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
|
152 | const gchar *password, GError *error, gpointer data) |
|
10427
2ea1412bc75f
[gaim-migrate @ 11679]
Mark Doliner <markdoliner@pidgin.im>
parents:
10426
diff
changeset
|
153 | { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
154 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
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 | _purple_connection_new(account, TRUE, password); |
|
17814
c47c22006b0d
Implemented a callback for a successful registration, supplying the username and password to the application when available, in the way explained by Sean.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
157 | } |
|
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
|
158 | |
|
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
|
159 | void |
| 15884 | 160 | purple_account_register(PurpleAccount *account) |
| 6581 | 161 | { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
162 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
| 6581 | 163 | |
| 15884 | 164 | purple_debug_info("account", "Registering account %s\n", |
| 165 | purple_account_get_username(account)); | |
| 166 | ||
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34134
diff
changeset
|
167 | 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
|
168 | purple_account_register_got_password_cb, NULL); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
169 | } |
| 6581 | 170 | |
|
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
|
171 | static void |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
172 | 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
|
173 | 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
|
174 | { |
|
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
|
175 | PurpleCallbackBundle *cbb = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
176 | PurpleAccountUnregistrationCb cb; |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
177 | |
|
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
|
178 | 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
|
179 | _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
|
180 | |
|
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 | g_free(cbb); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
182 | } |
| 6581 | 183 | |
|
34992
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
184 | struct register_completed_closure |
|
32721
3a64afbc2da2
Introduce purple_account_register_completed() to handle the invoking of any
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
185 | { |
|
34992
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
186 | PurpleAccount *account; |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
187 | gboolean succeeded; |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
188 | }; |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
189 | |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
190 | static gboolean |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
191 | purple_account_register_completed_cb(gpointer data) |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
192 | { |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
193 | struct register_completed_closure *closure = data; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
194 | PurpleAccountPrivate *priv; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
195 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
196 | priv = purple_account_get_instance_private(closure->account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
197 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
198 | if (priv->registration_cb) |
|
34992
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
199 | (priv->registration_cb)(closure->account, closure->succeeded, |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
200 | priv->registration_cb_user_data); |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
201 | |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
202 | g_object_unref(closure->account); |
|
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
203 | g_free(closure); |
|
34991
63c14353a0f4
Manage refcounts in some libpurple callbacks
Ankit Vani <a@nevitus.org>
parents:
34990
diff
changeset
|
204 | |
|
34990
6e2b46ef6743
Add a timeout for calling registration callback.
Ankit Vani <a@nevitus.org>
parents:
34987
diff
changeset
|
205 | return FALSE; |
|
6e2b46ef6743
Add a timeout for calling registration callback.
Ankit Vani <a@nevitus.org>
parents:
34987
diff
changeset
|
206 | } |
|
6e2b46ef6743
Add a timeout for calling registration callback.
Ankit Vani <a@nevitus.org>
parents:
34987
diff
changeset
|
207 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
208 | static void |
| 15884 | 209 | request_password_ok_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
210 | { |
|
11042
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
211 | const char *entry; |
|
d1ccf8d8a187
[gaim-migrate @ 12954]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11033
diff
changeset
|
212 | gboolean remember; |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
213 | |
| 15884 | 214 | entry = purple_request_fields_get_string(fields, "password"); |
| 215 | remember = purple_request_fields_get_bool(fields, "remember"); | |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11982
diff
changeset
|
216 | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
217 | if (!entry || !*entry) |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
218 | { |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
219 | purple_notify_error(account, NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
220 | _("Password is required to sign on."), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
221 | purple_request_cpar_from_account(account)); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
222 | return; |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
223 | } |
| 6581 | 224 | |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
225 | 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
|
226 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
227 | 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
|
228 | _purple_connection_new(account, FALSE, entry); |
| 6581 | 229 | } |
| 230 | ||
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
231 | static void |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
232 | request_password_cancel_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
233 | { |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30456
diff
changeset
|
234 | /* Disable the account as the user has cancelled connecting */ |
|
20093
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
235 | purple_account_set_enabled(account, purple_core_get_ui(), FALSE); |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
236 | } |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
237 | |
|
04f3c1dcd2cf
applied changes from 5fda75104115d0a95c1e214b6b3ca18c4dc86a0c
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
238 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
239 | static void |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
240 | 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
|
241 | 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
|
242 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36364
diff
changeset
|
243 | PurpleProtocol *protocol = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
244 | |
|
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
|
245 | if ((password == NULL || *password == '\0') && |
|
36607
7ad7681dcfd8
Use purple_protocol_get_* API instead of protocol->member
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
246 | !(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD) && |
|
7ad7681dcfd8
Use purple_protocol_get_* API instead of protocol->member
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
247 | !(purple_protocol_get_options(protocol) & 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
|
248 | 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
|
249 | 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
|
250 | 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
|
251 | else |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
252 | _purple_connection_new(account, FALSE, password); |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
253 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
254 | |
|
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
|
255 | 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
|
256 | 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
|
257 | { |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
258 | 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
|
259 | 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
|
260 | |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
261 | /* 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
|
262 | 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
|
263 | 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
|
264 | 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
|
265 | } |
|
eacb566127a7
Use ref-counting to prevent a crash if request-auth callbacks are called
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25079
diff
changeset
|
266 | |
|
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
|
267 | static void |
| 15884 | 268 | 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
|
269 | { |
| 15884 | 270 | PurpleAccountUiOps *ops; |
| 271 | ||
| 272 | 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
|
273 | |
|
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
|
274 | 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
|
275 | 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
|
276 | |
|
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
|
277 | 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
|
278 | } |
|
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
|
279 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
280 | static void |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
281 | 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
|
282 | { |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
283 | 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
|
284 | |
|
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
|
285 | 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
|
286 | |
|
29046
1cae96b8e674
*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465):
Daniel Atallah <datallah@pidgin.im>
parents:
28764
diff
changeset
|
287 | 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
|
288 | 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
|
289 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
290 | 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
|
291 | "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
|
292 | |
|
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
|
293 | 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
|
294 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
295 | |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
296 | static void |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
297 | 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
|
298 | { |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
299 | 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
|
300 | |
|
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
|
301 | 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
|
302 | |
|
29046
1cae96b8e674
*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465):
Daniel Atallah <datallah@pidgin.im>
parents:
28764
diff
changeset
|
303 | 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
|
304 | 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
|
305 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
306 | 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
|
307 | "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
|
308 | |
|
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
|
309 | 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
|
310 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20379
diff
changeset
|
311 | |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
312 | static void |
| 15884 | 313 | change_password_cb(PurpleAccount *account, PurpleRequestFields *fields) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
314 | { |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
315 | const char *orig_pass, *new_pass_1, *new_pass_2; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
316 | |
| 15884 | 317 | orig_pass = purple_request_fields_get_string(fields, "password"); |
| 318 | new_pass_1 = purple_request_fields_get_string(fields, "new_password_1"); | |
| 319 | 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
|
320 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
321 | if (g_utf8_collate(new_pass_1, new_pass_2)) |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
322 | { |
| 15884 | 323 | purple_notify_error(account, NULL, |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
324 | _("New passwords do not match."), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
325 | purple_request_cpar_from_account(account)); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
326 | |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
327 | return; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
328 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
329 | |
|
22854
0002c0556d57
Allow changing to or from an empty password when the protocol specifies
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22484
diff
changeset
|
330 | 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
|
331 | (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
|
332 | (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
|
333 | (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
|
334 | (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
|
335 | (new_pass_2 == NULL || *new_pass_2 == '\0'))) |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
336 | { |
| 15884 | 337 | purple_notify_error(account, NULL, |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
338 | _("Fill out all fields completely."), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
339 | purple_request_cpar_from_account(account)); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
340 | return; |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
341 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
342 | |
| 15884 | 343 | purple_account_change_password(account, orig_pass, new_pass_1); |
|
7063
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
344 | } |
|
4bfe512a4b8c
[gaim-migrate @ 7627]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
345 | |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
346 | static void |
| 15884 | 347 | set_user_info_cb(PurpleAccount *account, const char *user_info) |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
348 | { |
| 15884 | 349 | PurpleConnection *gc; |
| 350 | ||
| 351 | purple_account_set_user_info(account, user_info); | |
| 352 | gc = purple_account_get_connection(account); | |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35475
diff
changeset
|
353 | purple_serv_set_info(gc, user_info); |
|
7067
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
354 | } |
|
c57295414efa
[gaim-migrate @ 7631]
Christian Hammond <chipx86@chipx86.com>
parents:
7063
diff
changeset
|
355 | |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
356 | 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
|
357 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
358 | 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
|
359 | 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
|
360 | }; |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
361 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
362 | 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
|
363 | 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
|
364 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
365 | 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
|
366 | 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
|
367 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
368 | 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
|
369 | _("This protocol does not support setting a public alias.")); |
|
34991
63c14353a0f4
Manage refcounts in some libpurple callbacks
Ankit Vani <a@nevitus.org>
parents:
34990
diff
changeset
|
370 | |
|
63c14353a0f4
Manage refcounts in some libpurple callbacks
Ankit Vani <a@nevitus.org>
parents:
34990
diff
changeset
|
371 | g_object_unref(closure->account); |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
372 | 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
|
373 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
374 | 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
|
375 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
376 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
377 | 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
|
378 | 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
|
379 | { |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
380 | 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
|
381 | 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
|
382 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
383 | 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
|
384 | _("This protocol does not support fetching the public alias.")); |
|
34991
63c14353a0f4
Manage refcounts in some libpurple callbacks
Ankit Vani <a@nevitus.org>
parents:
34990
diff
changeset
|
385 | |
|
34992
aba8b8e624c2
Replaced array with closure struct for registration callback
Ankit Vani <a@nevitus.org>
parents:
34991
diff
changeset
|
386 | g_object_unref(closure->account); |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
387 | 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
|
388 | |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
389 | 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
|
390 | } |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30021
diff
changeset
|
391 | |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
392 | static void |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
393 | delete_setting(void *data) |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
394 | { |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
395 | PurpleAccountSetting *setting = (PurpleAccountSetting *)data; |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
396 | |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
397 | g_free(setting->ui); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
398 | 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
|
399 | |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
400 | g_free(setting); |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
401 | } |
|
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
402 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
403 | static GHashTable * |
| 15884 | 404 | get_ui_settings_table(PurpleAccount *account, const char *ui) |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
405 | { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
406 | GHashTable *table; |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
407 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
408 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
409 | table = g_hash_table_lookup(priv->ui_settings, ui); |
|
5979
d51d697d27fb
[gaim-migrate @ 6426]
Christian Hammond <chipx86@chipx86.com>
parents:
5977
diff
changeset
|
410 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
411 | if (table == NULL) { |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
412 | 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
|
413 | delete_setting); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
414 | 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
|
415 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
416 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
417 | return table; |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
418 | } |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5777
diff
changeset
|
419 | |
| 15884 | 420 | static PurpleConnectionState |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
421 | purple_account_get_state(PurpleAccount *account) |
| 5563 | 422 | { |
| 15884 | 423 | PurpleConnection *gc; |
| 424 | ||
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
425 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), PURPLE_CONNECTION_DISCONNECTED); |
| 15884 | 426 | |
| 427 | gc = purple_account_get_connection(account); | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
428 | if (!gc) |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34745
diff
changeset
|
429 | return PURPLE_CONNECTION_DISCONNECTED; |
| 15884 | 430 | |
| 431 | return purple_connection_get_state(gc); | |
|
11251
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
432 | } |
|
e38d86958a63
[gaim-migrate @ 13420]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11249
diff
changeset
|
433 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
434 | static void |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
435 | 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
|
436 | const gchar *password, GError *error, gpointer data) |
| 5563 | 437 | { |
|
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
|
438 | PurpleCallbackBundle *cbb = data; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
439 | PurpleKeyringReadCallback cb; |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
440 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
441 | |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
442 | purple_debug_info("account", |
|
34170
94102637e7c7
Coding style and entry description for GNOME Keyring
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34165
diff
changeset
|
443 | "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
|
444 | purple_account_get_username(account)); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
445 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
446 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
447 | priv->password = g_strdup(password); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
448 | |
|
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
|
449 | cb = (PurpleKeyringReadCallback)cbb->cb; |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
450 | 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
|
451 | 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
|
452 | |
|
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
453 | g_free(cbb); |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
454 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
455 | |
|
35458
385156e1b493
Fix some gtk-doc warnings from account to connection
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
456 | /* |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
457 | * 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
|
458 | * 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
|
459 | */ |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
460 | static void |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
461 | 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
|
462 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
463 | GSList *list; |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
464 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34574
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
465 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
466 | /* 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
|
467 | 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
|
468 | char *person = list->data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
469 | list = list->next; |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
470 | 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
|
471 | 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
|
472 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
473 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
474 | /* 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
|
475 | 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
|
476 | while (list != NULL) |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
477 | { |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
478 | PurpleBuddy *buddy = list->data; |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
479 | 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
|
480 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
481 | 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
|
482 | 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
|
483 | 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
|
484 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
485 | } |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
486 | |
|
19850cd1b2de
Begun GObjectification of PurpleAccount. Moved things around, see details.
Ankit Vani <a@nevitus.org>
parents:
34196
diff
changeset
|
487 | void |
|
34767
38a5613c3e26
Prepended functions private to a subsystem but used over multiple files by underscore
Ankit Vani <a@nevitus.org>
parents:
34765
diff
changeset
|
488 | _purple_account_set_current_error(PurpleAccount *account, |
|
34582
67a520874aa9
Exposed some functions to the header files to resolve dependencies.
Ankit Vani <a@nevitus.org>
parents:
34581
diff
changeset
|
489 | PurpleConnectionErrorInfo *new_err) |
|
29992
9fee90090b04
account: Add copies of connection signed-(on|off) and connection-error.
Yonas Yanfa <yonas.yanfa@gmail.com>
parents:
29726
diff
changeset
|
490 | { |
|
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
|
491 | PurpleConnectionErrorInfo *old_err; |
|
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
|
492 | PurpleAccountPrivate *priv; |
|
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
|
493 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
494 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
495 | priv = purple_account_get_instance_private(account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
496 | |
|
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
|
497 | 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
|
498 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
499 | 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
|
500 | return; |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
501 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
502 | priv->current_error = new_err; |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
503 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
504 | 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
|
505 | "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
|
506 | 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
|
507 | 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
|
508 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
509 | 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
|
510 | 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
|
511 | |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
512 | 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
|
513 | } |
|
5ce063b1c3a7
Extract setting an account's current error to a static function. In the
Will Thompson <resiak@pidgin.im>
parents:
21311
diff
changeset
|
514 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
515 | /****************************************************************************** |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
516 | * XmlNode Helpers |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
517 | *****************************************************************************/ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
518 | static PurpleXmlNode * |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
519 | status_attribute_to_xmlnode(PurpleStatus *status, PurpleStatusType *type, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
520 | PurpleStatusAttribute *attr) |
|
5710
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
521 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
522 | PurpleXmlNode *node; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
523 | const char *id; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
524 | char *value = NULL; |
|
34858
28ac3a0418f1
Renamed PurpleStatusAttr to PurpleStatusAttribute for simplicity.
Ankit Vani <a@nevitus.org>
parents:
34855
diff
changeset
|
525 | PurpleStatusAttribute *default_attr; |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
526 | GValue *default_value; |
|
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
527 | GType attr_type; |
|
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
528 | GValue *attr_value; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
529 | |
|
34858
28ac3a0418f1
Renamed PurpleStatusAttr to PurpleStatusAttribute for simplicity.
Ankit Vani <a@nevitus.org>
parents:
34855
diff
changeset
|
530 | id = purple_status_attribute_get_id(attr); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
531 | g_return_val_if_fail(id, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
532 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
533 | attr_value = purple_status_get_attr_value(status, id); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
534 | g_return_val_if_fail(attr_value, NULL); |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
535 | attr_type = G_VALUE_TYPE(attr_value); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
536 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
537 | /* |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
538 | * 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
|
539 | * then don't write it to the file. |
|
21300
1c23e08cb824
Document exactly how long the PurpleConnectionErrorInfo pointers given out by
Will Thompson <resiak@pidgin.im>
parents:
21298
diff
changeset
|
540 | */ |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
541 | default_attr = purple_status_type_get_attr(type, id); |
|
34858
28ac3a0418f1
Renamed PurpleStatusAttr to PurpleStatusAttribute for simplicity.
Ankit Vani <a@nevitus.org>
parents:
34855
diff
changeset
|
542 | default_value = purple_status_attribute_get_value(default_attr); |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
543 | if (attr_type != G_VALUE_TYPE(default_value)) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
544 | return NULL; |
|
6368
ab9f99269dfe
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
545 | |
| 14971 | 546 | /* |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
547 | * 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
|
548 | * then there is no need to write it to the file. |
| 14971 | 549 | */ |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
550 | if (attr_type == G_TYPE_STRING) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
551 | { |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
552 | const char *string_value = g_value_get_string(attr_value); |
|
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
553 | const char *default_string_value = g_value_get_string(default_value); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
554 | if (purple_strequal(string_value, default_string_value)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
555 | return NULL; |
|
39423
6b457e717666
Use g_value_dup_string where needed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
556 | value = g_value_dup_string(attr_value); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
557 | } |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
558 | else if (attr_type == G_TYPE_INT) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
559 | { |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
560 | int int_value = g_value_get_int(attr_value); |
|
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
561 | if (int_value == g_value_get_int(default_value)) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
562 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
563 | value = g_strdup_printf("%d", int_value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
564 | } |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
565 | else if (attr_type == G_TYPE_BOOLEAN) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
566 | { |
|
34812
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
567 | gboolean boolean_value = g_value_get_boolean(attr_value); |
|
3d6f7d9dc21d
Refactored account, buddylist, certificate to use GType and GValue instead of PurpleType and PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34769
diff
changeset
|
568 | if (boolean_value == g_value_get_boolean(default_value)) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
569 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
570 | value = g_strdup(boolean_value ? |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
571 | "true" : "false"); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
572 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
573 | else |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
574 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
575 | return NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
576 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
577 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
578 | g_return_val_if_fail(value, NULL); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
579 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
580 | node = purple_xmlnode_new("attribute"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
581 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
582 | purple_xmlnode_set_attrib(node, "id", id); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
583 | purple_xmlnode_set_attrib(node, "value", value); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
584 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
585 | g_free(value); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
586 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
587 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
588 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
589 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
590 | static PurpleXmlNode * |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
591 | status_attrs_to_xmlnode(PurpleStatus *status) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
592 | { |
|
34855
9c289149eed4
Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents:
34844
diff
changeset
|
593 | PurpleStatusType *type = purple_status_get_status_type(status); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
594 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
595 | GList *attrs, *attr; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
596 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
597 | node = purple_xmlnode_new("attributes"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
598 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
599 | attrs = purple_status_type_get_attrs(type); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
600 | for (attr = attrs; attr != NULL; attr = attr->next) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
601 | { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
602 | child = status_attribute_to_xmlnode(status, type, (PurpleStatusAttribute *)attr->data); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
603 | if (child) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
604 | purple_xmlnode_insert_child(node, child); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
605 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
606 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
607 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
608 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
609 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
610 | static PurpleXmlNode * |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
611 | status_to_xmlnode(PurpleStatus *status) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
612 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
613 | PurpleXmlNode *node, *child; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
614 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
615 | node = purple_xmlnode_new("status"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
616 | purple_xmlnode_set_attrib(node, "type", purple_status_get_id(status)); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
617 | if (purple_status_get_name(status) != NULL) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
618 | purple_xmlnode_set_attrib(node, "name", purple_status_get_name(status)); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
619 | purple_xmlnode_set_attrib(node, "active", purple_status_is_active(status) ? "true" : "false"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
620 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
621 | child = status_attrs_to_xmlnode(status); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
622 | purple_xmlnode_insert_child(node, child); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
623 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
624 | return node; |
|
5710
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
625 | } |
|
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
626 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
627 | static PurpleXmlNode * |
|
39435
b30e04a71ecf
Use G_DEFINE_TYPE_WITH_PRIVATE for Purple*Presence.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
628 | statuses_to_xmlnode(PurplePresence *presence) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
629 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
630 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
631 | GList *statuses; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
632 | PurpleStatus *status; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
633 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
634 | node = purple_xmlnode_new("statuses"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
635 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
636 | statuses = purple_presence_get_statuses(presence); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
637 | for (; statuses != NULL; statuses = statuses->next) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
638 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
639 | status = statuses->data; |
|
34855
9c289149eed4
Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents:
34844
diff
changeset
|
640 | if (purple_status_type_is_saveable(purple_status_get_status_type(status))) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
641 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
642 | child = status_to_xmlnode(status); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
643 | purple_xmlnode_insert_child(node, child); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
644 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
645 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
646 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
647 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
648 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
649 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
650 | static PurpleXmlNode * |
|
38745
f4376b1f4682
A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
38620
diff
changeset
|
651 | proxy_settings_to_xmlnode(const PurpleProxyInfo *proxy_info) |
|
5710
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
652 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
653 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
654 | PurpleProxyType proxy_type; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
655 | const char *value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
656 | int int_value; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
657 | char buf[21]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
658 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35178
diff
changeset
|
659 | proxy_type = purple_proxy_info_get_proxy_type(proxy_info); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
660 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
661 | node = purple_xmlnode_new("proxy"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
662 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
663 | child = purple_xmlnode_new_child(node, "type"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
664 | purple_xmlnode_insert_data(child, |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
665 | (proxy_type == PURPLE_PROXY_USE_GLOBAL ? "global" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
666 | proxy_type == PURPLE_PROXY_NONE ? "none" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
667 | proxy_type == PURPLE_PROXY_HTTP ? "http" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
668 | proxy_type == PURPLE_PROXY_SOCKS4 ? "socks4" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
669 | proxy_type == PURPLE_PROXY_SOCKS5 ? "socks5" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
670 | proxy_type == PURPLE_PROXY_TOR ? "tor" : |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
671 | proxy_type == PURPLE_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
672 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
673 | if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
674 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
675 | child = purple_xmlnode_new_child(node, "host"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
676 | purple_xmlnode_insert_data(child, value, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
677 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
678 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
679 | if ((int_value = purple_proxy_info_get_port(proxy_info)) != 0) |
|
24955
77727fac30c6
Finish off the libpurple updates for the hidden blist structs
Gary Kramlich <grim@reaperworld.com>
parents:
24569
diff
changeset
|
680 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
681 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
682 | child = purple_xmlnode_new_child(node, "port"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
683 | purple_xmlnode_insert_data(child, buf, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
684 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
685 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
686 | if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
687 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
688 | child = purple_xmlnode_new_child(node, "username"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
689 | purple_xmlnode_insert_data(child, value, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
690 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
691 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
692 | if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
693 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
694 | child = purple_xmlnode_new_child(node, "password"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
695 | purple_xmlnode_insert_data(child, value, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
696 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
697 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
698 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
699 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
700 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
701 | static PurpleXmlNode * |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
702 | current_error_to_xmlnode(PurpleConnectionErrorInfo *err) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
703 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
704 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
705 | char type_str[3]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
706 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
707 | node = purple_xmlnode_new("current_error"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
708 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
709 | if(err == NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
710 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
711 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
712 | /* 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
|
713 | * restart. |
|
21300
1c23e08cb824
Document exactly how long the PurpleConnectionErrorInfo pointers given out by
Will Thompson <resiak@pidgin.im>
parents:
21298
diff
changeset
|
714 | */ |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
715 | if(!purple_connection_error_is_fatal (err->type)) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
716 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
717 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
718 | child = purple_xmlnode_new_child(node, "type"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
719 | g_snprintf(type_str, sizeof(type_str), "%u", err->type); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
720 | purple_xmlnode_insert_data(child, type_str, -1); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
721 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
722 | child = purple_xmlnode_new_child(node, "description"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
723 | if(err->description) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
724 | char *utf8ized = purple_utf8_try_convert(err->description); |
|
40519
974dbfd7e52f
Remove and replace a number of the purple utility functions
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
725 | if(utf8ized == NULL) { |
|
974dbfd7e52f
Remove and replace a number of the purple utility functions
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
726 | utf8ized = g_utf8_make_valid(err->description, -1); |
|
974dbfd7e52f
Remove and replace a number of the purple utility functions
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
727 | } |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
728 | purple_xmlnode_insert_data(child, utf8ized, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
729 | g_free(utf8ized); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
730 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
731 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
732 | return node; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
733 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
734 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
735 | static void |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
736 | setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
737 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
738 | const char *name; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
739 | PurpleAccountSetting *setting; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
740 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
741 | char buf[21]; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
742 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
743 | name = (const char *)key; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
744 | setting = (PurpleAccountSetting *)value; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
745 | node = (PurpleXmlNode *)user_data; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
746 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
747 | child = purple_xmlnode_new_child(node, "setting"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
748 | purple_xmlnode_set_attrib(child, "name", name); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
749 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
750 | if (G_VALUE_HOLDS_INT(&setting->value)) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
751 | purple_xmlnode_set_attrib(child, "type", "int"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
752 | g_snprintf(buf, sizeof(buf), "%d", g_value_get_int(&setting->value)); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
753 | purple_xmlnode_insert_data(child, buf, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
754 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
755 | else if (G_VALUE_HOLDS_STRING(&setting->value) && g_value_get_string(&setting->value) != NULL) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
756 | purple_xmlnode_set_attrib(child, "type", "string"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
757 | purple_xmlnode_insert_data(child, g_value_get_string(&setting->value), -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
758 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
759 | else if (G_VALUE_HOLDS_BOOLEAN(&setting->value)) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
760 | purple_xmlnode_set_attrib(child, "type", "bool"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
761 | g_snprintf(buf, sizeof(buf), "%d", g_value_get_boolean(&setting->value)); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
762 | purple_xmlnode_insert_data(child, buf, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
763 | } |
|
6368
ab9f99269dfe
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
764 | } |
|
ab9f99269dfe
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
765 | |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
766 | static void |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
767 | ui_setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
768 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
769 | const char *ui; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
770 | GHashTable *table; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
771 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
772 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
773 | ui = (const char *)key; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
774 | table = (GHashTable *)value; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
775 | node = (PurpleXmlNode *)user_data; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
776 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
777 | if (g_hash_table_size(table) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
778 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
779 | child = purple_xmlnode_new_child(node, "settings"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
780 | purple_xmlnode_set_attrib(child, "ui", ui); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
781 | g_hash_table_foreach(table, setting_to_xmlnode, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
782 | } |
|
34057
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
783 | } |
|
3b2c52789769
Clean up account.c changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34056
diff
changeset
|
784 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
785 | PurpleXmlNode * |
|
35178
7c775624f964
Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents:
35152
diff
changeset
|
786 | _purple_account_to_xmlnode(PurpleAccount *account) |
|
6368
ab9f99269dfe
[gaim-migrate @ 6873]
Christian Hammond <chipx86@chipx86.com>
parents:
6367
diff
changeset
|
787 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
788 | PurpleXmlNode *node, *child; |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
789 | const char *tmp; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
790 | PurplePresence *presence; |
|
38745
f4376b1f4682
A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
38620
diff
changeset
|
791 | const PurpleProxyInfo *proxy_info; |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
792 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
793 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
794 | node = purple_xmlnode_new("account"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
795 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
796 | child = purple_xmlnode_new_child(node, "protocol"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
797 | purple_xmlnode_insert_data(child, purple_account_get_protocol_id(account), -1); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
798 | |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
799 | child = purple_xmlnode_new_child(node, "name"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
800 | purple_xmlnode_insert_data(child, purple_account_get_username(account), -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
801 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
802 | if (purple_account_get_remember_password(account)) |
|
24955
77727fac30c6
Finish off the libpurple updates for the hidden blist structs
Gary Kramlich <grim@reaperworld.com>
parents:
24569
diff
changeset
|
803 | { |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
804 | const char *keyring_id = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
805 | const char *mode = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
806 | char *data = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
807 | GError *error = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
808 | GDestroyNotify destroy = NULL; |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
809 | gboolean exported = purple_keyring_export_password(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
810 | &keyring_id, &mode, &data, &error, &destroy); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
811 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
812 | if (error != NULL) { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
813 | purple_debug_error("account", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
814 | "Failed to export password for account %s: %s.\n", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
815 | purple_account_get_username(account), |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
816 | error->message); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
817 | } else if (exported) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
818 | child = purple_xmlnode_new_child(node, "password"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
819 | if (keyring_id != NULL) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
820 | purple_xmlnode_set_attrib(child, "keyring_id", keyring_id); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
821 | if (mode != NULL) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
822 | purple_xmlnode_set_attrib(child, "mode", mode); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
823 | if (data != NULL) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
824 | purple_xmlnode_insert_data(child, data, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
825 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
826 | if (destroy != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
827 | destroy(data); |
|
6367
721511f43350
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
828 | } |
|
721511f43350
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
829 | } |
|
721511f43350
[gaim-migrate @ 6872]
Christian Hammond <chipx86@chipx86.com>
parents:
6366
diff
changeset
|
830 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34582
diff
changeset
|
831 | if ((tmp = purple_account_get_private_alias(account)) != NULL) |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
832 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
833 | child = purple_xmlnode_new_child(node, "alias"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
834 | purple_xmlnode_insert_data(child, tmp, -1); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
835 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
836 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
837 | if ((presence = purple_account_get_presence(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
838 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
839 | child = statuses_to_xmlnode(presence); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
840 | purple_xmlnode_insert_child(node, child); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
841 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
842 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
843 | if ((tmp = purple_account_get_user_info(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
844 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
845 | /* TODO: Do we need to call purple_str_strip_char(tmp, '\r') here? */ |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
34996
diff
changeset
|
846 | child = purple_xmlnode_new_child(node, "user-info"); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
847 | purple_xmlnode_insert_data(child, tmp, -1); |
|
18636
34c1a17a91d7
Do not crash if you delete an account with an open conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
848 | } |
|
34c1a17a91d7
Do not crash if you delete an account with an open conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
849 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
850 | if (g_hash_table_size(priv->settings) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
851 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
852 | child = purple_xmlnode_new_child(node, "settings"); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
853 | g_hash_table_foreach(priv->settings, setting_to_xmlnode, child); |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
854 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
855 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
856 | if (g_hash_table_size(priv->ui_settings) > 0) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
857 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
858 | 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
|
859 | } |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
860 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
861 | if ((proxy_info = purple_account_get_proxy_info(account)) != NULL) |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
862 | { |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
863 | child = proxy_settings_to_xmlnode(proxy_info); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
864 | purple_xmlnode_insert_child(node, child); |
|
18636
34c1a17a91d7
Do not crash if you delete an account with an open conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
865 | } |
|
34c1a17a91d7
Do not crash if you delete an account with an open conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
866 | |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
867 | child = current_error_to_xmlnode(priv->current_error); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
868 | purple_xmlnode_insert_child(node, child); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
869 | |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
870 | return node; |
|
5710
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
871 | } |
|
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
872 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
873 | /****************************************************************************** |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
874 | * GObject Implementation |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
875 | *****************************************************************************/ |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
876 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
877 | 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
|
878 | GParamSpec *pspec) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
879 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
880 | PurpleAccount *account = PURPLE_ACCOUNT(obj); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
881 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
882 | switch (param_id) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
883 | case PROP_USERNAME: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
884 | 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
|
885 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
886 | 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
|
887 | 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
|
888 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
889 | case PROP_ENABLED: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
890 | purple_account_set_enabled(account, purple_core_get_ui(), |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
891 | 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
|
892 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
893 | case PROP_CONNECTION: |
|
34753
b2c73469c1be
GObjectified the PurpleConnection source
Ankit Vani <a@nevitus.org>
parents:
34751
diff
changeset
|
894 | 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
|
895 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
896 | case PROP_PROTOCOL_ID: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
897 | 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
|
898 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
899 | case PROP_USER_INFO: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
900 | 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
|
901 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
902 | case PROP_BUDDY_ICON_PATH: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
903 | 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
|
904 | g_value_get_string(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
905 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
906 | case PROP_REMEMBER_PASSWORD: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
907 | 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
|
908 | g_value_get_boolean(value)); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
909 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
910 | case PROP_CHECK_MAIL: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
911 | 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
|
912 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
913 | default: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
914 | 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
|
915 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
916 | } |
|
5710
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
917 | } |
|
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5707
diff
changeset
|
918 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
919 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
920 | 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
|
921 | GParamSpec *pspec) |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
922 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
923 | PurpleAccount *account = PURPLE_ACCOUNT(obj); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
924 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
925 | switch (param_id) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
926 | case PROP_USERNAME: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
927 | 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
|
928 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
929 | 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
|
930 | 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
|
931 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
932 | case PROP_ENABLED: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
933 | g_value_set_boolean(value, purple_account_get_enabled(account, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
934 | purple_core_get_ui())); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
935 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
936 | case PROP_CONNECTION: |
|
34753
b2c73469c1be
GObjectified the PurpleConnection source
Ankit Vani <a@nevitus.org>
parents:
34751
diff
changeset
|
937 | 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
|
938 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
939 | case PROP_PROTOCOL_ID: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
940 | 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
|
941 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
942 | case PROP_USER_INFO: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
943 | 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
|
944 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
945 | case PROP_BUDDY_ICON_PATH: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
946 | g_value_set_string(value, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
947 | 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
|
948 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
949 | case PROP_REMEMBER_PASSWORD: |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
950 | g_value_set_boolean(value, |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
951 | 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
|
952 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
953 | case PROP_CHECK_MAIL: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
954 | 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
|
955 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
956 | default: |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
957 | 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
|
958 | break; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
959 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
960 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
961 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
962 | static void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
963 | purple_account_init(PurpleAccount *account) |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
964 | { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
965 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
966 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
967 | 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
|
968 | g_free, delete_setting); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
969 | 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
|
970 | 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
|
971 | priv->system_log = NULL; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
972 | |
|
34590
9da48e98a77a
Renamed PurpleAccount's private member perm_deny to privacy_type
Ankit Vani <a@nevitus.org>
parents:
34589
diff
changeset
|
973 | priv->privacy_type = PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
974 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
975 | |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
976 | static void |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
977 | purple_account_constructed(GObject *object) |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
978 | { |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
979 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
980 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
981 | gchar *username, *protocol_id; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36364
diff
changeset
|
982 | PurpleProtocol *protocol = NULL; |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
983 | PurpleStatusType *status_type; |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
984 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
985 | G_OBJECT_CLASS(purple_account_parent_class)->constructed(object); |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
986 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
987 | g_object_get(object, |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
34996
diff
changeset
|
988 | "username", &username, |
|
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
34996
diff
changeset
|
989 | "protocol-id", &protocol_id, |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
990 | NULL); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
991 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
992 | 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
|
993 | account); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
994 | |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36623
diff
changeset
|
995 | protocol = purple_protocols_find(protocol_id); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36364
diff
changeset
|
996 | if (protocol == NULL) { |
|
34769
427725f8ed54
Free strings received from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34767
diff
changeset
|
997 | g_free(username); |
|
427725f8ed54
Free strings received from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34767
diff
changeset
|
998 | g_free(protocol_id); |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
999 | return; |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1000 | } |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1001 | |
|
36720
465f02116328
Refactored account, blistnodetypes, buddylist, connection to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1002 | purple_account_set_status_types(account, |
|
465f02116328
Refactored account, blistnodetypes, buddylist, connection to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1003 | purple_protocol_class_status_types(protocol, account)); |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1004 | |
|
34844
e341dbc04539
Refactored plugins, account, blistnodetypes to use the GObject presence API
Ankit Vani <a@nevitus.org>
parents:
34838
diff
changeset
|
1005 | priv->presence = PURPLE_PRESENCE(purple_account_presence_new(account)); |
|
34686
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1006 | |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1007 | 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
|
1008 | PURPLE_STATUS_AVAILABLE); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1009 | if (status_type != NULL) |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1010 | 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
|
1011 | 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
|
1012 | TRUE); |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1013 | else |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1014 | 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
|
1015 | "offline", |
|
61cb35479ea9
Moved purple_account_constructed() above dispose and finalize
Ankit Vani <a@nevitus.org>
parents:
34685
diff
changeset
|
1016 | TRUE); |
|
34769
427725f8ed54
Free strings received from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34767
diff
changeset
|
1017 | |
|
427725f8ed54
Free strings received from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34767
diff
changeset
|
1018 | g_free(username); |
|
427725f8ed54
Free strings received from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34767
diff
changeset
|
1019 | g_free(protocol_id); |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5574
diff
changeset
|
1020 | } |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5565
diff
changeset
|
1021 | |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1022 | static void |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1023 | purple_account_dispose(GObject *object) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1024 | { |
|
35512
8d6f1349b57a
Fix crash on wrong password (backout 0f0d6ae2fb77)
Ankit Vani <a@nevitus.org>
parents:
35499
diff
changeset
|
1025 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1026 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
35512
8d6f1349b57a
Fix crash on wrong password (backout 0f0d6ae2fb77)
Ankit Vani <a@nevitus.org>
parents:
35499
diff
changeset
|
1027 | |
|
8d6f1349b57a
Fix crash on wrong password (backout 0f0d6ae2fb77)
Ankit Vani <a@nevitus.org>
parents:
35499
diff
changeset
|
1028 | if (!purple_account_is_disconnected(account)) |
|
8d6f1349b57a
Fix crash on wrong password (backout 0f0d6ae2fb77)
Ankit Vani <a@nevitus.org>
parents:
35499
diff
changeset
|
1029 | purple_account_disconnect(account); |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1030 | |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1031 | if (priv->presence) { |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1032 | g_object_unref(priv->presence); |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1033 | priv->presence = NULL; |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1034 | } |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1035 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1036 | G_OBJECT_CLASS(purple_account_parent_class)->dispose(object); |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1037 | } |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1038 | |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1039 | static void |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
1040 | purple_account_finalize(GObject *object) |
| 5563 | 1041 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1042 | GList *l; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1043 | PurpleAccount *account = PURPLE_ACCOUNT(object); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1044 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1045 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1046 | purple_debug_info("account", "Destroying account %p\n", account); |
|
34581
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1047 | purple_signal_emit(purple_accounts_get_handle(), "account-destroying", |
|
b4e0236019e6
Fixed more PurpleAccount stuff.
Ankit Vani <a@nevitus.org>
parents:
34580
diff
changeset
|
1048 | account); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1049 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34647
diff
changeset
|
1050 | 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
|
1051 | { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1052 | PurpleConversation *conv = (PurpleConversation *)l->data; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1053 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1054 | 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
|
1055 | 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
|
1056 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1057 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1058 | 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
|
1059 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1060 | if (priv->proxy_info) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1061 | 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
|
1062 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1063 | if(priv->system_log) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1064 | 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
|
1065 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1066 | if (priv->current_error) { |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1067 | 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
|
1068 | g_free(priv->current_error); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1069 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1070 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1071 | g_free(priv->username); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1072 | g_free(priv->alias); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1073 | purple_str_wipe(priv->password); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1074 | g_free(priv->user_info); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1075 | 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
|
1076 | g_free(priv->protocol_id); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1077 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1078 | 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
|
1079 | 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
|
1080 | |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
1081 | g_slist_free_full(priv->deny, g_free); |
|
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
1082 | g_slist_free_full(priv->permit, g_free); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1083 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1084 | G_OBJECT_CLASS(purple_account_parent_class)->finalize(object); |
| 5563 | 1085 | } |
|
5874
5e19273d3c6f
[gaim-migrate @ 6306]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1086 | |
|
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
|
1087 | 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
|
1088 | purple_account_class_init(PurpleAccountClass *klass) |
|
11053
6d2abb51e586
[gaim-migrate @ 12991]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11042
diff
changeset
|
1089 | { |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1090 | 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
|
1091 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1092 | 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
|
1093 | 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
|
1094 | 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
|
1095 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1096 | /* Setup properties */ |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1097 | 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
|
1098 | 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
|
1099 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1100 | properties[PROP_USERNAME] = g_param_spec_string("username", "Username", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35010
diff
changeset
|
1101 | "The username for the account.", NULL, |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1102 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1103 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1104 | properties[PROP_PRIVATE_ALIAS] = g_param_spec_string("private-alias", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1105 | "Private Alias", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35010
diff
changeset
|
1106 | "The private alias for the account.", NULL, |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1107 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1108 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1109 | properties[PROP_USER_INFO] = g_param_spec_string("user-info", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1110 | "User information", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35010
diff
changeset
|
1111 | "Detailed user information for the account.", NULL, |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1112 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1113 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1114 | properties[PROP_BUDDY_ICON_PATH] = g_param_spec_string("buddy-icon-path", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1115 | "Buddy icon path", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1116 | "Path to the buddyicon for the account.", NULL, |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1117 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1118 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1119 | properties[PROP_ENABLED] = g_param_spec_boolean("enabled", "Enabled", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1120 | "Whether the account is enabled or not.", FALSE, |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1121 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1122 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1123 | properties[PROP_REMEMBER_PASSWORD] = g_param_spec_boolean( |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1124 | "remember-password", "Remember password", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1125 | "Whether to remember and store the password for this account.", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1126 | FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1127 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1128 | properties[PROP_CHECK_MAIL] = g_param_spec_boolean("check-mail", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1129 | "Check mail", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1130 | "Whether to check mails for this account.", FALSE, |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1131 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1132 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1133 | properties[PROP_CONNECTION] = g_param_spec_object("connection", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1134 | "Connection", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1135 | "The connection for the account.", PURPLE_TYPE_CONNECTION, |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1136 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1137 | |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1138 | properties[PROP_PROTOCOL_ID] = g_param_spec_string("protocol-id", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1139 | "Protocol ID", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35010
diff
changeset
|
1140 | "ID of the protocol that is responsible for the account.", NULL, |
|
35066
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
1141 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
1142 | G_PARAM_STATIC_STRINGS); |
|
35085
abab0adfa0ec
libpurple: use g_object_class_install_properties instead of repeated g_object_class_install_property
Ankit Vani <a@nevitus.org>
parents:
35080
diff
changeset
|
1143 | |
|
abab0adfa0ec
libpurple: use g_object_class_install_properties instead of repeated g_object_class_install_property
Ankit Vani <a@nevitus.org>
parents:
35080
diff
changeset
|
1144 | g_object_class_install_properties(obj_class, PROP_LAST, properties); |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1145 | } |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1146 | |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1147 | /****************************************************************************** |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1148 | * Public API |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1149 | *****************************************************************************/ |
| 15884 | 1150 | PurpleAccount * |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1151 | purple_account_new(const char *username, const char *protocol_id) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1152 | { |
|
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
|
1153 | PurpleAccount *account; |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1154 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1155 | 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
|
1156 | 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
|
1157 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1158 | 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
|
1159 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1160 | if (account != NULL) |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1161 | return account; |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1162 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1163 | account = g_object_new(PURPLE_TYPE_ACCOUNT, |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
34996
diff
changeset
|
1164 | "username", username, |
|
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
34996
diff
changeset
|
1165 | "protocol-id", protocol_id, |
|
34580
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1166 | NULL); |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1167 | |
|
ab3f70aaaf17
Added GObject code to PurpleAccount. Changed PurpleAccountSetting to GValue.
Ankit Vani <a@nevitus.org>
parents:
34579
diff
changeset
|
1168 | return account; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
1169 | } |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1170 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1171 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1172 | purple_account_connect(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1173 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1174 | const char *username; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1175 | PurpleProtocol *protocol; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1176 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1177 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1178 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1179 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1180 | username = purple_account_get_username(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1181 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1182 | if (!purple_account_get_enabled(account, purple_core_get_ui())) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1183 | purple_debug_info("account", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1184 | "Account %s not enabled, not connecting.\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1185 | username); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1186 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1187 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1188 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1189 | protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1190 | if (protocol == NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1191 | gchar *message; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1192 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1193 | message = g_strdup_printf(_("Missing protocol for %s"), username); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1194 | purple_notify_error(account, _("Connection Error"), message, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1195 | NULL, purple_request_cpar_from_account(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1196 | g_free(message); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1197 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1198 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1199 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1200 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1201 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1202 | purple_debug_info("account", "Connecting to account %s.\n", username); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1203 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1204 | if (priv->password != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1205 | purple_account_connect_got_password_cb(account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1206 | priv->password, NULL, protocol); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1207 | } else { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1208 | purple_keyring_get_password(account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1209 | purple_account_connect_got_password_cb, protocol); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1210 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1211 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1212 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1213 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1214 | purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1215 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1216 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1217 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1218 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1219 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1220 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1221 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1222 | priv->registration_cb = cb; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1223 | priv->registration_cb_user_data = user_data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1224 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1225 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1226 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1227 | purple_account_register_completed(PurpleAccount *account, gboolean succeeded) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1228 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1229 | struct register_completed_closure *closure; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1230 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1231 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1232 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1233 | closure = g_new0(struct register_completed_closure, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1234 | closure->account = g_object_ref(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1235 | closure->succeeded = succeeded; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1236 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1237 | g_timeout_add(0, purple_account_register_completed_cb, closure); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1238 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1239 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1240 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1241 | purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1242 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1243 | PurpleCallbackBundle *cbb; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1244 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1245 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1246 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1247 | purple_debug_info("account", "Unregistering account %s\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1248 | purple_account_get_username(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1249 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1250 | cbb = g_new0(PurpleCallbackBundle, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1251 | cbb->cb = PURPLE_CALLBACK(cb); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1252 | cbb->data = user_data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1253 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1254 | purple_keyring_get_password(account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1255 | purple_account_unregister_got_password_cb, cbb); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1256 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1257 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1258 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1259 | purple_account_disconnect(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1260 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1261 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1262 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1263 | const char *username; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1264 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1265 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1266 | g_return_if_fail(!purple_account_is_disconnecting(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1267 | g_return_if_fail(!purple_account_is_disconnected(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1268 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1269 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1270 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1271 | username = purple_account_get_username(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1272 | purple_debug_info("account", "Disconnecting account %s (%p)\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1273 | username ? username : "(null)", account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1274 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1275 | priv->disconnecting = TRUE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1276 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1277 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1278 | g_object_unref(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1279 | purple_account_set_connection(account, NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1280 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1281 | priv->disconnecting = FALSE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1282 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1283 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1284 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1285 | purple_account_is_disconnecting(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1286 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1287 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1288 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1289 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1290 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1291 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1292 | return priv->disconnecting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1293 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1294 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1295 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1296 | purple_account_notify_added(PurpleAccount *account, const char *remote_user, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1297 | const char *id, const char *alias, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1298 | const char *message) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1299 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1300 | PurpleAccountUiOps *ui_ops; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1301 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1302 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1303 | g_return_if_fail(remote_user != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1304 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1305 | ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1306 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1307 | if (ui_ops != NULL && ui_ops->notify_added != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1308 | ui_ops->notify_added(account, remote_user, id, alias, message); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1309 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1310 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1311 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1312 | purple_account_request_add(PurpleAccount *account, const char *remote_user, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1313 | const char *id, const char *alias, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1314 | const char *message) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1315 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1316 | PurpleAccountUiOps *ui_ops; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1317 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1318 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1319 | g_return_if_fail(remote_user != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1320 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1321 | ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1322 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1323 | if (ui_ops != NULL && ui_ops->request_add != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1324 | ui_ops->request_add(account, remote_user, id, alias, message); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1325 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1326 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1327 | void * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1328 | purple_account_request_authorization(PurpleAccount *account, const char *remote_user, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1329 | const char *id, const char *alias, const char *message, gboolean on_list, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1330 | PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1331 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1332 | PurpleAccountUiOps *ui_ops; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1333 | PurpleAccountRequestInfo *info; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1334 | int plugin_return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1335 | char *response = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1336 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1337 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1338 | g_return_val_if_fail(remote_user != NULL, NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1339 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1340 | ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1341 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1342 | plugin_return = GPOINTER_TO_INT( |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1343 | purple_signal_emit_return_1( |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1344 | purple_accounts_get_handle(), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1345 | "account-authorization-requested", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1346 | account, remote_user, message, &response |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1347 | )); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1348 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1349 | switch (plugin_return) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1350 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1351 | case PURPLE_ACCOUNT_RESPONSE_IGNORE: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1352 | g_free(response); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1353 | return NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1354 | case PURPLE_ACCOUNT_RESPONSE_ACCEPT: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1355 | if (auth_cb != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1356 | auth_cb(response, user_data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1357 | g_free(response); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1358 | return NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1359 | case PURPLE_ACCOUNT_RESPONSE_DENY: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1360 | if (deny_cb != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1361 | deny_cb(response, user_data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1362 | g_free(response); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1363 | return NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1364 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1365 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1366 | g_free(response); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1367 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1368 | if (ui_ops != NULL && ui_ops->request_authorize != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1369 | info = g_new0(PurpleAccountRequestInfo, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1370 | info->type = PURPLE_ACCOUNT_REQUEST_AUTHORIZATION; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1371 | info->account = account; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1372 | info->auth_cb = auth_cb; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1373 | info->deny_cb = deny_cb; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1374 | info->userdata = user_data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1375 | info->user = g_strdup(remote_user); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1376 | info->ref = 2; /* We hold an extra ref to make sure info remains valid |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1377 | if any of the callbacks are called synchronously. We |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1378 | unref it after the function call */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1379 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1380 | info->ui_handle = ui_ops->request_authorize(account, remote_user, id, alias, message, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1381 | on_list, request_auth_cb, request_deny_cb, info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1382 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1383 | info = purple_account_request_info_unref(info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1384 | if (info) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1385 | handles = g_list_append(handles, info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1386 | return info->ui_handle; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1387 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1388 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1389 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1390 | return NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1391 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1392 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1393 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1394 | purple_account_request_close_with_account(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1395 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1396 | GList *l, *l_next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1397 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1398 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1399 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1400 | for (l = handles; l != NULL; l = l_next) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1401 | PurpleAccountRequestInfo *info = l->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1402 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1403 | l_next = l->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1404 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1405 | if (info->account == account) { |
|
40079
a37a1e349491
Replace g_[s]list_remove with g_[s]list_delete_link.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40052
diff
changeset
|
1406 | handles = g_list_delete_link(handles, l); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1407 | purple_account_request_close_info(info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1408 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1409 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1410 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1411 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1412 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1413 | purple_account_request_close(void *ui_handle) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1414 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1415 | GList *l, *l_next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1416 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1417 | g_return_if_fail(ui_handle != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1418 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1419 | for (l = handles; l != NULL; l = l_next) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1420 | PurpleAccountRequestInfo *info = l->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1421 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1422 | l_next = l->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1423 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1424 | if (info->ui_handle == ui_handle) { |
|
40079
a37a1e349491
Replace g_[s]list_remove with g_[s]list_delete_link.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40052
diff
changeset
|
1425 | handles = g_list_delete_link(handles, l); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1426 | purple_account_request_close_info(info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1427 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1428 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1429 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1430 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1431 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1432 | purple_account_request_password(PurpleAccount *account, GCallback ok_cb, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1433 | GCallback cancel_cb, void *user_data) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1434 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1435 | gchar *primary; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1436 | const gchar *username; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1437 | PurpleRequestFieldGroup *group; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1438 | PurpleRequestField *field; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1439 | PurpleRequestFields *fields; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1440 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1441 | /* Close any previous password request windows */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1442 | purple_request_close_with_handle(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1443 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1444 | username = purple_account_get_username(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1445 | primary = g_strdup_printf(_("Enter password for %s (%s)"), username, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1446 | purple_account_get_protocol_name(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1447 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1448 | fields = purple_request_fields_new(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1449 | group = purple_request_field_group_new(NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1450 | purple_request_fields_add_group(fields, group); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1451 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1452 | field = purple_request_field_string_new("password", _("Enter Password"), NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1453 | purple_request_field_string_set_masked(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1454 | purple_request_field_set_required(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1455 | purple_request_field_group_add_field(group, field); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1456 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1457 | field = purple_request_field_bool_new("remember", _("Save password"), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1458 | purple_request_field_group_add_field(group, field); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1459 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1460 | purple_request_fields(account, NULL, primary, NULL, fields, _("OK"), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1461 | ok_cb, _("Cancel"), cancel_cb, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1462 | purple_request_cpar_from_account(account), user_data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1463 | g_free(primary); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1464 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1465 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1466 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1467 | purple_account_request_change_password(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1468 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1469 | PurpleRequestFields *fields; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1470 | PurpleRequestFieldGroup *group; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1471 | PurpleRequestField *field; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1472 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1473 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1474 | char primary[256]; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1475 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1476 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1477 | g_return_if_fail(purple_account_is_connected(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1478 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1479 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1480 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1481 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1482 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1483 | fields = purple_request_fields_new(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1484 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1485 | group = purple_request_field_group_new(NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1486 | purple_request_fields_add_group(fields, group); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1487 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1488 | field = purple_request_field_string_new("password", _("Original password"), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1489 | NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1490 | purple_request_field_string_set_masked(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1491 | if (!protocol || !(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1492 | purple_request_field_set_required(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1493 | purple_request_field_group_add_field(group, field); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1494 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1495 | field = purple_request_field_string_new("new_password_1", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1496 | _("New password"), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1497 | NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1498 | purple_request_field_string_set_masked(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1499 | if (!protocol || !(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1500 | purple_request_field_set_required(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1501 | purple_request_field_group_add_field(group, field); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1502 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1503 | field = purple_request_field_string_new("new_password_2", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1504 | _("New password (again)"), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1505 | NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1506 | purple_request_field_string_set_masked(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1507 | if (!protocol || !(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1508 | purple_request_field_set_required(field, TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1509 | purple_request_field_group_add_field(group, field); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1510 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1511 | g_snprintf(primary, sizeof(primary), _("Change password for %s"), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1512 | purple_account_get_username(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1513 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1514 | /* I'm sticking this somewhere in the code: bologna */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1515 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1516 | purple_request_fields(purple_account_get_connection(account), NULL, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1517 | primary, _("Please enter your current password and your new " |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1518 | "password."), fields, _("OK"), G_CALLBACK(change_password_cb), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1519 | _("Cancel"), NULL, purple_request_cpar_from_account(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1520 | account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1521 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1522 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1523 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1524 | purple_account_request_change_user_info(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1525 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1526 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1527 | char primary[256]; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1528 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1529 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1530 | g_return_if_fail(purple_account_is_connected(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1531 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1532 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1533 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1534 | g_snprintf(primary, sizeof(primary), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1535 | _("Change user information for %s"), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1536 | purple_account_get_username(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1537 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1538 | purple_request_input(gc, _("Set User Info"), primary, NULL, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1539 | purple_account_get_user_info(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1540 | TRUE, FALSE, ((gc != NULL) && |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1541 | (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_HTML) ? "html" : NULL), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1542 | _("Save"), G_CALLBACK(set_user_info_cb), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1543 | _("Cancel"), NULL, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1544 | purple_request_cpar_from_account(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1545 | account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1546 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1547 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1548 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1549 | purple_account_set_username(PurpleAccount *account, const char *username) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1550 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1551 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1552 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1553 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1554 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1555 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1556 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1557 | g_free(priv->username); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1558 | priv->username = g_strdup(username); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1559 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1560 | g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_USERNAME]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1561 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1562 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1563 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1564 | /* if the name changes, we should re-write the buddy list |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1565 | * to disk with the new name */ |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
1566 | purple_blist_save_account(purple_blist_get_default(), account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1567 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1568 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1569 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1570 | purple_account_set_password(PurpleAccount *account, const gchar *password, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1571 | PurpleKeyringSaveCallback cb, gpointer data) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1572 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1573 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1574 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1575 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1576 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1577 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1578 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1579 | purple_str_wipe(priv->password); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1580 | priv->password = g_strdup(password); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1581 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1582 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1583 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1584 | if (!purple_account_get_remember_password(account)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1585 | purple_debug_info("account", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1586 | "Password for %s set, not sent to keyring.\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1587 | purple_account_get_username(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1588 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1589 | if (cb != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1590 | cb(account, NULL, data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1591 | } else { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1592 | purple_keyring_set_password(account, password, cb, data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1593 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1594 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1595 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1596 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1597 | purple_account_set_private_alias(PurpleAccount *account, const char *alias) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1598 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1599 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1600 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1601 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1602 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1603 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1604 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1605 | /* |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1606 | * Do nothing if alias and priv->alias are both NULL. Or if |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1607 | * they're the exact same string. |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1608 | */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1609 | if (alias == priv->alias) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1610 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1611 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1612 | if ((!alias && priv->alias) || (alias && !priv->alias) || |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1613 | g_utf8_collate(priv->alias, alias)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1614 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1615 | char *old = priv->alias; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1616 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1617 | priv->alias = g_strdup(alias); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1618 | g_object_notify_by_pspec(G_OBJECT(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1619 | properties[PROP_PRIVATE_ALIAS]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1620 | purple_signal_emit(purple_accounts_get_handle(), "account-alias-changed", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1621 | account, old); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1622 | g_free(old); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1623 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1624 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1625 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1626 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1627 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1628 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1629 | purple_account_set_user_info(PurpleAccount *account, const char *user_info) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1630 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1631 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1632 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1633 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1634 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1635 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1636 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1637 | g_free(priv->user_info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1638 | priv->user_info = g_strdup(user_info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1639 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1640 | g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_USER_INFO]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1641 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1642 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1643 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1644 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1645 | void purple_account_set_buddy_icon_path(PurpleAccount *account, const char *path) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1646 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1647 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1648 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1649 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1650 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1651 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1652 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1653 | g_free(priv->buddy_icon_path); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1654 | priv->buddy_icon_path = g_strdup(path); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1655 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1656 | g_object_notify_by_pspec(G_OBJECT(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1657 | properties[PROP_BUDDY_ICON_PATH]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1658 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1659 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1660 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1661 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1662 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1663 | purple_account_set_protocol_id(PurpleAccount *account, const char *protocol_id) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1664 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1665 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1666 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1667 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1668 | g_return_if_fail(protocol_id != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1669 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1670 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1671 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1672 | g_free(priv->protocol_id); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1673 | priv->protocol_id = g_strdup(protocol_id); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1674 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1675 | g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_PROTOCOL_ID]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1676 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1677 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1678 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1679 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1680 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1681 | purple_account_set_connection(PurpleAccount *account, PurpleConnection *gc) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1682 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1683 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1684 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1685 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1686 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1687 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1688 | priv->gc = gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1689 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1690 | g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_CONNECTION]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1691 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1692 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1693 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1694 | purple_account_set_remember_password(PurpleAccount *account, gboolean value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1695 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1696 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1697 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1698 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1699 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1700 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1701 | priv->remember_pass = value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1702 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1703 | g_object_notify_by_pspec(G_OBJECT(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1704 | properties[PROP_REMEMBER_PASSWORD]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1705 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1706 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1707 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1708 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1709 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1710 | purple_account_set_check_mail(PurpleAccount *account, gboolean value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1711 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1712 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1713 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1714 | purple_account_set_bool(account, "check-mail", value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1715 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1716 | g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_CHECK_MAIL]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1717 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1718 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1719 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1720 | purple_account_set_enabled(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1721 | gboolean value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1722 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1723 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1724 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1725 | gboolean was_enabled = FALSE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1726 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1727 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1728 | g_return_if_fail(ui != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1729 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1730 | was_enabled = purple_account_get_enabled(account, ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1731 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1732 | purple_account_set_ui_bool(account, ui, "auto-login", value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1733 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1734 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1735 | if(was_enabled && !value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1736 | purple_signal_emit(purple_accounts_get_handle(), "account-disabled", account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1737 | else if(!was_enabled && value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1738 | purple_signal_emit(purple_accounts_get_handle(), "account-enabled", account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1739 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1740 | g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_ENABLED]); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1741 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1742 | if ((gc != NULL) && (_purple_connection_wants_to_die(gc))) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1743 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1744 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1745 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1746 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1747 | if (value && purple_presence_is_online(priv->presence)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1748 | purple_account_connect(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1749 | else if (!value && !purple_account_is_disconnected(account)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1750 | purple_account_disconnect(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1751 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1752 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1753 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1754 | purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1755 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1756 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1757 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1758 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1759 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1760 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1761 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1762 | if (priv->proxy_info != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1763 | purple_proxy_info_destroy(priv->proxy_info); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1764 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1765 | priv->proxy_info = info; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1766 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1767 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1768 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1769 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1770 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1771 | purple_account_set_privacy_type(PurpleAccount *account, PurpleAccountPrivacyType privacy_type) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1772 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1773 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1774 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1775 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1776 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1777 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1778 | priv->privacy_type = privacy_type; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1779 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1780 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1781 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1782 | purple_account_set_status_types(PurpleAccount *account, GList *status_types) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1783 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1784 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1785 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1786 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1787 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1788 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1789 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1790 | /* Out with the old... */ |
|
39897
16b440d4ab36
Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39782
diff
changeset
|
1791 | g_list_free_full(priv->status_types, |
|
16b440d4ab36
Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39782
diff
changeset
|
1792 | (GDestroyNotify)purple_status_type_destroy); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1793 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1794 | /* In with the new... */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1795 | priv->status_types = status_types; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1796 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1797 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1798 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1799 | purple_account_set_status(PurpleAccount *account, const char *status_id, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1800 | gboolean active, ...) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1801 | { |
|
40328
45e719e8d3bc
Replace lists of PurpleAttr with GHashTable
qarkai <qarkai@gmail.com>
parents:
40327
diff
changeset
|
1802 | GHashTable *attrs; |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1803 | va_list args; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1804 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1805 | va_start(args, active); |
|
40328
45e719e8d3bc
Replace lists of PurpleAttr with GHashTable
qarkai <qarkai@gmail.com>
parents:
40327
diff
changeset
|
1806 | attrs = purple_attrs_from_vargs(args); |
|
40332
cd2da3a58f6d
Rename purple_account_set_status_list and purple_status_set_active_with_attrs_list
qarkai <qarkai@gmail.com>
parents:
40328
diff
changeset
|
1807 | purple_account_set_status_attrs(account, status_id, active, attrs); |
|
40328
45e719e8d3bc
Replace lists of PurpleAttr with GHashTable
qarkai <qarkai@gmail.com>
parents:
40327
diff
changeset
|
1808 | g_hash_table_destroy(attrs); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1809 | va_end(args); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1810 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1811 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1812 | void |
|
40332
cd2da3a58f6d
Rename purple_account_set_status_list and purple_status_set_active_with_attrs_list
qarkai <qarkai@gmail.com>
parents:
40328
diff
changeset
|
1813 | purple_account_set_status_attrs(PurpleAccount *account, const char *status_id, |
|
40328
45e719e8d3bc
Replace lists of PurpleAttr with GHashTable
qarkai <qarkai@gmail.com>
parents:
40327
diff
changeset
|
1814 | gboolean active, GHashTable *attrs) |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1815 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1816 | PurpleStatus *status; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1817 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1818 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1819 | g_return_if_fail(status_id != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1820 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1821 | status = purple_account_get_status(account, status_id); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1822 | if (status == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1823 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1824 | purple_debug_error("account", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1825 | "Invalid status ID '%s' for account %s (%s)\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1826 | status_id, purple_account_get_username(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1827 | purple_account_get_protocol_id(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1828 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1829 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1830 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1831 | if (active || purple_status_is_independent(status)) |
|
40332
cd2da3a58f6d
Rename purple_account_set_status_list and purple_status_set_active_with_attrs_list
qarkai <qarkai@gmail.com>
parents:
40328
diff
changeset
|
1832 | purple_status_set_active_with_attrs_dict(status, active, attrs); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1833 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1834 | /* |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1835 | * Our current statuses are saved to accounts.xml (so that when we |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1836 | * reconnect, we go back to the previous status). |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1837 | */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1838 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1839 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1840 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1841 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1842 | purple_account_set_public_alias(PurpleAccount *account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1843 | const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1844 | PurpleSetPublicAliasFailureCallback failure_cb) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1845 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1846 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1847 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1848 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1849 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1850 | g_return_if_fail(purple_account_is_connected(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1851 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1852 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1853 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1854 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39678
diff
changeset
|
1855 | if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, set_public_alias)) |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1856 | purple_protocol_server_iface_set_public_alias(protocol, gc, alias, success_cb, failure_cb); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1857 | else if (failure_cb) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1858 | struct public_alias_closure *closure = |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1859 | g_new0(struct public_alias_closure, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1860 | closure->account = g_object_ref(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1861 | closure->failure_cb = failure_cb; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1862 | g_timeout_add(0, set_public_alias_unsupported, closure); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1863 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1864 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1865 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1866 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1867 | purple_account_get_public_alias(PurpleAccount *account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1868 | PurpleGetPublicAliasSuccessCallback success_cb, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1869 | PurpleGetPublicAliasFailureCallback failure_cb) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1870 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1871 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1872 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1873 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1874 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1875 | g_return_if_fail(purple_account_is_connected(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1876 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1877 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1878 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1879 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39678
diff
changeset
|
1880 | if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, get_public_alias)) |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1881 | purple_protocol_server_iface_get_public_alias(protocol, gc, success_cb, failure_cb); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1882 | else if (failure_cb) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1883 | struct public_alias_closure *closure = |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1884 | g_new0(struct public_alias_closure, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1885 | closure->account = g_object_ref(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1886 | closure->failure_cb = failure_cb; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1887 | g_timeout_add(0, get_public_alias_unsupported, closure); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1888 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1889 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1890 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1891 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1892 | purple_account_get_silence_suppression(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1893 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1894 | return purple_account_get_bool(account, "silence-suppression", FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1895 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1896 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1897 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1898 | purple_account_set_silence_suppression(PurpleAccount *account, gboolean value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1899 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1900 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1901 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1902 | purple_account_set_bool(account, "silence-suppression", value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1903 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1904 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1905 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1906 | purple_account_clear_settings(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1907 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1908 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1909 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1910 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1911 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1912 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1913 | g_hash_table_destroy(priv->settings); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1914 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1915 | priv->settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1916 | g_free, delete_setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1917 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1918 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1919 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1920 | purple_account_remove_setting(PurpleAccount *account, const char *setting) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1921 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1922 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1923 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1924 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1925 | g_return_if_fail(setting != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1926 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1927 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1928 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1929 | g_hash_table_remove(priv->settings, setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1930 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1931 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1932 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1933 | purple_account_set_int(PurpleAccount *account, const char *name, int value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1934 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1935 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1936 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1937 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1938 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1939 | g_return_if_fail(name != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1940 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1941 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1942 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1943 | setting = g_new0(PurpleAccountSetting, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1944 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1945 | g_value_init(&setting->value, G_TYPE_INT); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1946 | g_value_set_int(&setting->value, value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1947 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1948 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1949 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1950 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1951 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1952 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1953 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1954 | purple_account_set_string(PurpleAccount *account, const char *name, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1955 | const char *value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1956 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1957 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1958 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1959 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1960 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1961 | g_return_if_fail(name != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1962 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1963 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1964 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1965 | setting = g_new0(PurpleAccountSetting, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1966 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1967 | g_value_init(&setting->value, G_TYPE_STRING); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1968 | g_value_set_string(&setting->value, value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1969 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1970 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1971 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1972 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1973 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1974 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1975 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1976 | purple_account_set_bool(PurpleAccount *account, const char *name, gboolean value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1977 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1978 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1979 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1980 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1981 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1982 | g_return_if_fail(name != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1983 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1984 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1985 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1986 | setting = g_new0(PurpleAccountSetting, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1987 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1988 | g_value_init(&setting->value, G_TYPE_BOOLEAN); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1989 | g_value_set_boolean(&setting->value, value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1990 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1991 | g_hash_table_insert(priv->settings, g_strdup(name), setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1992 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1993 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1994 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1995 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1996 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1997 | purple_account_set_ui_int(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1998 | const char *name, int value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
1999 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2000 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2001 | GHashTable *table; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2002 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2003 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2004 | g_return_if_fail(ui != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2005 | g_return_if_fail(name != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2006 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2007 | setting = g_new0(PurpleAccountSetting, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2008 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2009 | setting->ui = g_strdup(ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2010 | g_value_init(&setting->value, G_TYPE_INT); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2011 | g_value_set_int(&setting->value, value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2012 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2013 | table = get_ui_settings_table(account, ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2014 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2015 | g_hash_table_insert(table, g_strdup(name), setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2016 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2017 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2018 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2019 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2020 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2021 | purple_account_set_ui_string(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2022 | const char *name, const char *value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2023 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2024 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2025 | GHashTable *table; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2026 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2027 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2028 | g_return_if_fail(ui != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2029 | g_return_if_fail(name != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2030 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2031 | setting = g_new0(PurpleAccountSetting, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2032 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2033 | setting->ui = g_strdup(ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2034 | g_value_init(&setting->value, G_TYPE_STRING); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2035 | g_value_set_string(&setting->value, value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2036 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2037 | table = get_ui_settings_table(account, ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2038 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2039 | g_hash_table_insert(table, g_strdup(name), setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2040 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2041 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2042 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2043 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2044 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2045 | purple_account_set_ui_bool(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2046 | const char *name, gboolean value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2047 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2048 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2049 | GHashTable *table; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2050 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2051 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2052 | g_return_if_fail(ui != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2053 | g_return_if_fail(name != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2054 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2055 | setting = g_new0(PurpleAccountSetting, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2056 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2057 | setting->ui = g_strdup(ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2058 | g_value_init(&setting->value, G_TYPE_BOOLEAN); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2059 | g_value_set_boolean(&setting->value, value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2060 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2061 | table = get_ui_settings_table(account, ui); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2062 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2063 | g_hash_table_insert(table, g_strdup(name), setting); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2064 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2065 | purple_accounts_schedule_save(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2066 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2067 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2068 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2069 | purple_account_is_connected(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2070 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2071 | return (purple_account_get_state(account) == PURPLE_CONNECTION_CONNECTED); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2072 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2073 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2074 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2075 | purple_account_is_connecting(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2076 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2077 | return (purple_account_get_state(account) == PURPLE_CONNECTION_CONNECTING); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2078 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2079 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2080 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2081 | purple_account_is_disconnected(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2082 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2083 | return (purple_account_get_state(account) == PURPLE_CONNECTION_DISCONNECTED); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2084 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2085 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2086 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2087 | purple_account_get_username(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2088 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2089 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2090 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2091 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2092 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2093 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2094 | return priv->username; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2095 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2096 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2097 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2098 | purple_account_get_password(PurpleAccount *account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2099 | PurpleKeyringReadCallback cb, gpointer data) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2100 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2101 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2102 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2103 | if (account == NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2104 | cb(NULL, NULL, NULL, data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2105 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2106 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2107 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2108 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2109 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2110 | if (priv->password != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2111 | purple_debug_info("account", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2112 | "Reading password for account %s from cache.\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2113 | purple_account_get_username(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2114 | cb(account, priv->password, NULL, data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2115 | } else { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2116 | PurpleCallbackBundle *cbb = g_new0(PurpleCallbackBundle, 1); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2117 | cbb->cb = PURPLE_CALLBACK(cb); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2118 | cbb->data = data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2119 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2120 | purple_debug_info("account", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2121 | "Reading password for account %s from async keyring.\n", |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2122 | purple_account_get_username(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2123 | purple_keyring_get_password(account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2124 | purple_account_get_password_got, cbb); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2125 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2126 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2127 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2128 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2129 | purple_account_get_private_alias(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2130 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2131 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2132 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2133 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2134 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2135 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2136 | return priv->alias; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2137 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2138 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2139 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2140 | purple_account_get_user_info(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2141 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2142 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2143 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2144 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2145 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2146 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2147 | return priv->user_info; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2148 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2149 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2150 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2151 | purple_account_get_buddy_icon_path(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2152 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2153 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2154 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2155 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2156 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2157 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2158 | return priv->buddy_icon_path; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2159 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2160 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2161 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2162 | purple_account_get_protocol_id(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2163 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2164 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2165 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2166 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2167 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2168 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2169 | return priv->protocol_id; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2170 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2171 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2172 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2173 | purple_account_get_protocol_name(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2174 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2175 | PurpleProtocol *p; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2176 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2177 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2178 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2179 | p = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2180 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2181 | return (p && purple_protocol_get_name(p) ? |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2182 | _(purple_protocol_get_name(p)) : _("Unknown")); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2183 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2184 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2185 | PurpleConnection * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2186 | purple_account_get_connection(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2187 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2188 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2189 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2190 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2191 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2192 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2193 | return priv->gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2194 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2195 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2196 | const gchar * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2197 | purple_account_get_name_for_display(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2198 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2199 | PurpleBuddy *self = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2200 | PurpleConnection *gc = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2201 | const gchar *name = NULL, *username = NULL, *displayname = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2202 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2203 | name = purple_account_get_private_alias(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2204 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2205 | if (name) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2206 | return name; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2207 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2208 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2209 | username = purple_account_get_username(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2210 | self = purple_blist_find_buddy((PurpleAccount *)account, username); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2211 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2212 | if (self) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2213 | const gchar *calias= purple_buddy_get_contact_alias(self); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2214 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2215 | /* We don't want to return the buddy name if the buddy/contact |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2216 | * doesn't have an alias set. */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2217 | if (!purple_strequal(username, calias)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2218 | return calias; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2219 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2220 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2221 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2222 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2223 | displayname = purple_connection_get_display_name(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2224 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2225 | if (displayname) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2226 | return displayname; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2227 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2228 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2229 | return username; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2230 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2231 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2232 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2233 | purple_account_get_remember_password(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2234 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2235 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2236 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2237 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2238 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2239 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2240 | return priv->remember_pass; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2241 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2242 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2243 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2244 | purple_account_get_check_mail(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2245 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2246 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2247 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2248 | return purple_account_get_bool(account, "check-mail", FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2249 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2250 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2251 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2252 | purple_account_get_enabled(PurpleAccount *account, const char *ui) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2253 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2254 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2255 | g_return_val_if_fail(ui != NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2256 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2257 | return purple_account_get_ui_bool(account, ui, "auto-login", FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2258 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2259 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2260 | PurpleProxyInfo * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2261 | purple_account_get_proxy_info(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2262 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2263 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2264 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2265 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2266 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2267 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2268 | return priv->proxy_info; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2269 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2270 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2271 | PurpleAccountPrivacyType |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2272 | purple_account_get_privacy_type(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2273 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2274 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2275 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2276 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2277 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2278 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2279 | return priv->privacy_type; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2280 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2281 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2282 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2283 | purple_account_privacy_permit_add(PurpleAccount *account, const char *who, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2284 | gboolean local_only) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2285 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2286 | char *name; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2287 | PurpleBuddy *buddy; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2288 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2289 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2290 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2291 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2292 | g_return_val_if_fail(who != NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2293 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2294 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2295 | name = g_strdup(purple_normalize(account, who)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2296 | |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
2297 | if (g_slist_find_custom(priv->permit, name, (GCompareFunc)g_strcmp0) != NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2298 | /* This buddy already exists, so bail out */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2299 | g_free(name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2300 | return FALSE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2301 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2302 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2303 | priv->permit = g_slist_append(priv->permit, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2304 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2305 | if (!local_only && purple_account_is_connected(account)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2306 | purple_serv_add_permit(purple_account_get_connection(account), who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2307 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2308 | if (ui_ops != NULL && ui_ops->permit_added != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2309 | ui_ops->permit_added(account, who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2310 | |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
2311 | purple_blist_save_account(purple_blist_get_default(), account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2312 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2313 | /* This lets the UI know a buddy has had its privacy setting changed */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2314 | buddy = purple_blist_find_buddy(account, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2315 | if (buddy != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2316 | purple_signal_emit(purple_blist_get_handle(), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2317 | "buddy-privacy-changed", buddy); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2318 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2319 | return TRUE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2320 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2321 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2322 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2323 | purple_account_privacy_permit_remove(PurpleAccount *account, const char *who, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2324 | gboolean local_only) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2325 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2326 | GSList *l; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2327 | const char *name; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2328 | PurpleBuddy *buddy; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2329 | char *del; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2330 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2331 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2332 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2333 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2334 | g_return_val_if_fail(who != NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2335 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2336 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2337 | name = purple_normalize(account, who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2338 | |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
2339 | l = g_slist_find_custom(priv->permit, name, (GCompareFunc)g_strcmp0); |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2340 | if (l == NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2341 | /* We didn't find the buddy we were looking for, so bail out */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2342 | return FALSE; |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2343 | } |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2344 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2345 | /* We should not free l->data just yet. There can be occasions where |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2346 | * l->data == who. In such cases, freeing l->data here can cause crashes |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2347 | * later when who is used. */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2348 | del = l->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2349 | priv->permit = g_slist_delete_link(priv->permit, l); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2350 | |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2351 | if (!local_only && purple_account_is_connected(account)) { |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2352 | purple_serv_remove_permit(purple_account_get_connection(account), who); |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2353 | } |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2354 | |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2355 | if (ui_ops != NULL && ui_ops->permit_removed != NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2356 | ui_ops->permit_removed(account, who); |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2357 | } |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2358 | |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
2359 | purple_blist_save_account(purple_blist_get_default(), account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2360 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2361 | buddy = purple_blist_find_buddy(account, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2362 | if (buddy != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2363 | purple_signal_emit(purple_blist_get_handle(), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2364 | "buddy-privacy-changed", buddy); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2365 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2366 | g_free(del); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2367 | return TRUE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2368 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2369 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2370 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2371 | purple_account_privacy_deny_add(PurpleAccount *account, const char *who, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2372 | gboolean local_only) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2373 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2374 | char *name; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2375 | PurpleBuddy *buddy; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2376 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2377 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2378 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2379 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2380 | g_return_val_if_fail(who != NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2381 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2382 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2383 | name = g_strdup(purple_normalize(account, who)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2384 | |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
2385 | if (g_slist_find_custom(priv->deny, name, (GCompareFunc)g_strcmp0) != NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2386 | /* This buddy already exists, so bail out */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2387 | g_free(name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2388 | return FALSE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2389 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2390 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2391 | priv->deny = g_slist_append(priv->deny, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2392 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2393 | if (!local_only && purple_account_is_connected(account)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2394 | purple_serv_add_deny(purple_account_get_connection(account), who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2395 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2396 | if (ui_ops != NULL && ui_ops->deny_added != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2397 | ui_ops->deny_added(account, who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2398 | |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
2399 | purple_blist_save_account(purple_blist_get_default(), account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2400 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2401 | buddy = purple_blist_find_buddy(account, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2402 | if (buddy != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2403 | purple_signal_emit(purple_blist_get_handle(), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2404 | "buddy-privacy-changed", buddy); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2405 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2406 | return TRUE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2407 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2408 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2409 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2410 | purple_account_privacy_deny_remove(PurpleAccount *account, const char *who, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2411 | gboolean local_only) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2412 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2413 | GSList *l; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2414 | const char *normalized; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2415 | char *name; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2416 | PurpleBuddy *buddy; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2417 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2418 | PurpleAccountUiOps *ui_ops = purple_accounts_get_ui_ops(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2419 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2420 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2421 | g_return_val_if_fail(who != NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2422 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2423 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2424 | normalized = purple_normalize(account, who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2425 | |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
2426 | l = g_slist_find_custom(priv->deny, normalized, (GCompareFunc)g_strcmp0); |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2427 | if (l == NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2428 | /* We didn't find the buddy we were looking for, so bail out */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2429 | return FALSE; |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2430 | } |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2431 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2432 | buddy = purple_blist_find_buddy(account, normalized); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2433 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2434 | name = l->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2435 | priv->deny = g_slist_delete_link(priv->deny, l); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2436 | |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2437 | if (!local_only && purple_account_is_connected(account)) { |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2438 | purple_serv_remove_deny(purple_account_get_connection(account), name); |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2439 | } |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2440 | |
|
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2441 | if (ui_ops != NULL && ui_ops->deny_removed != NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2442 | ui_ops->deny_removed(account, who); |
|
40521
c4269b37a13a
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
40519
diff
changeset
|
2443 | } |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2444 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2445 | if (buddy != NULL) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2446 | purple_signal_emit(purple_blist_get_handle(), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2447 | "buddy-privacy-changed", buddy); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2448 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2449 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2450 | g_free(name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2451 | |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
2452 | purple_blist_save_account(purple_blist_get_default(), account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2453 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2454 | return TRUE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2455 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2456 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2457 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2458 | purple_account_privacy_allow(PurpleAccount *account, const char *who) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2459 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2460 | GSList *list; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2461 | PurpleAccountPrivacyType type = purple_account_get_privacy_type(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2462 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2463 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2464 | switch (type) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2465 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2466 | return; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2467 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2468 | purple_account_privacy_permit_add(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2469 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2470 | case PURPLE_ACCOUNT_PRIVACY_DENY_USERS: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2471 | purple_account_privacy_deny_remove(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2472 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2473 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2474 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2475 | /* Empty the allow-list. */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2476 | const char *norm = purple_normalize(account, who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2477 | for (list = priv->permit; list != NULL;) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2478 | char *person = list->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2479 | list = list->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2480 | if (!purple_strequal(norm, person)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2481 | purple_account_privacy_permit_remove(account, person, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2482 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2483 | purple_account_privacy_permit_add(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2484 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2485 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2486 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2487 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2488 | if (!purple_blist_find_buddy(account, who)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2489 | add_all_buddies_to_permit_list(account, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2490 | purple_account_privacy_permit_add(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2491 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2492 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2493 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2494 | default: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2495 | g_return_if_reached(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2496 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2497 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2498 | /* Notify the server if the privacy setting was changed */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2499 | if (type != purple_account_get_privacy_type(account) && purple_account_is_connected(account)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2500 | purple_serv_set_permit_deny(purple_account_get_connection(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2501 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2502 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2503 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2504 | purple_account_privacy_deny(PurpleAccount *account, const char *who) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2505 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2506 | GSList *list; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2507 | PurpleAccountPrivacyType type = purple_account_get_privacy_type(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2508 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2509 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2510 | switch (type) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2511 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2512 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2513 | /* Empty the deny-list. */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2514 | const char *norm = purple_normalize(account, who); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2515 | for (list = priv->deny; list != NULL; ) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2516 | char *person = list->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2517 | list = list->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2518 | if (!purple_strequal(norm, person)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2519 | purple_account_privacy_deny_remove(account, person, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2520 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2521 | purple_account_privacy_deny_add(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2522 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_DENY_USERS); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2523 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2524 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2525 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2526 | purple_account_privacy_permit_remove(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2527 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2528 | case PURPLE_ACCOUNT_PRIVACY_DENY_USERS: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2529 | purple_account_privacy_deny_add(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2530 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2531 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2532 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2533 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2534 | if (purple_blist_find_buddy(account, who)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2535 | add_all_buddies_to_permit_list(account, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2536 | purple_account_privacy_permit_remove(account, who, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2537 | purple_account_set_privacy_type(account, PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2538 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2539 | break; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2540 | default: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2541 | g_return_if_reached(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2542 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2543 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2544 | /* Notify the server if the privacy setting was changed */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2545 | if (type != purple_account_get_privacy_type(account) && purple_account_is_connected(account)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2546 | purple_serv_set_permit_deny(purple_account_get_connection(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2547 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2548 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2549 | GSList * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2550 | purple_account_privacy_get_permitted(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2551 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2552 | PurpleAccountPrivate *priv = NULL; |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2553 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2554 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2555 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2556 | priv = purple_account_get_instance_private(account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2557 | return priv->permit; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2558 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2559 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2560 | GSList * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2561 | purple_account_privacy_get_denied(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2562 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2563 | PurpleAccountPrivate *priv = NULL; |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2564 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2565 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2566 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
2567 | priv = purple_account_get_instance_private(account); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2568 | return priv->deny; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2569 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2570 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2571 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2572 | purple_account_privacy_check(PurpleAccount *account, const char *who) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2573 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2574 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2575 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2576 | switch (purple_account_get_privacy_type(account)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2577 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2578 | return TRUE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2579 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2580 | case PURPLE_ACCOUNT_PRIVACY_DENY_ALL: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2581 | return FALSE; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2582 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2583 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_USERS: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2584 | who = purple_normalize(account, who); |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
2585 | return (g_slist_find_custom(priv->permit, who, (GCompareFunc)g_strcmp0) != NULL); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2586 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2587 | case PURPLE_ACCOUNT_PRIVACY_DENY_USERS: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2588 | who = purple_normalize(account, who); |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39897
diff
changeset
|
2589 | return (g_slist_find_custom(priv->deny, who, (GCompareFunc)g_strcmp0) == NULL); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2590 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2591 | case PURPLE_ACCOUNT_PRIVACY_ALLOW_BUDDYLIST: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2592 | return (purple_blist_find_buddy(account, who) != NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2593 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2594 | default: |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2595 | g_return_val_if_reached(TRUE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2596 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2597 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2598 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2599 | PurpleStatus * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2600 | purple_account_get_active_status(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2601 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2602 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2603 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2604 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2605 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2606 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2607 | return purple_presence_get_active_status(priv->presence); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2608 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2609 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2610 | PurpleStatus * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2611 | purple_account_get_status(PurpleAccount *account, const char *status_id) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2612 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2613 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2614 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2615 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2616 | g_return_val_if_fail(status_id != NULL, NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2617 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2618 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2619 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2620 | return purple_presence_get_status(priv->presence, status_id); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2621 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2622 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2623 | PurpleStatusType * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2624 | purple_account_get_status_type(PurpleAccount *account, const char *id) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2625 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2626 | GList *l; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2627 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2628 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2629 | g_return_val_if_fail(id != NULL, NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2630 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2631 | for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2632 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2633 | PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2634 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2635 | if (purple_strequal(purple_status_type_get_id(status_type), id)) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2636 | return status_type; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2637 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2638 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2639 | return NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2640 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2641 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2642 | PurpleStatusType * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2643 | purple_account_get_status_type_with_primitive(PurpleAccount *account, PurpleStatusPrimitive primitive) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2644 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2645 | GList *l; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2646 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2647 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2648 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2649 | for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2650 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2651 | PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2652 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2653 | if (purple_status_type_get_primitive(status_type) == primitive) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2654 | return status_type; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2655 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2656 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2657 | return NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2658 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2659 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2660 | PurplePresence * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2661 | purple_account_get_presence(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2662 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2663 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2664 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2665 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2666 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2667 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2668 | return priv->presence; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2669 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2670 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2671 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2672 | purple_account_is_status_active(PurpleAccount *account, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2673 | const char *status_id) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2674 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2675 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2676 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2677 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2678 | g_return_val_if_fail(status_id != NULL, FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2679 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2680 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2681 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2682 | return purple_presence_is_status_active(priv->presence, status_id); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2683 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2684 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2685 | GList * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2686 | purple_account_get_status_types(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2687 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2688 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2689 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2690 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2691 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2692 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2693 | return priv->status_types; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2694 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2695 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2696 | int |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2697 | purple_account_get_int(PurpleAccount *account, const char *name, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2698 | int default_value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2699 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2700 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2701 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2702 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2703 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2704 | g_return_val_if_fail(name != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2705 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2706 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2707 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2708 | setting = g_hash_table_lookup(priv->settings, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2709 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2710 | if (setting == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2711 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2712 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2713 | g_return_val_if_fail(G_VALUE_HOLDS_INT(&setting->value), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2714 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2715 | return g_value_get_int(&setting->value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2716 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2717 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2718 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2719 | purple_account_get_string(PurpleAccount *account, const char *name, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2720 | const char *default_value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2721 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2722 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2723 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2724 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2725 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2726 | g_return_val_if_fail(name != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2727 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2728 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2729 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2730 | setting = g_hash_table_lookup(priv->settings, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2731 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2732 | if (setting == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2733 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2734 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2735 | g_return_val_if_fail(G_VALUE_HOLDS_STRING(&setting->value), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2736 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2737 | return g_value_get_string(&setting->value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2738 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2739 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2740 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2741 | purple_account_get_bool(PurpleAccount *account, const char *name, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2742 | gboolean default_value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2743 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2744 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2745 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2746 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2747 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2748 | g_return_val_if_fail(name != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2749 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2750 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2751 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2752 | setting = g_hash_table_lookup(priv->settings, name); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2753 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2754 | if (setting == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2755 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2756 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2757 | g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&setting->value), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2758 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2759 | return g_value_get_boolean(&setting->value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2760 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2761 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2762 | int |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2763 | purple_account_get_ui_int(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2764 | const char *name, int default_value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2765 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2766 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2767 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2768 | GHashTable *table; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2769 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2770 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2771 | g_return_val_if_fail(ui != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2772 | g_return_val_if_fail(name != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2773 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2774 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2775 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2776 | if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2777 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2778 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2779 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2780 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2781 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2782 | g_return_val_if_fail(G_VALUE_HOLDS_INT(&setting->value), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2783 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2784 | return g_value_get_int(&setting->value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2785 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2786 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2787 | const char * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2788 | purple_account_get_ui_string(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2789 | const char *name, const char *default_value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2790 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2791 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2792 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2793 | GHashTable *table; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2794 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2795 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2796 | g_return_val_if_fail(ui != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2797 | g_return_val_if_fail(name != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2798 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2799 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2800 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2801 | if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2802 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2803 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2804 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2805 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2806 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2807 | g_return_val_if_fail(G_VALUE_HOLDS_STRING(&setting->value), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2808 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2809 | return g_value_get_string(&setting->value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2810 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2811 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2812 | gboolean |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2813 | purple_account_get_ui_bool(PurpleAccount *account, const char *ui, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2814 | const char *name, gboolean default_value) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2815 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2816 | PurpleAccountSetting *setting; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2817 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2818 | GHashTable *table; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2819 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2820 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2821 | g_return_val_if_fail(ui != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2822 | g_return_val_if_fail(name != NULL, default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2823 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2824 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2825 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2826 | if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2827 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2828 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2829 | if ((setting = g_hash_table_lookup(table, name)) == NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2830 | return default_value; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2831 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2832 | g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&setting->value), default_value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2833 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2834 | return g_value_get_boolean(&setting->value); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2835 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2836 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2837 | PurpleLog * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2838 | purple_account_get_log(PurpleAccount *account, gboolean create) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2839 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2840 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2841 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2842 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2843 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2844 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2845 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2846 | if(!priv->system_log && create){ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2847 | PurplePresence *presence; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2848 | int login_time; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2849 | GDateTime *dt; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2850 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2851 | presence = purple_account_get_presence(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2852 | login_time = purple_presence_get_login_time(presence); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2853 | if (login_time != 0) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2854 | dt = g_date_time_new_from_unix_local(login_time); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2855 | } else { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2856 | dt = g_date_time_new_now_local(); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2857 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2858 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2859 | priv->system_log = purple_log_new(PURPLE_LOG_SYSTEM, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2860 | purple_account_get_username(account), |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2861 | account, NULL, dt); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2862 | g_date_time_unref(dt); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2863 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2864 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2865 | return priv->system_log; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2866 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2867 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2868 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2869 | purple_account_destroy_log(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2870 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2871 | PurpleAccountPrivate *priv; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2872 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2873 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2874 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2875 | priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2876 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2877 | if(priv->system_log){ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2878 | purple_log_free(priv->system_log); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2879 | priv->system_log = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2880 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2881 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2882 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2883 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2884 | purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy, const char *message) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2885 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2886 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2887 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2888 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2889 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2890 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2891 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2892 | gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2893 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2894 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2895 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2896 | if (protocol != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2897 | purple_protocol_server_iface_add_buddy(protocol, gc, buddy, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2898 | purple_buddy_get_group(buddy), message); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2899 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2900 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2901 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2902 | purple_account_add_buddies(PurpleAccount *account, GList *buddies, const char *message) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2903 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2904 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2905 | PurpleConnection *gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2906 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2907 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2908 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2909 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2910 | if (protocol) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2911 | GList *cur, *groups = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2912 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2913 | /* Make a list of what group each buddy is in */ |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2914 | for (cur = buddies; cur != NULL; cur = cur->next) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2915 | PurpleBuddy *buddy = cur->data; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2916 | groups = g_list_append(groups, purple_buddy_get_group(buddy)); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2917 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2918 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39678
diff
changeset
|
2919 | if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, add_buddies)) |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2920 | purple_protocol_server_iface_add_buddies(protocol, gc, buddies, groups, message); |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39678
diff
changeset
|
2921 | else if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, add_buddy)) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2922 | GList *curb = buddies, *curg = groups; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2923 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2924 | while ((curb != NULL) && (curg != NULL)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2925 | purple_protocol_server_iface_add_buddy(protocol, gc, curb->data, curg->data, message); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2926 | curb = curb->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2927 | curg = curg->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2928 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2929 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2930 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2931 | g_list_free(groups); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2932 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2933 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2934 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2935 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2936 | purple_account_remove_buddy(PurpleAccount *account, PurpleBuddy *buddy, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2937 | PurpleGroup *group) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2938 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2939 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2940 | PurpleConnection *gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2941 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2942 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2943 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2944 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2945 | if (protocol) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2946 | purple_protocol_server_iface_remove_buddy(protocol, gc, buddy, group); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2947 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2948 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2949 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2950 | purple_account_remove_buddies(PurpleAccount *account, GList *buddies, GList *groups) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2951 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2952 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2953 | PurpleConnection *gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2954 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2955 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2956 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2957 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2958 | if (protocol) { |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39678
diff
changeset
|
2959 | if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, remove_buddies)) |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2960 | purple_protocol_server_iface_remove_buddies(protocol, gc, buddies, groups); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2961 | else { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2962 | GList *curb = buddies; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2963 | GList *curg = groups; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2964 | while ((curb != NULL) && (curg != NULL)) { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2965 | purple_account_remove_buddy(account, curb->data, curg->data); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2966 | curb = curb->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2967 | curg = curg->next; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2968 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2969 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2970 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2971 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2972 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2973 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2974 | purple_account_remove_group(PurpleAccount *account, PurpleGroup *group) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2975 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2976 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2977 | PurpleConnection *gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2978 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2979 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2980 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2981 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2982 | if (protocol) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2983 | purple_protocol_server_iface_remove_group(protocol, gc, group); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2984 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2985 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2986 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2987 | purple_account_change_password(PurpleAccount *account, const char *orig_pw, |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2988 | const char *new_pw) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2989 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2990 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2991 | PurpleConnection *gc = purple_account_get_connection(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2992 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2993 | purple_account_set_password(account, new_pw, NULL, NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2994 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2995 | if (gc != NULL) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2996 | protocol = purple_connection_get_protocol(gc); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2997 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2998 | if (protocol) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
2999 | purple_protocol_server_iface_change_passwd(protocol, gc, orig_pw, new_pw); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3000 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3001 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3002 | gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3003 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3004 | PurpleConnection *gc; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3005 | PurpleProtocol *protocol = NULL; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3006 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3007 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3008 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), FALSE); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3009 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3010 | gc = purple_account_get_connection(account); |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3011 | if(gc == NULL) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3012 | return FALSE; |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3013 | } |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3014 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3015 | protocol = purple_connection_get_protocol(gc); |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3016 | if(!protocol) { |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3017 | return FALSE; |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3018 | } |
|
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3019 | |
|
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3020 | return purple_protocol_client_offline_message(PURPLE_PROTOCOL_CLIENT(protocol), buddy); |
|
39514
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3021 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3022 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3023 | const PurpleConnectionErrorInfo * |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3024 | purple_account_get_current_error(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3025 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3026 | PurpleAccountPrivate *priv = purple_account_get_instance_private(account); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3027 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3028 | return priv->current_error; |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3029 | } |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3030 | |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3031 | void |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3032 | purple_account_clear_current_error(PurpleAccount *account) |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3033 | { |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3034 | _purple_account_set_current_error(account, NULL); |
|
9c7715998bbc
Cleanup account.[ch] and status.[ch] to remove g_type_class_add_private and other cleans including remove const from accessors
Gary Kramlich <grim@reaperworld.com>
parents:
39436
diff
changeset
|
3035 | } |