Sat, 05 Jan 2008 10:43:25 +0000
Remove a lot of duplication from a lot of places. Closes #4558.
| 6371 | 1 | /** |
| 2 | * @file gtkprivacy.c GTK+ Privacy UI | |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
15931
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 6371 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin 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. | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
11 | * |
| 6371 | 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:
18327
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 6371 | 25 | */ |
| 9791 | 26 | #include "internal.h" |
| 15577 | 27 | #include "pidgin.h" |
| 6371 | 28 | |
| 29 | #include "connection.h" | |
| 30 | #include "debug.h" | |
| 31 | #include "privacy.h" | |
| 32 | #include "request.h" | |
| 33 | #include "util.h" | |
| 34 | ||
|
11111
4621d9b973a4
[gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11047
diff
changeset
|
35 | #include "gtkblist.h" |
| 6371 | 36 | #include "gtkprivacy.h" |
| 37 | #include "gtkutils.h" | |
| 38 | ||
| 39 | typedef struct | |
| 40 | { | |
| 41 | GtkWidget *win; | |
| 42 | ||
| 43 | GtkWidget *type_menu; | |
| 44 | ||
| 45 | GtkWidget *add_button; | |
| 46 | GtkWidget *remove_button; | |
| 47 | GtkWidget *clear_button; | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
48 | GtkWidget *close_button; |
| 6371 | 49 | |
| 50 | GtkWidget *button_box; | |
| 51 | GtkWidget *allow_widget; | |
| 52 | GtkWidget *block_widget; | |
| 53 | ||
| 54 | GtkListStore *allow_store; | |
| 55 | GtkListStore *block_store; | |
| 56 | ||
| 57 | GtkWidget *allow_list; | |
| 58 | GtkWidget *block_list; | |
| 59 | ||
| 60 | gboolean in_allow_list; | |
| 61 | ||
| 15884 | 62 | PurpleAccount *account; |
| 6371 | 63 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
64 | } PidginPrivacyDialog; |
| 6371 | 65 | |
| 66 | typedef struct | |
| 67 | { | |
| 15884 | 68 | PurpleAccount *account; |
| 6371 | 69 | char *name; |
| 70 | gboolean block; | |
| 71 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
72 | } PidginPrivacyRequestData; |
| 6371 | 73 | |
| 74 | static struct | |
| 75 | { | |
| 76 | const char *text; | |
| 77 | int num; | |
| 78 | ||
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20147
diff
changeset
|
79 | } const menu_entries[] = |
| 6371 | 80 | { |
| 15884 | 81 | { N_("Allow all users to contact me"), PURPLE_PRIVACY_ALLOW_ALL }, |
| 82 | { N_("Allow only the users on my buddy list"), PURPLE_PRIVACY_ALLOW_BUDDYLIST }, | |
| 83 | { N_("Allow only the users below"), PURPLE_PRIVACY_ALLOW_USERS }, | |
| 84 | { N_("Block all users"), PURPLE_PRIVACY_DENY_ALL }, | |
| 85 | { N_("Block only the users below"), PURPLE_PRIVACY_DENY_USERS } | |
| 6371 | 86 | }; |
| 87 | ||
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20147
diff
changeset
|
88 | static const size_t menu_entry_count = sizeof(menu_entries) / sizeof(*menu_entries); |
| 6371 | 89 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
90 | static PidginPrivacyDialog *privacy_dialog = NULL; |
| 6371 | 91 | |
| 92 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
93 | rebuild_allow_list(PidginPrivacyDialog *dialog) |
| 6371 | 94 | { |
| 95 | GSList *l; | |
| 96 | GtkTreeIter iter; | |
| 97 | ||
| 98 | gtk_list_store_clear(dialog->allow_store); | |
| 99 | ||
| 100 | for (l = dialog->account->permit; l != NULL; l = l->next) { | |
| 101 | gtk_list_store_append(dialog->allow_store, &iter); | |
| 102 | gtk_list_store_set(dialog->allow_store, &iter, 0, l->data, -1); | |
| 103 | } | |
| 104 | } | |
| 105 | ||
| 106 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
107 | rebuild_block_list(PidginPrivacyDialog *dialog) |
| 6371 | 108 | { |
| 109 | GSList *l; | |
| 110 | GtkTreeIter iter; | |
| 111 | ||
| 112 | gtk_list_store_clear(dialog->block_store); | |
| 113 | ||
| 114 | for (l = dialog->account->deny; l != NULL; l = l->next) { | |
| 115 | gtk_list_store_append(dialog->block_store, &iter); | |
| 116 | gtk_list_store_set(dialog->block_store, &iter, 0, l->data, -1); | |
| 117 | } | |
| 118 | } | |
| 119 | ||
| 120 | static const char * | |
| 121 | find_permit_block_by_name(GSList *list, const char *name) | |
| 122 | { | |
| 123 | const char *temp_name; | |
| 124 | GSList *l; | |
| 125 | ||
| 126 | for (l = list; l != NULL; l = l->next) { | |
| 127 | temp_name = (const char *)l->data; | |
| 128 | ||
| 15884 | 129 | /* Should this use purple_normalize()? */ |
| 130 | if (!purple_utf8_strcasecmp(name, temp_name)) | |
| 6371 | 131 | return temp_name; |
| 132 | } | |
| 133 | ||
| 134 | return NULL; | |
| 135 | } | |
| 136 | ||
| 137 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
138 | user_selected_cb(GtkTreeSelection *sel, PidginPrivacyDialog *dialog) |
| 6371 | 139 | { |
| 140 | gtk_widget_set_sensitive(dialog->remove_button, TRUE); | |
| 141 | } | |
| 142 | ||
| 143 | static GtkWidget * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
144 | build_list(PidginPrivacyDialog *dialog, GtkListStore *model, |
| 6371 | 145 | GtkWidget **ret_treeview) |
| 146 | { | |
| 147 | GtkWidget *sw; | |
| 148 | GtkWidget *treeview; | |
| 149 | GtkCellRenderer *rend; | |
| 150 | GtkTreeViewColumn *column; | |
| 151 | GtkTreeSelection *sel; | |
| 152 | ||
| 153 | sw = gtk_scrolled_window_new(NULL, NULL); | |
| 154 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
| 13775 | 155 | GTK_POLICY_AUTOMATIC, |
| 156 | GTK_POLICY_AUTOMATIC); | |
|
7931
315fd3921a40
[gaim-migrate @ 8602]
Mark Doliner <markdoliner@pidgin.im>
parents:
7165
diff
changeset
|
157 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
| 6371 | 158 | |
| 159 | treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); | |
| 160 | *ret_treeview = treeview; | |
| 161 | ||
| 162 | rend = gtk_cell_renderer_text_new(); | |
| 163 | ||
| 164 | column = gtk_tree_view_column_new_with_attributes(NULL, rend, | |
| 165 | "text", 0, | |
| 166 | NULL); | |
| 167 | gtk_tree_view_column_set_clickable(GTK_TREE_VIEW_COLUMN(column), TRUE); | |
| 168 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
| 169 | gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE); | |
|
7931
315fd3921a40
[gaim-migrate @ 8602]
Mark Doliner <markdoliner@pidgin.im>
parents:
7165
diff
changeset
|
170 | gtk_container_add(GTK_CONTAINER(sw), treeview); |
|
6374
0bbc59035c89
[gaim-migrate @ 6879]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
171 | |
| 6371 | 172 | gtk_widget_show(treeview); |
| 173 | ||
| 174 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); | |
| 175 | ||
| 176 | g_signal_connect(G_OBJECT(sel), "changed", | |
| 177 | G_CALLBACK(user_selected_cb), dialog); | |
| 178 | ||
|
6374
0bbc59035c89
[gaim-migrate @ 6879]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
179 | gtk_widget_set_size_request(sw, -1, 200); |
|
0bbc59035c89
[gaim-migrate @ 6879]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
180 | |
| 6371 | 181 | return sw; |
| 182 | } | |
| 183 | ||
| 184 | static GtkWidget * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
185 | build_allow_list(PidginPrivacyDialog *dialog) |
| 6371 | 186 | { |
| 187 | GtkWidget *widget; | |
| 188 | GtkWidget *list; | |
| 189 | ||
| 190 | dialog->allow_store = gtk_list_store_new(1, G_TYPE_STRING); | |
| 191 | ||
|
11047
1b0452e2f2a9
[gaim-migrate @ 12972]
Richard Laager <rlaager@pidgin.im>
parents:
10704
diff
changeset
|
192 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(dialog->allow_store), 0, GTK_SORT_ASCENDING); |
|
1b0452e2f2a9
[gaim-migrate @ 12972]
Richard Laager <rlaager@pidgin.im>
parents:
10704
diff
changeset
|
193 | |
| 6371 | 194 | widget = build_list(dialog, dialog->allow_store, &list); |
| 195 | ||
| 196 | dialog->allow_list = list; | |
| 197 | ||
| 198 | rebuild_allow_list(dialog); | |
| 199 | ||
| 200 | return widget; | |
| 201 | } | |
| 202 | ||
| 203 | static GtkWidget * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
204 | build_block_list(PidginPrivacyDialog *dialog) |
| 6371 | 205 | { |
| 206 | GtkWidget *widget; | |
| 207 | GtkWidget *list; | |
| 208 | ||
| 209 | dialog->block_store = gtk_list_store_new(1, G_TYPE_STRING); | |
| 210 | ||
|
11047
1b0452e2f2a9
[gaim-migrate @ 12972]
Richard Laager <rlaager@pidgin.im>
parents:
10704
diff
changeset
|
211 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(dialog->block_store), 0, GTK_SORT_ASCENDING); |
|
1b0452e2f2a9
[gaim-migrate @ 12972]
Richard Laager <rlaager@pidgin.im>
parents:
10704
diff
changeset
|
212 | |
| 6371 | 213 | widget = build_list(dialog, dialog->block_store, &list); |
| 214 | ||
| 215 | dialog->block_list = list; | |
| 216 | ||
| 217 | rebuild_block_list(dialog); | |
| 218 | ||
| 219 | return widget; | |
| 220 | } | |
| 221 | ||
| 222 | static gint | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
223 | destroy_cb(GtkWidget *w, GdkEvent *event, PidginPrivacyDialog *dialog) |
| 6371 | 224 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
225 | pidgin_privacy_dialog_hide(); |
| 6371 | 226 | |
| 227 | return 0; | |
| 228 | } | |
| 229 | ||
| 230 | static void | |
| 15884 | 231 | select_account_cb(GtkWidget *dropdown, PurpleAccount *account, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
232 | PidginPrivacyDialog *dialog) |
| 6371 | 233 | { |
| 234 | int i; | |
| 235 | ||
| 236 | dialog->account = account; | |
| 237 | ||
| 238 | for (i = 0; i < menu_entry_count; i++) { | |
| 239 | if (menu_entries[i].num == account->perm_deny) { | |
| 240 | gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), i); | |
| 241 | break; | |
| 242 | } | |
| 243 | } | |
| 244 | ||
| 245 | rebuild_allow_list(dialog); | |
| 246 | rebuild_block_list(dialog); | |
| 247 | } | |
| 248 | ||
|
10704
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10535
diff
changeset
|
249 | /* |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10535
diff
changeset
|
250 | * TODO: Setting the permit/deny setting needs to go through privacy.c |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10535
diff
changeset
|
251 | * Even better: the privacy API needs to not suck. |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10535
diff
changeset
|
252 | */ |
| 6371 | 253 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
254 | type_changed_cb(GtkOptionMenu *optmenu, PidginPrivacyDialog *dialog) |
| 6371 | 255 | { |
|
8275
e4c1bfcbced6
[gaim-migrate @ 8999]
Mark Doliner <markdoliner@pidgin.im>
parents:
8175
diff
changeset
|
256 | int new_type = menu_entries[gtk_option_menu_get_history(optmenu)].num; |
| 6371 | 257 | |
|
8520
0a0fe6abc212
[gaim-migrate @ 9259]
Mark Doliner <markdoliner@pidgin.im>
parents:
8275
diff
changeset
|
258 | dialog->account->perm_deny = new_type; |
| 15884 | 259 | serv_set_permit_deny(purple_account_get_connection(dialog->account)); |
| 6371 | 260 | |
| 261 | gtk_widget_hide(dialog->allow_widget); | |
| 262 | gtk_widget_hide(dialog->block_widget); | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
263 | gtk_widget_hide_all(dialog->button_box); |
| 6371 | 264 | |
| 15884 | 265 | if (new_type == PURPLE_PRIVACY_ALLOW_USERS) { |
| 6371 | 266 | gtk_widget_show(dialog->allow_widget); |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
267 | gtk_widget_show_all(dialog->button_box); |
| 6371 | 268 | dialog->in_allow_list = TRUE; |
| 269 | } | |
| 15884 | 270 | else if (new_type == PURPLE_PRIVACY_DENY_USERS) { |
| 6371 | 271 | gtk_widget_show(dialog->block_widget); |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
272 | gtk_widget_show_all(dialog->button_box); |
| 6371 | 273 | dialog->in_allow_list = FALSE; |
| 274 | } | |
|
10147
a4897a5bcf8d
[gaim-migrate @ 11224]
Peter Lawler <pidgin@bleeter.id.au>
parents:
9791
diff
changeset
|
275 | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
276 | gtk_widget_show_all(dialog->close_button); |
|
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
277 | gtk_widget_show(dialog->button_box); |
|
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
278 | |
| 15884 | 279 | purple_blist_schedule_save(); |
| 280 | pidgin_blist_refresh(purple_get_blist()); | |
| 6371 | 281 | } |
| 282 | ||
| 283 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
284 | add_cb(GtkWidget *button, PidginPrivacyDialog *dialog) |
| 6371 | 285 | { |
| 286 | if (dialog->in_allow_list) | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
287 | pidgin_request_add_permit(dialog->account, NULL); |
| 6371 | 288 | else |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
289 | pidgin_request_add_block(dialog->account, NULL); |
| 6371 | 290 | } |
| 291 | ||
| 292 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
293 | remove_cb(GtkWidget *button, PidginPrivacyDialog *dialog) |
| 6371 | 294 | { |
| 295 | GtkTreeIter iter; | |
| 296 | GtkTreeModel *model; | |
| 297 | GtkTreeSelection *sel; | |
| 298 | char *name; | |
| 299 | ||
| 300 | if (dialog->in_allow_list && dialog->allow_store == NULL) | |
| 301 | return; | |
| 302 | ||
| 303 | if (!dialog->in_allow_list && dialog->block_store == NULL) | |
| 304 | return; | |
| 305 | ||
| 306 | if (dialog->in_allow_list) { | |
| 307 | model = GTK_TREE_MODEL(dialog->allow_store); | |
| 308 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->allow_list)); | |
| 309 | } | |
| 310 | else { | |
| 311 | model = GTK_TREE_MODEL(dialog->block_store); | |
| 312 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->block_list)); | |
| 313 | } | |
| 314 | ||
| 315 | if (gtk_tree_selection_get_selected(sel, NULL, &iter)) | |
| 316 | gtk_tree_model_get(model, &iter, 0, &name, -1); | |
| 317 | else | |
| 318 | return; | |
| 319 | ||
| 320 | if (dialog->in_allow_list) { | |
|
6375
2378950122af
[gaim-migrate @ 6880]
Christian Hammond <chipx86@chipx86.com>
parents:
6374
diff
changeset
|
321 | if (find_permit_block_by_name(dialog->account->permit, name)) |
| 15884 | 322 | purple_privacy_permit_remove(dialog->account, name, FALSE); |
| 6371 | 323 | } |
| 324 | else { | |
|
6375
2378950122af
[gaim-migrate @ 6880]
Christian Hammond <chipx86@chipx86.com>
parents:
6374
diff
changeset
|
325 | if (find_permit_block_by_name(dialog->account->deny, name)) |
| 15884 | 326 | purple_privacy_deny_remove(dialog->account, name, FALSE); |
| 6371 | 327 | } |
|
13149
895f0495b7db
[gaim-migrate @ 15511]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12852
diff
changeset
|
328 | g_free(name); |
| 6371 | 329 | } |
| 330 | ||
| 331 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
332 | clear_cb(GtkWidget *button, PidginPrivacyDialog *dialog) |
| 6371 | 333 | { |
| 8556 | 334 | GSList *l; |
| 335 | if (dialog->in_allow_list) | |
| 336 | l = dialog->account->permit; | |
| 337 | else | |
| 338 | l = dialog->account->deny; | |
| 339 | while (l) { | |
| 340 | char *user; | |
| 341 | user = l->data; | |
| 342 | l = l->next; | |
| 343 | if (dialog->in_allow_list) | |
| 15884 | 344 | purple_privacy_permit_remove(dialog->account, user, FALSE); |
| 8556 | 345 | else |
| 15884 | 346 | purple_privacy_deny_remove(dialog->account, user, FALSE); |
| 8556 | 347 | } |
| 6371 | 348 | } |
| 349 | ||
| 350 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
351 | close_cb(GtkWidget *button, PidginPrivacyDialog *dialog) |
| 6371 | 352 | { |
|
7165
6547d94b0725
[gaim-migrate @ 7732]
Mark Doliner <markdoliner@pidgin.im>
parents:
6646
diff
changeset
|
353 | gtk_widget_destroy(dialog->win); |
|
6547d94b0725
[gaim-migrate @ 7732]
Mark Doliner <markdoliner@pidgin.im>
parents:
6646
diff
changeset
|
354 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
355 | pidgin_privacy_dialog_hide(); |
| 6371 | 356 | } |
| 357 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
358 | static PidginPrivacyDialog * |
| 6371 | 359 | privacy_dialog_new(void) |
| 360 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
361 | PidginPrivacyDialog *dialog; |
| 6371 | 362 | GtkWidget *vbox; |
| 363 | GtkWidget *button; | |
| 364 | GtkWidget *dropdown; | |
| 365 | GtkWidget *label; | |
| 366 | GtkWidget *menu; | |
| 367 | int selected = 0; | |
| 368 | int i; | |
| 369 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
370 | dialog = g_new0(PidginPrivacyDialog, 1); |
| 6371 | 371 | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
372 | dialog->win = pidgin_create_dialog(_("Privacy"), PIDGIN_HIG_BORDER, "privacy", TRUE); |
| 6371 | 373 | |
| 374 | g_signal_connect(G_OBJECT(dialog->win), "delete_event", | |
| 375 | G_CALLBACK(destroy_cb), dialog); | |
| 376 | ||
| 377 | /* Main vbox */ | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
378 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(dialog->win), FALSE, PIDGIN_HIG_BORDER); |
| 6371 | 379 | |
| 380 | /* Description label */ | |
| 381 | label = gtk_label_new( | |
| 382 | _("Changes to privacy settings take effect immediately.")); | |
| 383 | ||
| 384 | gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 385 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 386 | gtk_widget_show(label); | |
| 387 | ||
| 388 | /* Accounts drop-down */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
389 | dropdown = pidgin_account_option_menu_new(NULL, FALSE, |
|
12852
dc6be215f15e
[gaim-migrate @ 15202]
Richard Laager <rlaager@pidgin.im>
parents:
12849
diff
changeset
|
390 | G_CALLBACK(select_account_cb), NULL, dialog); |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22005
diff
changeset
|
391 | pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Set privacy for:"), NULL, dropdown, TRUE, NULL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
392 | dialog->account = pidgin_account_option_menu_get_selected(dropdown); |
| 6371 | 393 | |
| 394 | /* Add the drop-down list with the allow/block types. */ | |
| 395 | dialog->type_menu = gtk_option_menu_new(); | |
| 396 | gtk_box_pack_start(GTK_BOX(vbox), dialog->type_menu, FALSE, FALSE, 0); | |
| 397 | gtk_widget_show(dialog->type_menu); | |
| 398 | ||
| 399 | /* Build the menu for that. */ | |
| 400 | menu = gtk_menu_new(); | |
| 401 | ||
| 402 | for (i = 0; i < menu_entry_count; i++) { | |
| 15568 | 403 | pidgin_new_item(menu, _(menu_entries[i].text)); |
| 6371 | 404 | |
| 405 | if (menu_entries[i].num == dialog->account->perm_deny) | |
| 406 | selected = i; | |
| 407 | } | |
| 408 | ||
| 409 | gtk_option_menu_set_menu(GTK_OPTION_MENU(dialog->type_menu), menu); | |
| 410 | gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), selected); | |
| 411 | ||
| 412 | g_signal_connect(G_OBJECT(dialog->type_menu), "changed", | |
| 413 | G_CALLBACK(type_changed_cb), dialog); | |
| 414 | ||
| 415 | /* Build the treeview for the allow list. */ | |
| 416 | dialog->allow_widget = build_allow_list(dialog); | |
| 417 | gtk_box_pack_start(GTK_BOX(vbox), dialog->allow_widget, TRUE, TRUE, 0); | |
| 418 | ||
| 419 | /* Build the treeview for the block list. */ | |
| 420 | dialog->block_widget = build_block_list(dialog); | |
| 421 | gtk_box_pack_start(GTK_BOX(vbox), dialog->block_widget, TRUE, TRUE, 0); | |
| 422 | ||
| 423 | /* Add the button box for Add, Remove, Clear */ | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
424 | dialog->button_box = pidgin_dialog_get_action_area(GTK_DIALOG(dialog->win)); |
| 6371 | 425 | |
| 426 | /* Add button */ | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
427 | button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_ADD, G_CALLBACK(add_cb), dialog); |
| 6371 | 428 | dialog->add_button = button; |
| 429 | ||
| 430 | /* Remove button */ | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
431 | button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_REMOVE, G_CALLBACK(remove_cb), dialog); |
| 6371 | 432 | dialog->remove_button = button; |
| 433 | gtk_widget_set_sensitive(button, FALSE); | |
| 434 | ||
| 435 | /* Clear button */ | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
436 | button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLEAR, G_CALLBACK(clear_cb), dialog); |
| 6371 | 437 | dialog->clear_button = button; |
| 438 | ||
| 439 | /* Close button */ | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
440 | button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog); |
|
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
441 | dialog->close_button = button; |
| 6371 | 442 | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
443 | type_changed_cb(GTK_OPTION_MENU(dialog->type_menu), dialog); |
|
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
444 | #if 0 |
| 15884 | 445 | if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) { |
| 6371 | 446 | gtk_widget_show(dialog->allow_widget); |
| 447 | gtk_widget_show(dialog->button_box); | |
| 448 | dialog->in_allow_list = TRUE; | |
| 449 | } | |
| 15884 | 450 | else if (dialog->account->perm_deny == PURPLE_PRIVACY_DENY_USERS) { |
| 6371 | 451 | gtk_widget_show(dialog->block_widget); |
| 452 | gtk_widget_show(dialog->button_box); | |
| 453 | dialog->in_allow_list = FALSE; | |
| 454 | } | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
455 | #endif |
| 6371 | 456 | return dialog; |
| 457 | } | |
| 458 | ||
| 459 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
460 | pidgin_privacy_dialog_show(void) |
| 6371 | 461 | { |
| 15884 | 462 | g_return_if_fail(purple_connections_get_all() != NULL); |
|
10352
802e7ab5b838
[gaim-migrate @ 11569]
Mark Doliner <markdoliner@pidgin.im>
parents:
10148
diff
changeset
|
463 | |
| 6371 | 464 | if (privacy_dialog == NULL) |
| 465 | privacy_dialog = privacy_dialog_new(); | |
| 466 | ||
| 467 | gtk_widget_show(privacy_dialog->win); | |
| 468 | gdk_window_raise(privacy_dialog->win->window); | |
| 469 | } | |
| 470 | ||
| 471 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
472 | pidgin_privacy_dialog_hide(void) |
| 6371 | 473 | { |
| 474 | if (privacy_dialog == NULL) | |
| 475 | return; | |
| 476 | ||
|
7165
6547d94b0725
[gaim-migrate @ 7732]
Mark Doliner <markdoliner@pidgin.im>
parents:
6646
diff
changeset
|
477 | g_free(privacy_dialog); |
| 6371 | 478 | privacy_dialog = NULL; |
| 479 | } | |
| 480 | ||
| 481 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
482 | destroy_request_data(PidginPrivacyRequestData *data) |
| 6371 | 483 | { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
484 | g_free(data->name); |
| 6371 | 485 | g_free(data); |
| 486 | } | |
| 487 | ||
| 488 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
489 | confirm_permit_block_cb(PidginPrivacyRequestData *data, int option) |
| 6371 | 490 | { |
| 491 | if (data->block) | |
| 15884 | 492 | purple_privacy_deny(data->account, data->name, FALSE, FALSE); |
| 6371 | 493 | else |
| 15884 | 494 | purple_privacy_allow(data->account, data->name, FALSE, FALSE); |
| 6371 | 495 | |
| 496 | destroy_request_data(data); | |
| 497 | } | |
| 498 | ||
| 499 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
500 | add_permit_block_cb(PidginPrivacyRequestData *data, const char *name) |
| 6371 | 501 | { |
| 502 | data->name = g_strdup(name); | |
| 503 | ||
| 504 | confirm_permit_block_cb(data, 0); | |
| 505 | } | |
| 506 | ||
| 507 | void | |
| 15884 | 508 | pidgin_request_add_permit(PurpleAccount *account, const char *name) |
| 6371 | 509 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
510 | PidginPrivacyRequestData *data; |
| 6371 | 511 | |
| 512 | g_return_if_fail(account != NULL); | |
| 513 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
514 | data = g_new0(PidginPrivacyRequestData, 1); |
| 6371 | 515 | data->account = account; |
| 516 | data->name = g_strdup(name); | |
| 517 | data->block = FALSE; | |
| 518 | ||
| 519 | if (name == NULL) { | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
520 | purple_request_input(account, _("Permit User"), |
| 6371 | 521 | _("Type a user you permit to contact you."), |
| 522 | _("Please enter the name of the user you wish to be " | |
| 523 | "able to contact you."), | |
| 8697 | 524 | NULL, FALSE, FALSE, NULL, |
| 12603 | 525 | _("_Permit"), G_CALLBACK(add_permit_block_cb), |
| 6371 | 526 | _("Cancel"), G_CALLBACK(destroy_request_data), |
|
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:
16254
diff
changeset
|
527 | account, name, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
528 | data); |
| 6371 | 529 | } |
| 530 | else { | |
| 531 | char *primary = g_strdup_printf(_("Allow %s to contact you?"), name); | |
| 532 | char *secondary = | |
| 533 | g_strdup_printf(_("Are you sure you wish to allow " | |
| 534 | "%s to contact you?"), name); | |
| 535 | ||
| 536 | ||
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
537 | purple_request_action(account, _("Permit User"), primary, secondary, |
|
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:
16254
diff
changeset
|
538 | 0, |
|
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:
16254
diff
changeset
|
539 | account, name, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
540 | data, 2, |
| 12603 | 541 | _("_Permit"), G_CALLBACK(confirm_permit_block_cb), |
| 6371 | 542 | _("Cancel"), G_CALLBACK(destroy_request_data)); |
| 543 | ||
| 544 | g_free(primary); | |
| 545 | g_free(secondary); | |
| 546 | } | |
| 547 | } | |
| 548 | ||
| 549 | void | |
| 15884 | 550 | pidgin_request_add_block(PurpleAccount *account, const char *name) |
| 6371 | 551 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
552 | PidginPrivacyRequestData *data; |
| 6371 | 553 | |
| 554 | g_return_if_fail(account != NULL); | |
| 555 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
556 | data = g_new0(PidginPrivacyRequestData, 1); |
| 6371 | 557 | data->account = account; |
| 558 | data->name = g_strdup(name); | |
| 559 | data->block = TRUE; | |
| 560 | ||
| 561 | if (name == NULL) { | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
562 | purple_request_input(account, _("Block User"), |
| 6371 | 563 | _("Type a user to block."), |
| 564 | _("Please enter the name of the user you wish to block."), | |
| 8697 | 565 | NULL, FALSE, FALSE, NULL, |
| 12603 | 566 | _("_Block"), G_CALLBACK(add_permit_block_cb), |
| 6371 | 567 | _("Cancel"), G_CALLBACK(destroy_request_data), |
|
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:
16254
diff
changeset
|
568 | account, name, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
569 | data); |
| 6371 | 570 | } |
| 571 | else { | |
| 572 | char *primary = g_strdup_printf(_("Block %s?"), name); | |
| 573 | char *secondary = | |
| 574 | g_strdup_printf(_("Are you sure you want to block %s?"), name); | |
| 575 | ||
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
576 | purple_request_action(account, _("Block User"), primary, secondary, |
|
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:
16254
diff
changeset
|
577 | 0, |
|
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:
16254
diff
changeset
|
578 | account, name, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
579 | data, 2, |
| 12603 | 580 | _("_Block"), G_CALLBACK(confirm_permit_block_cb), |
| 6371 | 581 | _("Cancel"), G_CALLBACK(destroy_request_data)); |
| 582 | ||
| 583 | g_free(primary); | |
| 584 | g_free(secondary); | |
| 585 | } | |
| 586 | } | |
| 587 | ||
| 588 | static void | |
| 15884 | 589 | pidgin_permit_added_removed(PurpleAccount *account, const char *name) |
| 6371 | 590 | { |
| 591 | if (privacy_dialog != NULL) | |
| 592 | rebuild_allow_list(privacy_dialog); | |
| 593 | } | |
| 594 | ||
| 595 | static void | |
| 15884 | 596 | pidgin_deny_added_removed(PurpleAccount *account, const char *name) |
| 6371 | 597 | { |
| 598 | if (privacy_dialog != NULL) | |
| 599 | rebuild_block_list(privacy_dialog); | |
| 600 | } | |
| 601 | ||
| 15884 | 602 | static PurplePrivacyUiOps privacy_ops = |
| 6371 | 603 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
604 | pidgin_permit_added_removed, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
605 | pidgin_permit_added_removed, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
606 | pidgin_deny_added_removed, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
607 | pidgin_deny_added_removed, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
608 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
609 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
610 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
611 | NULL |
| 6371 | 612 | }; |
| 613 | ||
| 15884 | 614 | PurplePrivacyUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
615 | pidgin_privacy_get_ui_ops(void) |
| 6371 | 616 | { |
| 617 | return &privacy_ops; | |
| 618 | } | |
| 619 | ||
| 620 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15486
diff
changeset
|
621 | pidgin_privacy_init(void) |
| 6371 | 622 | { |
| 623 | } |