libpurple/protocols/oscar/authorization.c

Thu, 16 Dec 2010 21:18:02 +0000

author
Ivan Komarov <ivan.komarov@pidgin.im>
date
Thu, 16 Dec 2010 21:18:02 +0000
changeset 31244
d42b8115ab4e
parent 30638
2f1952f26351
child 31294
73607ab89c6f
permissions
-rw-r--r--

Restore the previous behavior (kind of) of falling back to the specified
Account-specific encoding when we receive a message without the encoding
specified (such as the ones that Miranda sends when "Send Unicode messages"
is disabled).

Fixes #12778


committer: Daniel Atallah <datallah@pidgin.im>

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

mercurial