annotate libpurple/protocols/oscar/family_icq.c @ 30631:b00967045cc2

Ouch, I accidentally removed too much code in b367bdaac1f79166db0e9478ae30e2a7628f6848. Fixes #12768.
author ivan.komarov@soc.pidgin.im
date Sun, 24 Oct 2010 18:57:21 +0000
parents 11c54d781835
children a1964c506f29
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
2 * Purple's oscar protocol plugin
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 * This file is the legal property of its developers.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 * Please see the AUTHORS file distributed alongside this file.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 * This library is free software; you can redistribute it and/or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * version 2 of the License, or (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * This library is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * Lesser General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * License along with this library; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19641
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * Family 0x0015 - Encapsulated ICQ.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25
30381
a347a4cd1caf Moved encoding-related functions to a separate file, renamed some of them,
ivan.komarov@soc.pidgin.im
parents: 30362
diff changeset
26 #include "encoding.h"
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "oscar.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
29 #define AIM_ICQ_INFO_REQUEST 0x04b2
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
30 #define AIM_ICQ_ALIAS_REQUEST 0x04ba
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
31
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
32 static
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
33 int compare_icq_infos(gconstpointer a, gconstpointer b)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
34 {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
35 const struct aim_icq_info* aa = a;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
36 const guint16* bb = b;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
37 return aa->reqid - *bb;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
38 }
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
39
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
40 static void aim_icq_freeinfo(struct aim_icq_info *info) {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
41 int i;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
42
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
43 if (!info)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
44 return;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
45 g_free(info->nick);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
46 g_free(info->first);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
47 g_free(info->last);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
48 g_free(info->email);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
49 g_free(info->homecity);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
50 g_free(info->homestate);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
51 g_free(info->homephone);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
52 g_free(info->homefax);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
53 g_free(info->homeaddr);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
54 g_free(info->mobile);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
55 g_free(info->homezip);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
56 g_free(info->personalwebpage);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
57 if (info->email2)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
58 for (i = 0; i < info->numaddresses; i++)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
59 g_free(info->email2[i]);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
60 g_free(info->email2);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
61 g_free(info->workcity);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
62 g_free(info->workstate);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
63 g_free(info->workphone);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
64 g_free(info->workfax);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
65 g_free(info->workaddr);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
66 g_free(info->workzip);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
67 g_free(info->workcompany);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
68 g_free(info->workdivision);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
69 g_free(info->workposition);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
70 g_free(info->workwebpage);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
71 g_free(info->info);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
72 g_free(info->status_note_title);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
73 g_free(info->auth_request_reason);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
74 }
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
75
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
76 static
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
77 int error(OscarData *od, aim_modsnac_t *error_snac, ByteStream *bs)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
78 {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
79 aim_snac_t *original_snac = aim_remsnac(od, error_snac->id);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
80 guint16 *request_type;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
81 GSList *original_info_ptr;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
82 struct aim_icq_info *original_info;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
83 guint16 reason;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
84 gchar *uin;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
85
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
86 if (!original_snac || (original_snac->family != SNAC_FAMILY_ICQ) || !original_snac->data) {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
87 purple_debug_misc("oscar", "icq: the original snac for the error packet was not found");
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
88 g_free(original_snac);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
89 return 0;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
90 }
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
91
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
92 request_type = original_snac->data;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
93 original_info_ptr = g_slist_find_custom(od->icq_info, &original_snac->id, compare_icq_infos);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
94 original_info = original_info_ptr->data;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
95
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
96 if (!original_info_ptr) {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
97 purple_debug_misc("oscar", "icq: the request info for the error packet was not found");
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
98 g_free(original_snac);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
99 return 0;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
100 }
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
101
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
102 reason = byte_stream_get16(bs);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
103 uin = g_strdup_printf("%u", original_info->uin);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
104 switch (*request_type) {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
105 case AIM_ICQ_INFO_REQUEST:
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
106 oscar_user_info_display_error(od, reason, uin);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
107 break;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
108 case AIM_ICQ_ALIAS_REQUEST:
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
109 /* Couldn't retrieve an alias for the buddy requesting authorization; have to make do with UIN only. */
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
110 if (original_info->for_auth_request)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
111 oscar_auth_recvrequest(od->gc, uin, NULL, original_info->auth_request_reason);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
112 break;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
113 default:
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
114 purple_debug_misc("oscar", "icq: got an error packet with unknown request type %u", *request_type);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
115 break;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
116 }
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
117
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
118 aim_icq_freeinfo(original_info);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
119 od->icq_info = g_slist_remove(od->icq_info, original_info_ptr);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
120 g_free(original_snac->data);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
121 g_free(original_snac);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
122 return 1;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
123 }
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
124
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 int
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 aim_icq_setsecurity(OscarData *od, gboolean auth_required, gboolean webaware)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 FlapConnection *conn;
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
129 ByteStream bs;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 aim_snacid_t snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 int bslen;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
133 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 bslen = 2+4+2+2+2+2+2+1+1+1+1+1+1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
138 byte_stream_new(&bs, 4 + bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
140 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 /* For simplicity, don't bother using a tlvlist */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
143 byte_stream_put16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
144 byte_stream_put16(&bs, bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
146 byte_stream_putle16(&bs, bslen - 2);
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
147 byte_stream_putuid(&bs, od);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
148 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
149 byte_stream_putle16(&bs, snacid); /* eh. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
150 byte_stream_putle16(&bs, 0x0c3a); /* shrug. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
151 byte_stream_putle16(&bs, 0x030c);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
152 byte_stream_putle16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
153 byte_stream_putle8(&bs, webaware);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
154 byte_stream_putle8(&bs, 0xf8);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
155 byte_stream_putle8(&bs, 0x02);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
156 byte_stream_putle8(&bs, 0x01);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
157 byte_stream_putle8(&bs, 0x00);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
158 byte_stream_putle8(&bs, !auth_required);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159
30400
11c54d781835 Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents: 30381
diff changeset
160 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, snacid, &bs);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
161
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
162 byte_stream_destroy(&bs);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 * Change your ICQ password.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 * @param od The oscar session
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 * @param passwd The new password. If this is longer than 8 characters it
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 * will be truncated.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 * @return Return 0 if no errors, otherwise return the error number.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 int aim_icq_changepasswd(OscarData *od, const char *passwd)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 FlapConnection *conn;
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
178 ByteStream bs;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 aim_snacid_t snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180 int bslen, passwdlen;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 if (!passwd)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
185 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188 passwdlen = strlen(passwd);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 if (passwdlen > MAXICQPASSLEN)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190 passwdlen = MAXICQPASSLEN;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 bslen = 2+4+2+2+2+2+passwdlen+1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
193 byte_stream_new(&bs, 4 + bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
195 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197 /* For simplicity, don't bother using a tlvlist */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
198 byte_stream_put16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
199 byte_stream_put16(&bs, bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
201 byte_stream_putle16(&bs, bslen - 2);
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
202 byte_stream_putuid(&bs, od);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
203 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
204 byte_stream_putle16(&bs, snacid); /* eh. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
205 byte_stream_putle16(&bs, 0x042e); /* shrug. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
206 byte_stream_putle16(&bs, passwdlen+1);
29686
c2155cf648f9 Actually write a truncated version of the password to the change password
Mark Doliner <mark@kingant.net>
parents: 27796
diff changeset
207 byte_stream_putraw(&bs, (const guint8 *)passwd, passwdlen);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
208 byte_stream_putle8(&bs, '\0');
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209
30400
11c54d781835 Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents: 30381
diff changeset
210 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, snacid, &bs);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
211
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
212 byte_stream_destroy(&bs);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 int aim_icq_getallinfo(OscarData *od, const char *uin)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 FlapConnection *conn;
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
220 ByteStream bs;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 aim_snacid_t snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 int bslen;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 struct aim_icq_info *info;
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
224 guint16 request_type = AIM_ICQ_INFO_REQUEST;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 if (!uin || uin[0] < '0' || uin[0] > '9')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
229 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 bslen = 2 + 4 + 2 + 2 + 2 + 4;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
234 byte_stream_new(&bs, 4 + bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
236 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, &request_type, sizeof(request_type));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 /* For simplicity, don't bother using a tlvlist */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
239 byte_stream_put16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
240 byte_stream_put16(&bs, bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
242 byte_stream_putle16(&bs, bslen - 2);
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
243 byte_stream_putuid(&bs, od);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
244 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
245 byte_stream_putle16(&bs, snacid); /* eh. */
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
246 byte_stream_putle16(&bs, request_type); /* shrug. */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
247 byte_stream_putle32(&bs, atoi(uin));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248
30400
11c54d781835 Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents: 30381
diff changeset
249 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, snacid, &bs, FALSE);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
250
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
251 byte_stream_destroy(&bs);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 /* Keep track of this request and the ICQ number and request ID */
17191
1927f4ead3ca Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15822
diff changeset
254 info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 info->reqid = snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 info->uin = atoi(uin);
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
257 od->icq_info = g_slist_prepend(od->icq_info, info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261
30357
674a656893a3 Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents: 29686
diff changeset
262 int aim_icq_getalias(OscarData *od, const char *uin, gboolean for_auth_request, char *auth_request_reason)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 FlapConnection *conn;
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
265 ByteStream bs;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266 aim_snacid_t snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 int bslen;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 struct aim_icq_info *info;
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
269 guint16 request_type = AIM_ICQ_ALIAS_REQUEST;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 if (!uin || uin[0] < '0' || uin[0] > '9')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
274 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276
27741
9d5d6b9ae18a oscar: Fix debug message newline I noticed in a log from #pidgin.
Paul Aurich <paul@darkrain42.org>
parents: 25386
diff changeset
277 purple_debug_info("oscar", "Requesting ICQ alias for %s\n", uin);
23577
60030a36506e Shift several rate-limiting-costly ICQ info requests to be low priority
Evan Schoenberg <evan.s@dreskin.net>
parents: 23568
diff changeset
278
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 bslen = 2 + 4 + 2 + 2 + 2 + 4;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
281 byte_stream_new(&bs, 4 + bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
283 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, &request_type, sizeof(request_type));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 /* For simplicity, don't bother using a tlvlist */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
286 byte_stream_put16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
287 byte_stream_put16(&bs, bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
289 byte_stream_putle16(&bs, bslen - 2);
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
290 byte_stream_putuid(&bs, od);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
291 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
292 byte_stream_putle16(&bs, snacid); /* eh. */
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
293 byte_stream_putle16(&bs, request_type); /* shrug. */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
294 byte_stream_putle32(&bs, atoi(uin));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295
30400
11c54d781835 Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents: 30381
diff changeset
296 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, snacid, &bs, FALSE);
22856
ab2322195dab Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents: 22717
diff changeset
297
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
298 byte_stream_destroy(&bs);
22856
ab2322195dab Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents: 22717
diff changeset
299
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 /* Keep track of this request and the ICQ number and request ID */
17191
1927f4ead3ca Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15822
diff changeset
301 info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 info->reqid = snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 info->uin = atoi(uin);
30357
674a656893a3 Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents: 29686
diff changeset
304 info->for_auth_request = for_auth_request;
674a656893a3 Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents: 29686
diff changeset
305 info->auth_request_reason = g_strdup(auth_request_reason);
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
306 od->icq_info = g_slist_prepend(od->icq_info, info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312 * Send an SMS message. This is the non-US way. The US-way is to IM
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313 * their cell phone number (+19195551234).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 * We basically construct and send an XML message. The format is:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 * <icq_sms_message>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 * <destination>full_phone_without_leading_+</destination>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318 * <text>message</text>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319 * <codepage>1252</codepage>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320 * <senders_UIN>self_uin</senders_UIN>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321 * <senders_name>self_name</senders_name>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322 * <delivery_receipt>Yes|No</delivery_receipt>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323 * <time>Wkd, DD Mmm YYYY HH:MM:SS TMZ</time>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
324 * </icq_sms_message>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326 * Yeah hi Peter, whaaaat's happening. If there's any way to use
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
327 * a codepage other than 1252 that would be great. Thaaaanks.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 int aim_icq_sendsms(OscarData *od, const char *name, const char *msg, const char *alias)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
331 FlapConnection *conn;
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
332 PurpleAccount *account;
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
333 ByteStream bs;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334 aim_snacid_t snacid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335 int bslen, xmllen;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336 char *xml;
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
337 const char *timestr, *username;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338 time_t t;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
339 struct tm *tm;
19641
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
340 gchar *stripped;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
342 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 if (!name || !msg || !alias)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
348 account = purple_connection_get_account(od->gc);
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
349 username = purple_account_get_username(account);
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
350
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351 time(&t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
352 tm = gmtime(&t);
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
353 timestr = purple_utf8_strftime("%a, %d %b %Y %T %Z", tm);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354
19641
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
355 stripped = purple_markup_strip_html(msg);
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
356
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357 /* The length of xml included the null terminating character */
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
358 xmllen = 209 + strlen(name) + strlen(stripped) + strlen(username) + strlen(alias) + strlen(timestr) + 1;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
360 xml = g_new(char, xmllen);
19641
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
361 snprintf(xml, xmllen, "<icq_sms_message>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
362 "<destination>%s</destination>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
363 "<text>%s</text>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
364 "<codepage>1252</codepage>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
365 "<senders_UIN>%s</senders_UIN>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
366 "<senders_name>%s</senders_name>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
367 "<delivery_receipt>Yes</delivery_receipt>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
368 "<time>%s</time>"
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
369 "</icq_sms_message>",
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
370 name, stripped, username, alias, timestr);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371
19641
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
372 bslen = 36 + xmllen;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
374 byte_stream_new(&bs, 4 + bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
376 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 /* For simplicity, don't bother using a tlvlist */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
379 byte_stream_put16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
380 byte_stream_put16(&bs, bslen);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
382 byte_stream_putle16(&bs, bslen - 2);
24665
531922f4ea2a Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents: 23581
diff changeset
383 byte_stream_putuid(&bs, od);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
384 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
385 byte_stream_putle16(&bs, snacid); /* eh. */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 /* From libicq200-0.3.2/src/SNAC-SRV.cpp */
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
388 byte_stream_putle16(&bs, 0x1482);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
389 byte_stream_put16(&bs, 0x0001);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
390 byte_stream_put16(&bs, 0x0016);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
391 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
392 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
393 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
394 byte_stream_put32(&bs, 0x00000000);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
396 byte_stream_put16(&bs, 0x0000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
397 byte_stream_put16(&bs, xmllen);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
398 byte_stream_putstr(&bs, xml);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
399 byte_stream_put8(&bs, 0x00);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400
30400
11c54d781835 Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents: 30381
diff changeset
401 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, snacid, &bs);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
402
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
403 byte_stream_destroy(&bs);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
404
17191
1927f4ead3ca Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15822
diff changeset
405 g_free(xml);
19641
eb0933e158a4 Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents: 17369
diff changeset
406 g_free(stripped);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410
30361
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
411 static int
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
412 gotalias(OscarData *od, struct aim_icq_info *info)
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
413 {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
414 PurpleConnection *gc = od->gc;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
415 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: 30360
diff changeset
416 gchar who[16], *utf8;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
417 PurpleBuddy *b;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
418
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
419 if (info->nick[0] && (utf8 = oscar_utf8_try_convert(account, od, info->nick))) {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
420 if (info->for_auth_request) {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
421 oscar_auth_recvrequest(gc, g_strdup_printf("%u", info->uin), utf8, info->auth_request_reason);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
422 } else {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
423 g_snprintf(who, sizeof(who), "%u", info->uin);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
424 serv_got_alias(gc, who, utf8);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
425 if ((b = purple_find_buddy(account, who))) {
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
426 purple_blist_node_set_string((PurpleBlistNode*)b, "servernick", utf8);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
427 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
428 g_free(utf8);
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
429 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
430 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
431 return 1;
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
432 }
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
433
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434 /**
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
435 * Subtype 0x0003 - Response to SNAC_FAMILY_ICQ/0x002, contains an ICQesque packet.
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 static int
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
438 icqresponse(OscarData *od, aim_modsnac_t *snac, ByteStream *bs)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 {
17369
f80f7e1047be Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents: 17191
diff changeset
440 GSList *tlvlist;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441 aim_tlv_t *datatlv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 ByteStream qbs;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443 guint32 ouruin;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 guint16 cmdlen, cmd, reqid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445
17369
f80f7e1047be Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents: 17191
diff changeset
446 if (!(tlvlist = aim_tlvlist_read(bs)) || !(datatlv = aim_tlv_gettlv(tlvlist, 0x0001, 1))) {
f80f7e1047be Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents: 17191
diff changeset
447 aim_tlvlist_free(tlvlist);
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
448 purple_debug_misc("oscar", "corrupt ICQ response\n");
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 byte_stream_init(&qbs, datatlv->value, datatlv->length);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 cmdlen = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 ouruin = byte_stream_getle32(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 cmd = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
457 reqid = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
458
22486
3225c99785b8 Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents: 22347
diff changeset
459 purple_debug_misc("oscar", "icq response: %d bytes, %u, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460
30359
8d5b0cbec844 Removed the old way of retrieving offline messages, because it is not
ivan.komarov@soc.pidgin.im
parents: 30357
diff changeset
461 if (cmd == 0x07da) { /* information */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 guint16 subtype;
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
463 GSList *info_ptr;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 struct aim_icq_info *info;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466 subtype = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 byte_stream_advance(&qbs, 1); /* 0x0a */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 /* find other data from the same request */
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
470 info_ptr = g_slist_find_custom(od->icq_info, &reqid, compare_icq_infos);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
471 if (!info_ptr) {
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
472 struct aim_icq_info *new_info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
473 new_info->reqid = reqid;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
474 info_ptr = od->icq_info = g_slist_prepend(od->icq_info, new_info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
477 info = info_ptr->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 switch (subtype) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479 case 0x00a0: { /* hide ip status */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
480 /* nothing */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483 case 0x00aa: { /* password change status */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 /* nothing */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
487 case 0x00c8: { /* general and "home" information */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
488 info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489 info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 info->email = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 info->homecity = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 info->homestate = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 info->homephone = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 info->homefax = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 info->homeaddr = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497 info->mobile = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 info->homezip = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 info->homecountry = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 /* 0x0a 00 02 00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 /* 1 byte timezone? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502 /* 1 byte hide email flag? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
504
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 case 0x00dc: { /* personal information */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 info->age = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
507 info->unknown = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 info->gender = byte_stream_getle8(&qbs); /* Not specified=0x00, Female=0x01, Male=0x02 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 info->personalwebpage = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510 info->birthyear = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511 info->birthmonth = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
512 info->birthday = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
513 info->language1 = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514 info->language2 = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 info->language3 = byte_stream_getle8(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516 /* 0x00 00 01 00 00 01 00 00 00 00 00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 case 0x00d2: { /* work information */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 info->workcity = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 info->workstate = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522 info->workphone = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 info->workfax = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 info->workaddr = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 info->workzip = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 info->workcountry = byte_stream_getle16(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527 info->workcompany = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 info->workdivision = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529 info->workposition = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 byte_stream_advance(&qbs, 2); /* 0x01 00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
531 info->workwebpage = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
533
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534 case 0x00e6: { /* additional personal information */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 info->info = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)-1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
537
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 case 0x00eb: { /* email address(es) */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
539 int i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 info->numaddresses = byte_stream_getle16(&qbs);
17191
1927f4ead3ca Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15822
diff changeset
541 info->email2 = (char **)g_new0(char *, info->numaddresses);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 for (i = 0; i < info->numaddresses; i++) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543 info->email2[i] = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
544 if (i+1 != info->numaddresses)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
545 byte_stream_advance(&qbs, 1); /* 0x00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
546 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 case 0x00f0: { /* personal interests */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
551
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552 case 0x00fa: { /* past background and current organizations */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
554
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 case 0x0104: { /* alias info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556 info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
557 info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558 info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559 byte_stream_advance(&qbs, byte_stream_getle16(&qbs)); /* email address? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 /* Then 0x00 02 00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
561 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
562
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563 case 0x010e: { /* unknown */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564 /* 0x00 00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
565 } break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 case 0x019a: { /* simple info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568 byte_stream_advance(&qbs, 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569 info->uin = byte_stream_getle32(&qbs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
570 info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
571 info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
572 info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573 info->email = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
574 /* Then 0x00 02 00 00 00 00 00 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575 } break;
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
576
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
577 /* status note title and send request for status note text */
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
578 case 0x0fb4: {
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
579 GSList *tlvlist;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
580 aim_tlv_t *tlv;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
581 FlapConnection *conn;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
582 char *uin = NULL;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
583 char *status_note_title = NULL;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
584
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
585 conn = flap_connection_findbygroup(od, 0x0004);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
586 if (conn == NULL)
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
587 {
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
588 purple_debug_misc("oscar", "icq/0x0fb4: flap connection was not found.\n");
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
589 break;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
590 }
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
591
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
592 byte_stream_advance(&qbs, 0x02); /* length */
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
593 byte_stream_advance(&qbs, 0x2f); /* unknown stuff */
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
594
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
595 tlvlist = aim_tlvlist_read(&qbs);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
596
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
597 tlv = aim_tlv_gettlv(tlvlist, 0x0032, 1);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
598 if (tlv != NULL)
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
599 /* Get user number */
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
600 uin = aim_tlv_getvalue_as_string(tlv);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
601
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
602 tlv = aim_tlv_gettlv(tlvlist, 0x0226, 1);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
603 if (tlv != NULL)
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
604 /* Get status note title */
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
605 status_note_title = aim_tlv_getvalue_as_string(tlv);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
606
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
607 aim_tlvlist_free(tlvlist);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
608
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
609 if (uin == NULL || status_note_title == NULL)
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
610 {
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
611 purple_debug_misc("oscar", "icq/0x0fb4: uin or "
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
612 "status_note_title was not found\n");
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
613 g_free(uin);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
614 g_free(status_note_title);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
615 break;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
616 }
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
617
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
618 if (status_note_title[0] == '\0')
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
619 {
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
620 PurpleAccount *account;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
621 PurpleBuddy *buddy;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
622 PurplePresence *presence;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
623 PurpleStatus *status;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
624
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
625 account = purple_connection_get_account(od->gc);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
626 buddy = purple_find_buddy(account, uin);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
627 presence = purple_buddy_get_presence(buddy);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
628 status = purple_presence_get_active_status(presence);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
629
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
630 purple_prpl_got_user_status(account, uin,
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
631 purple_status_get_id(status),
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
632 "message", NULL, NULL);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
633
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
634 g_free(status_note_title);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
635 }
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
636 else
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
637 {
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
638 struct aim_icq_info *info;
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
639 ByteStream bs;
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
640 guint32 bslen;
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
641 aim_snacid_t snacid;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
642 guchar cookie[8];
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
643
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
644 info = g_new0(struct aim_icq_info, 1);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
645
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
646 bslen = 13 + strlen(uin) + 30 + 6 + 4 + 55 + 85 + 4;
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
647 byte_stream_new(&bs, 4 + bslen);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
648
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
649 snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
650
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
651 aim_icbm_makecookie(cookie);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
652
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
653 byte_stream_putraw(&bs, cookie, 8); /* ICBM cookie */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
654 byte_stream_put16(&bs, 0x0002); /* message channel */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
655 byte_stream_put8(&bs, strlen(uin)); /* uin */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
656 byte_stream_putstr(&bs, uin);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
657
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
658 byte_stream_put16(&bs, 0x0005); /* rendez vous data */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
659 byte_stream_put16(&bs, 0x00b2);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
660 byte_stream_put16(&bs, 0x0000); /* request */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
661 byte_stream_putraw(&bs, cookie, 8); /* ICBM cookie */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
662 byte_stream_put32(&bs, 0x09461349); /* ICQ server relaying */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
663 byte_stream_put16(&bs, 0x4c7f);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
664 byte_stream_put16(&bs, 0x11d1);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
665 byte_stream_put32(&bs, 0x82224445);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
666 byte_stream_put32(&bs, 0x53540000);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
667
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
668 byte_stream_put16(&bs, 0x000a); /* unknown TLV */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
669 byte_stream_put16(&bs, 0x0002);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
670 byte_stream_put16(&bs, 0x0001);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
671
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
672 byte_stream_put16(&bs, 0x000f); /* unknown TLV */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
673 byte_stream_put16(&bs, 0x0000);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
674
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
675 byte_stream_put16(&bs, 0x2711); /* extended data */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
676 byte_stream_put16(&bs, 0x008a);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
677 byte_stream_putle16(&bs, 0x001b); /* length */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
678 byte_stream_putle16(&bs, 0x0009); /* version */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
679 byte_stream_putle32(&bs, 0x00000000); /* plugin: none */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
680 byte_stream_putle32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
681 byte_stream_putle32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
682 byte_stream_putle32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
683 byte_stream_putle16(&bs, 0x0000); /* unknown */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
684 byte_stream_putle32(&bs, 0x00000000); /* client capabilities flags */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
685 byte_stream_put8(&bs, 0x00); /* unknown */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
686 byte_stream_putle16(&bs, 0x0064); /* downcounter? */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
687 byte_stream_putle16(&bs, 0x000e); /* length */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
688 byte_stream_putle16(&bs, 0x0064); /* downcounter? */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
689 byte_stream_putle32(&bs, 0x00000000); /* unknown */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
690 byte_stream_putle32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
691 byte_stream_putle32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
692 byte_stream_put8(&bs, 0x1a); /* message type: plugin message descibed by text string */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
693 byte_stream_put8(&bs, 0x00); /* message flags */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
694 byte_stream_putle16(&bs, 0x0000); /* status code */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
695 byte_stream_putle16(&bs, 0x0001); /* priority code */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
696 byte_stream_putle16(&bs, 0x0000); /* text length */
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
697
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
698 byte_stream_put8(&bs, 0x3a); /* message dump */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
699 byte_stream_put32(&bs, 0x00811a18);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
700 byte_stream_put32(&bs, 0xbc0e6c18);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
701 byte_stream_put32(&bs, 0x47a5916f);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
702 byte_stream_put32(&bs, 0x18dcc76f);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
703 byte_stream_put32(&bs, 0x1a010013);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
704 byte_stream_put32(&bs, 0x00000041);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
705 byte_stream_put32(&bs, 0x77617920);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
706 byte_stream_put32(&bs, 0x53746174);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
707 byte_stream_put32(&bs, 0x7573204d);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
708 byte_stream_put32(&bs, 0x65737361);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
709 byte_stream_put32(&bs, 0x67650100);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
710 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
711 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
712 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
713 byte_stream_put32(&bs, 0x00000015);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
714 byte_stream_put32(&bs, 0x00000000);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
715 byte_stream_put32(&bs, 0x0000000d);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
716 byte_stream_put32(&bs, 0x00000074);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
717 byte_stream_put32(&bs, 0x6578742f);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
718 byte_stream_put32(&bs, 0x782d616f);
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
719 byte_stream_put32(&bs, 0x6c727466);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
720
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
721 byte_stream_put16(&bs, 0x0003); /* server ACK requested */
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
722 byte_stream_put16(&bs, 0x0000);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
723
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
724 info->uin = atoi(uin);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
725 info->status_note_title = status_note_title;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
726
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
727 memcpy(&info->icbm_cookie, cookie, 8);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
728
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
729 od->icq_info = g_slist_prepend(od->icq_info, info);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
730
30400
11c54d781835 Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents: 30381
diff changeset
731 flap_connection_send_snac_with_priority(od, conn, 0x0004, 0x0006, snacid, &bs, FALSE);
22717
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
732
979a81468e19 All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents: 22486
diff changeset
733 byte_stream_destroy(&bs);
21993
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
734 }
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
735
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
736 g_free(uin);
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
737
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
738 } break;
bb1190d6961c Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
739
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740 } /* End switch statement */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
741
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
742 if (!(snac->flags & 0x0001)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743 if (subtype != 0x0104)
30361
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
744 oscar_user_info_display_icq(od, info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
745
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
746 if (info->uin && info->nick)
30361
9881f18b95b1 Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents: 30360
diff changeset
747 gotalias(od, info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
748
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
749 aim_icq_freeinfo(info);
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
750 od->icq_info = g_slist_remove(od->icq_info, info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753
17369
f80f7e1047be Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents: 17191
diff changeset
754 aim_tlvlist_free(tlvlist);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
755
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
756 return 1;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
757 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
758
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
759 static int
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
760 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
761 {
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
762 if (snac->subtype == 0x0001)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
763 return error(od, snac, bs);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
764 else if (snac->subtype == 0x0003)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
765 return icqresponse(od, snac, bs);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
766
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
768 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 icq_shutdown(OscarData *od, aim_module_t *mod)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772 {
30362
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
773 GSList *cur;
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
774 for (cur = od->icq_info; cur; cur = cur->next)
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
775 aim_icq_freeinfo(cur->data);
879baaf87aa2 Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents: 30361
diff changeset
776 g_slist_free(od->icq_info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
777 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
778
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779 int
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
780 icq_modfirst(OscarData *od, aim_module_t *mod)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781 {
23313
9c0ee2491ed1 Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents: 22856
diff changeset
782 mod->family = SNAC_FAMILY_ICQ;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
783 mod->version = 0x0001;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
784 mod->toolid = 0x0110;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
785 mod->toolversion = 0x047c;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
786 mod->flags = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
787 strncpy(mod->name, "icq", sizeof(mod->name));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
788 mod->snachandler = snachandler;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
789 mod->shutdown = icq_shutdown;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
790
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
791 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
792 }