Sat, 11 Jul 2015 14:45:46 -0400
facebook: fixed all errors being marked as fatal
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* purple |
| 5639 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
6 | * |
| 5639 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18265
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5639 | 20 | */ |
|
18265
9f26190d7f46
Move the define in internal.h instead.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
21 | #include "internal.h" |
|
9f26190d7f46
Move the define in internal.h instead.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
22 | |
| 5639 | 23 | #include "accountopt.h" |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
24 | #include "util.h" |
|
33369
4a43f6a6326b
Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33267
diff
changeset
|
25 | #include "glibcompat.h" |
| 5639 | 26 | |
|
35458
385156e1b493
Fix some gtk-doc warnings from account to connection
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
27 | /* |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
28 | * An option for an account. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
29 | * |
|
36691
92122af1f083
Some documentation updates with regard to 'protocol plugins' and 'protocols'
Ankit Vani <a@nevitus.org>
parents:
33369
diff
changeset
|
30 | * This is set by protocols, and appears in the account settings |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
31 | * dialogs. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
32 | */ |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
33 | struct _PurpleAccountOption |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
34 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
35 | PurplePrefType type; /* The type of value. */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
36 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
37 | char *text; /* The text that will appear to the user. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
38 | char *pref_name; /* The name of the associated preference. */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
39 | |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
40 | union |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
41 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
42 | gboolean boolean; /* The default boolean value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
43 | int integer; /* The default integer value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
44 | char *string; /* The default string value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
45 | GList *list; /* The default list value. */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
46 | |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
47 | } default_value; |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
48 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
49 | union |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
50 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
51 | struct |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
52 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
53 | gboolean masked; /* Whether the value entered should |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
54 | * be obscured from view (for |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
55 | * passwords and similar options) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
56 | */ |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
57 | GSList *hints; /* List of hinted values */ |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
58 | } string; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
59 | } params; |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
60 | }; |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
61 | |
|
35458
385156e1b493
Fix some gtk-doc warnings from account to connection
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
62 | /* |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
63 | * A username split. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
64 | * |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
65 | * This is used by some protocols to separate the fields of the username |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
66 | * into more human-readable components. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
67 | */ |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
68 | struct _PurpleAccountUserSplit |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
69 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
70 | char *text; /* The text that will appear to the user. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
71 | char *default_value; /* The default value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
72 | char field_sep; /* The field separator. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
73 | gboolean reverse; /* TRUE if the separator should be found |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
74 | starting a the end of the string, FALSE |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
75 | otherwise */ |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
76 | gboolean constant; |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
77 | }; |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
78 | |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
79 | |
| 15884 | 80 | PurpleAccountOption * |
| 81 | purple_account_option_new(PurplePrefType type, const char *text, | |
| 5639 | 82 | const char *pref_name) |
| 83 | { | |
| 15884 | 84 | PurpleAccountOption *option; |
| 5639 | 85 | |
| 15884 | 86 | g_return_val_if_fail(type != PURPLE_PREF_NONE, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
87 | g_return_val_if_fail(text != NULL, NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
88 | g_return_val_if_fail(pref_name != NULL, NULL); |
| 5639 | 89 | |
| 15884 | 90 | option = g_new0(PurpleAccountOption, 1); |
| 5639 | 91 | |
| 92 | option->type = type; | |
| 93 | option->text = g_strdup(text); | |
| 94 | option->pref_name = g_strdup(pref_name); | |
| 95 | ||
| 96 | return option; | |
| 97 | } | |
| 98 | ||
| 15884 | 99 | PurpleAccountOption * |
| 100 | purple_account_option_bool_new(const char *text, const char *pref_name, | |
| 5639 | 101 | gboolean default_value) |
| 102 | { | |
| 15884 | 103 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
104 | |
| 15884 | 105 | option = purple_account_option_new(PURPLE_PREF_BOOLEAN, text, pref_name); |
| 5639 | 106 | |
| 107 | if (option == NULL) | |
| 108 | return NULL; | |
| 109 | ||
| 110 | option->default_value.boolean = default_value; | |
| 111 | ||
| 112 | return option; | |
| 113 | } | |
| 114 | ||
| 15884 | 115 | PurpleAccountOption * |
| 116 | purple_account_option_int_new(const char *text, const char *pref_name, | |
| 5639 | 117 | int default_value) |
| 118 | { | |
| 15884 | 119 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
120 | |
| 15884 | 121 | option = purple_account_option_new(PURPLE_PREF_INT, text, pref_name); |
| 5639 | 122 | |
| 123 | if (option == NULL) | |
| 124 | return NULL; | |
| 125 | ||
| 126 | option->default_value.integer = default_value; | |
| 127 | ||
| 128 | return option; | |
| 129 | } | |
| 130 | ||
| 15884 | 131 | PurpleAccountOption * |
| 132 | purple_account_option_string_new(const char *text, const char *pref_name, | |
| 5639 | 133 | const char *default_value) |
| 134 | { | |
| 15884 | 135 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
136 | |
| 15884 | 137 | option = purple_account_option_new(PURPLE_PREF_STRING, text, pref_name); |
| 5639 | 138 | |
| 139 | if (option == NULL) | |
| 140 | return NULL; | |
| 141 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
142 | option->default_value.string = g_strdup(default_value); |
| 5639 | 143 | |
| 144 | return option; | |
| 145 | } | |
| 146 | ||
| 15884 | 147 | PurpleAccountOption * |
| 148 | purple_account_option_list_new(const char *text, const char *pref_name, | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
149 | GList *list) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
150 | { |
| 15884 | 151 | PurpleAccountOption *option; |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
152 | |
| 15884 | 153 | option = purple_account_option_new(PURPLE_PREF_STRING_LIST, text, pref_name); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
154 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
155 | if (option == NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
156 | return NULL; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
157 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
158 | option->default_value.list = list; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
159 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
160 | return option; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
161 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
162 | |
|
27977
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
163 | static void |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
164 | purple_account_option_list_free(gpointer data, gpointer user_data) |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
165 | { |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
166 | PurpleKeyValuePair *kvp = data; |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
167 | |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
168 | g_free(kvp->value); |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
169 | g_free(kvp->key); |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
170 | g_free(kvp); |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
171 | } |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
172 | |
| 5639 | 173 | void |
| 15884 | 174 | purple_account_option_destroy(PurpleAccountOption *option) |
| 5639 | 175 | { |
| 176 | g_return_if_fail(option != NULL); | |
| 177 | ||
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12172
diff
changeset
|
178 | g_free(option->text); |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12172
diff
changeset
|
179 | g_free(option->pref_name); |
| 5639 | 180 | |
| 15884 | 181 | if (option->type == PURPLE_PREF_STRING) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
182 | { |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12172
diff
changeset
|
183 | g_free(option->default_value.string); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
184 | g_slist_free_full(option->params.string.hints, &g_free); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
185 | } |
| 15884 | 186 | else if (option->type == PURPLE_PREF_STRING_LIST) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
187 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
188 | if (option->default_value.list != NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
189 | { |
|
27977
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
190 | g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
191 | g_list_free(option->default_value.list); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
192 | } |
| 5639 | 193 | } |
| 194 | ||
| 195 | g_free(option); | |
| 196 | } | |
| 197 | ||
| 198 | void | |
| 15884 | 199 | purple_account_option_set_default_bool(PurpleAccountOption *option, |
| 5639 | 200 | gboolean value) |
| 201 | { | |
| 202 | g_return_if_fail(option != NULL); | |
| 15884 | 203 | g_return_if_fail(option->type == PURPLE_PREF_BOOLEAN); |
| 5639 | 204 | |
| 205 | option->default_value.boolean = value; | |
| 206 | } | |
| 207 | ||
| 208 | void | |
| 15884 | 209 | purple_account_option_set_default_int(PurpleAccountOption *option, int value) |
| 5639 | 210 | { |
| 211 | g_return_if_fail(option != NULL); | |
| 15884 | 212 | g_return_if_fail(option->type == PURPLE_PREF_INT); |
| 5639 | 213 | |
| 214 | option->default_value.integer = value; | |
| 215 | } | |
| 216 | ||
| 217 | void | |
| 15884 | 218 | purple_account_option_set_default_string(PurpleAccountOption *option, |
| 5639 | 219 | const char *value) |
| 220 | { | |
| 221 | g_return_if_fail(option != NULL); | |
| 15884 | 222 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
| 5639 | 223 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
224 | g_free(option->default_value.string); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
225 | option->default_value.string = g_strdup(value); |
| 5639 | 226 | } |
| 227 | ||
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
228 | void |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
229 | purple_account_option_string_set_masked(PurpleAccountOption *option, gboolean masked) |
| 10658 | 230 | { |
| 231 | g_return_if_fail(option != NULL); | |
| 15884 | 232 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
| 10658 | 233 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
234 | option->params.string.masked = masked; |
| 10658 | 235 | } |
| 236 | ||
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
237 | void |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
238 | purple_account_option_string_set_hints(PurpleAccountOption *option, GSList *hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
239 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
240 | g_return_if_fail(option != NULL); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
241 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
242 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
243 | g_slist_free_full(option->params.string.hints, &g_free); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
244 | option->params.string.hints = hints; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
245 | } |
| 10658 | 246 | |
| 247 | void | |
| 15884 | 248 | purple_account_option_set_list(PurpleAccountOption *option, GList *values) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
249 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
250 | g_return_if_fail(option != NULL); |
| 15884 | 251 | g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
252 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
253 | if (option->default_value.list != NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
254 | { |
|
27977
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
255 | g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
256 | g_list_free(option->default_value.list); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
257 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
258 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
259 | option->default_value.list = values; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
260 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
261 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
262 | void |
| 15884 | 263 | purple_account_option_add_list_item(PurpleAccountOption *option, |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
264 | const char *key, const char *value) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
265 | { |
| 15884 | 266 | PurpleKeyValuePair *kvp; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
267 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
268 | g_return_if_fail(option != NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
269 | g_return_if_fail(key != NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
270 | g_return_if_fail(value != NULL); |
| 15884 | 271 | g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
272 | |
| 15884 | 273 | kvp = g_new0(PurpleKeyValuePair, 1); |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
274 | kvp->key = g_strdup(key); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
275 | kvp->value = g_strdup(value); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
276 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
277 | option->default_value.list = g_list_append(option->default_value.list, |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
278 | kvp); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
279 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
280 | |
| 15884 | 281 | PurplePrefType |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
33369
diff
changeset
|
282 | purple_account_option_get_pref_type(const PurpleAccountOption *option) |
| 5639 | 283 | { |
| 15884 | 284 | g_return_val_if_fail(option != NULL, PURPLE_PREF_NONE); |
| 5639 | 285 | |
| 286 | return option->type; | |
| 287 | } | |
| 288 | ||
| 289 | const char * | |
| 15884 | 290 | purple_account_option_get_text(const PurpleAccountOption *option) |
| 5639 | 291 | { |
| 292 | g_return_val_if_fail(option != NULL, NULL); | |
| 293 | ||
| 294 | return option->text; | |
| 295 | } | |
| 296 | ||
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
297 | const char * |
| 15884 | 298 | purple_account_option_get_setting(const PurpleAccountOption *option) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
299 | { |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
300 | g_return_val_if_fail(option != NULL, NULL); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
301 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
302 | return option->pref_name; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
303 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
304 | |
| 5639 | 305 | gboolean |
| 15884 | 306 | purple_account_option_get_default_bool(const PurpleAccountOption *option) |
| 5639 | 307 | { |
| 308 | g_return_val_if_fail(option != NULL, FALSE); | |
| 15884 | 309 | g_return_val_if_fail(option->type == PURPLE_PREF_BOOLEAN, FALSE); |
| 5639 | 310 | |
| 311 | return option->default_value.boolean; | |
| 312 | } | |
| 313 | ||
| 314 | int | |
| 15884 | 315 | purple_account_option_get_default_int(const PurpleAccountOption *option) |
| 5639 | 316 | { |
| 317 | g_return_val_if_fail(option != NULL, -1); | |
| 15884 | 318 | g_return_val_if_fail(option->type == PURPLE_PREF_INT, -1); |
| 5639 | 319 | |
| 320 | return option->default_value.integer; | |
| 321 | } | |
| 322 | ||
| 323 | const char * | |
| 15884 | 324 | purple_account_option_get_default_string(const PurpleAccountOption *option) |
| 5639 | 325 | { |
| 326 | g_return_val_if_fail(option != NULL, NULL); | |
| 15884 | 327 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, NULL); |
| 5639 | 328 | |
| 329 | return option->default_value.string; | |
| 330 | } | |
| 331 | ||
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
332 | const char * |
| 15884 | 333 | purple_account_option_get_default_list_value(const PurpleAccountOption *option) |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
334 | { |
| 15884 | 335 | PurpleKeyValuePair *kvp; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
336 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
337 | g_return_val_if_fail(option != NULL, NULL); |
| 15884 | 338 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING_LIST, NULL); |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
339 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
340 | if (option->default_value.list == NULL) |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
341 | return NULL; |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
342 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
343 | kvp = option->default_value.list->data; |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
344 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
345 | return (kvp ? kvp->value : NULL); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
346 | } |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
347 | |
| 10658 | 348 | gboolean |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
349 | purple_account_option_string_get_masked(const PurpleAccountOption *option) |
| 10658 | 350 | { |
| 351 | g_return_val_if_fail(option != NULL, FALSE); | |
| 15884 | 352 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE); |
| 10658 | 353 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
354 | return option->params.string.masked; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
355 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
356 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
357 | const GSList * |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
358 | purple_account_option_string_get_hints(const PurpleAccountOption *option) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
359 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
360 | g_return_val_if_fail(option != NULL, FALSE); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
361 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
362 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
363 | return option->params.string.hints; |
| 10658 | 364 | } |
| 365 | ||
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18099
diff
changeset
|
366 | GList * |
| 15884 | 367 | purple_account_option_get_list(const PurpleAccountOption *option) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
368 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
369 | g_return_val_if_fail(option != NULL, NULL); |
| 15884 | 370 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING_LIST, NULL); |
| 5639 | 371 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
372 | return option->default_value.list; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
373 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
374 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
375 | /************************************************************************** |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
376 | * Account User Split API |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
377 | **************************************************************************/ |
| 15884 | 378 | PurpleAccountUserSplit * |
| 379 | purple_account_user_split_new(const char *text, const char *default_value, | |
| 5639 | 380 | char sep) |
| 381 | { | |
| 15884 | 382 | PurpleAccountUserSplit *split; |
| 5639 | 383 | |
| 384 | g_return_val_if_fail(text != NULL, NULL); | |
| 385 | g_return_val_if_fail(sep != 0, NULL); | |
| 386 | ||
| 15884 | 387 | split = g_new0(PurpleAccountUserSplit, 1); |
| 5639 | 388 | |
| 389 | split->text = g_strdup(text); | |
| 390 | split->field_sep = sep; | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
391 | split->default_value = g_strdup(default_value); |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
392 | split->reverse = TRUE; |
| 5639 | 393 | |
| 394 | return split; | |
| 395 | } | |
| 396 | ||
| 397 | void | |
| 15884 | 398 | purple_account_user_split_destroy(PurpleAccountUserSplit *split) |
| 5639 | 399 | { |
| 400 | g_return_if_fail(split != NULL); | |
| 401 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
402 | g_free(split->text); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
403 | g_free(split->default_value); |
| 5639 | 404 | g_free(split); |
| 405 | } | |
| 406 | ||
| 407 | const char * | |
| 15884 | 408 | purple_account_user_split_get_text(const PurpleAccountUserSplit *split) |
|
5654
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
409 | { |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
410 | g_return_val_if_fail(split != NULL, NULL); |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
411 | |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
412 | return split->text; |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
413 | } |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
414 | |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
415 | const char * |
| 15884 | 416 | purple_account_user_split_get_default_value(const PurpleAccountUserSplit *split) |
| 5639 | 417 | { |
| 418 | g_return_val_if_fail(split != NULL, NULL); | |
| 419 | ||
| 420 | return split->default_value; | |
| 421 | } | |
| 422 | ||
| 423 | char | |
| 15884 | 424 | purple_account_user_split_get_separator(const PurpleAccountUserSplit *split) |
| 5639 | 425 | { |
| 426 | g_return_val_if_fail(split != NULL, 0); | |
| 427 | ||
| 428 | return split->field_sep; | |
| 429 | } | |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
430 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
431 | gboolean |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
432 | purple_account_user_split_get_reverse(const PurpleAccountUserSplit *split) |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
433 | { |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
434 | g_return_val_if_fail(split != NULL, FALSE); |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
435 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
436 | return split->reverse; |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
437 | } |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
438 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
439 | void |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
440 | purple_account_user_split_set_reverse(PurpleAccountUserSplit *split, gboolean reverse) |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
441 | { |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
442 | g_return_if_fail(split != NULL); |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
443 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
444 | split->reverse = reverse; |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
445 | } |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
446 | |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
447 | gboolean |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
448 | purple_account_user_split_is_constant(const PurpleAccountUserSplit *split) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
449 | { |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
450 | g_return_val_if_fail(split != NULL, FALSE); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
451 | |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
452 | return split->constant; |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
453 | } |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
454 | |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
455 | void |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
456 | purple_account_user_split_set_constant(PurpleAccountUserSplit *split, |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
457 | gboolean constant) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
458 | { |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
459 | g_return_if_fail(split != NULL); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
460 | |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
461 | split->constant = constant; |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35475
diff
changeset
|
462 | } |