annotate libpurple/protocols/oscar/authorization.c @ 30917:e17ac5b9621f

g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0. So implement a workaround. media.c also uses g_hash_table_get_keys, but I didn't change that one.
author Mark Doliner <mark@kingant.net>
date Wed, 10 Nov 2010 01:17:22 +0000
parents 9881f18b95b1
children a8cc50c2279f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30361
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
1 /*
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
2 * Purple's oscar protocol plugin
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
3 * This file is the legal property of its developers.
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
4 * Please see the AUTHORS file distributed alongside this file.
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
5 *
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
6 * This library is free software; you can redistribute it and/or
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
9 * version 2 of the License, or (at your option) any later version.
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
10 *
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
11 * This library is distributed in the hope that it will be useful,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
14 * Lesser General Public License for more details.
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
15 *
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
17 * License along with this library; if not, write to the Free Software
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
19 */
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
20
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
21 /*
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
22 * Everything related to OSCAR authorization requests.
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
23 */
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
24
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
25 #include "oscar.h"
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
26 #include "request.h"
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
27
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
28 static void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
29 oscar_auth_request(struct name_data *data, char *msg)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
30 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
31 PurpleConnection *gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
32 OscarData *od;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
33 PurpleAccount *account;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
34 PurpleBuddy *buddy;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
35 PurpleGroup *group;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
36 const char *bname, *gname;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
37
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
38 gc = data->gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
39 od = purple_connection_get_protocol_data(gc);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
40 account = purple_connection_get_account(gc);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
41 buddy = purple_find_buddy(account, data->name);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
42 if (buddy != NULL)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
43 group = purple_buddy_get_group(buddy);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
44 else
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
45 group = NULL;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
46
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
47 if (group != NULL)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
48 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
49 bname = purple_buddy_get_name(buddy);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
50 gname = purple_group_get_name(group);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
51 purple_debug_info("oscar", "ssi: adding buddy %s to group %s\n",
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
52 bname, gname);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
53 aim_ssi_sendauthrequest(od, data->name, msg ? msg : _("Please authorize me so I can add you to my buddy list."));
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
54 if (!aim_ssi_itemlist_finditem(od->ssi.local, gname, bname, AIM_SSI_TYPE_BUDDY))
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
55 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
56 aim_ssi_addbuddy(od, bname, gname, NULL, purple_buddy_get_alias_only(buddy), NULL, NULL, TRUE);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
57
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
58 /* Mobile users should always be online */
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
59 if (bname[0] == '+') {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
60 purple_prpl_got_user_status(account,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
61 purple_buddy_get_name(buddy),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
62 OSCAR_STATUS_ID_AVAILABLE, NULL);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
63 purple_prpl_got_user_status(account,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
64 purple_buddy_get_name(buddy),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
65 OSCAR_STATUS_ID_MOBILE, NULL);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
66 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
67 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
68 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
69
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
70 oscar_free_name_data(data);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
71 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
72
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
73 static void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
74 oscar_auth_grant(gpointer cbdata)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
75 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
76 struct name_data *data = cbdata;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
77 PurpleConnection *gc = data->gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
78 OscarData *od = purple_connection_get_protocol_data(gc);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
79
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
80 aim_ssi_sendauthreply(od, data->name, 0x01, NULL);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
81
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
82 oscar_free_name_data(data);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
83 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
84
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
85 static void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
86 oscar_auth_dontgrant(struct name_data *data, char *msg)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
87 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
88 PurpleConnection *gc = data->gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
89 OscarData *od = purple_connection_get_protocol_data(gc);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
90
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
91 aim_ssi_sendauthreply(od, data->name, 0x00, msg ? msg : _("No reason given."));
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
92
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
93 oscar_free_name_data(data);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
94 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
95
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
96 static void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
97 oscar_auth_dontgrant_msgprompt(gpointer cbdata)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
98 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
99 struct name_data *data = cbdata;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
100 purple_request_input(data->gc, NULL, _("Authorization Denied Message:"),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
101 NULL, _("No reason given."), TRUE, FALSE, NULL,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
102 _("_OK"), G_CALLBACK(oscar_auth_dontgrant),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
103 _("_Cancel"), G_CALLBACK(oscar_free_name_data),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
104 purple_connection_get_account(data->gc), data->name, NULL,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
105 data);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
106 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
107
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
108 /* When you ask other people for authorization */
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
109 void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
110 oscar_auth_sendrequest(PurpleConnection *gc, const char *name)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
111 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
112 struct name_data *data;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
113
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
114 data = g_new0(struct name_data, 1);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
115 data->gc = gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
116 data->name = g_strdup(name);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
117
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
118 purple_request_input(data->gc, NULL, _("Authorization Request Message:"),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
119 NULL, _("Please authorize me!"), TRUE, FALSE, NULL,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
120 _("_OK"), G_CALLBACK(oscar_auth_request),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
121 _("_Cancel"), G_CALLBACK(oscar_free_name_data),
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
122 purple_connection_get_account(gc), name, NULL,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
123 data);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
124 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
125
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
126 void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
127 oscar_auth_sendrequest_menu(PurpleBlistNode *node, gpointer ignored)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
128 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
129 PurpleBuddy *buddy;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
130 PurpleConnection *gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
131
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
132 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
133
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
134 buddy = (PurpleBuddy *) node;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
135 gc = purple_account_get_connection(purple_buddy_get_account(buddy));
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
136 oscar_auth_sendrequest(gc, purple_buddy_get_name(buddy));
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
137 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
138
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
139 /* When other people ask you for authorization */
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
140 void
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
141 oscar_auth_recvrequest(PurpleConnection *gc, gchar *name, gchar *nick, gchar *reason)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
142 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
143 PurpleAccount* account = purple_connection_get_account(gc);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
144 struct name_data *data = g_new(struct name_data, 1);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
145
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
146 data->gc = gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
147 data->name = name;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
148 data->nick = nick;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
149
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
150 purple_account_request_authorization(account, data->name, NULL, data->nick,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
151 reason, purple_find_buddy(account, data->name) != NULL,
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
152 oscar_auth_grant, oscar_auth_dontgrant_msgprompt, data);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
diff changeset
153 }