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