Mercurial > pidgin
annotate libpurple/protocols/oscar/family_icq.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | 4a8f81812ba3 |
children |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15822 | 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 } |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30637
diff
changeset
|
91 |
30362
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); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30637
diff
changeset
|
94 |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
95 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
|
96 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
|
97 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
|
98 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
|
99 } |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30637
diff
changeset
|
100 |
32742 | 101 original_info = original_info_ptr->data; |
102 | |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
103 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
|
104 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
|
105 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
|
106 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
|
107 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
|
108 break; |
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
109 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
|
110 /* 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
|
111 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
|
112 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
|
113 break; |
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
114 default: |
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
115 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
|
116 break; |
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 |
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
119 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
|
120 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
|
121 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
|
122 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
|
123 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
|
124 } |
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
125 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 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
|
128 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 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
|
130 ByteStream bs; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
134 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
|
135 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 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
|
138 |
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
|
139 byte_stream_new(&bs, 4 + bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
141 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
|
142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 /* 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
|
144 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
|
145 byte_stream_put16(&bs, bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 |
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
|
147 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
|
148 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
|
149 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
|
150 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
|
151 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
|
152 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
|
153 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 byte_stream_putle8(&bs, !auth_required); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 |
30400
11c54d781835
Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents:
30381
diff
changeset
|
161 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
|
162 |
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
|
163 byte_stream_destroy(&bs); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 return 0; |
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 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 * Change your ICQ password. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 * @param od The oscar session |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 * @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
|
173 * will be truncated. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 * @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
|
175 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 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
|
177 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 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
|
179 ByteStream bs; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 int bslen, passwdlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 if (!passwd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
186 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
|
187 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 passwdlen = strlen(passwd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 if (passwdlen > MAXICQPASSLEN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 passwdlen = MAXICQPASSLEN; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 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
|
193 |
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
|
194 byte_stream_new(&bs, 4 + bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
196 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
|
197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 /* 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
|
199 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
|
200 byte_stream_put16(&bs, bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 |
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
|
202 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
|
203 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
|
204 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
|
205 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
|
206 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
|
207 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
|
208 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
|
209 byte_stream_putle8(&bs, '\0'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 |
30400
11c54d781835
Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents:
30381
diff
changeset
|
211 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
|
212 |
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
|
213 byte_stream_destroy(&bs); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 return 0; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 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
|
219 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 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
|
221 ByteStream bs; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 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
|
225 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
|
226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 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
|
228 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
230 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
|
231 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 bslen = 2 + 4 + 2 + 2 + 2 + 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 |
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
|
235 byte_stream_new(&bs, 4 + bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
237 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
|
238 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 /* 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
|
240 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
|
241 byte_stream_put16(&bs, bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 |
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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 byte_stream_putle32(&bs, atoi(uin)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 |
30400
11c54d781835
Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents:
30381
diff
changeset
|
250 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
|
251 |
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
|
252 byte_stream_destroy(&bs); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 /* 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
|
255 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
|
256 info->reqid = snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 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
|
258 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
|
259 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 |
30357
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
29686
diff
changeset
|
263 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
|
264 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 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
|
266 ByteStream bs; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 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
|
270 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
|
271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 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
|
273 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
275 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
|
276 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 |
27741
9d5d6b9ae18a
oscar: Fix debug message newline I noticed in a log from #pidgin.
Paul Aurich <paul@darkrain42.org>
parents:
25386
diff
changeset
|
278 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
|
279 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 bslen = 2 + 4 + 2 + 2 + 2 + 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
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
|
282 byte_stream_new(&bs, 4 + bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
284 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
|
285 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 /* 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
|
287 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
|
288 byte_stream_put16(&bs, bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 |
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
|
290 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
|
291 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
|
292 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
|
293 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
|
294 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
|
295 byte_stream_putle32(&bs, atoi(uin)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 |
30400
11c54d781835
Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents:
30381
diff
changeset
|
297 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
|
298 |
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
|
299 byte_stream_destroy(&bs); |
22856
ab2322195dab
Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents:
22717
diff
changeset
|
300 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 /* 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
|
302 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
|
303 info->reqid = snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 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
|
305 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
|
306 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
|
307 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
|
308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 return 0; |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 * 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
|
314 * their cell phone number (+19195551234). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 * 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
|
317 * <icq_sms_message> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 * <destination>full_phone_without_leading_+</destination> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 * <text>message</text> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 * <codepage>1252</codepage> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 * <senders_UIN>self_uin</senders_UIN> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 * <senders_name>self_name</senders_name> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 * <delivery_receipt>Yes|No</delivery_receipt> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 * <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
|
325 * </icq_sms_message> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 * 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
|
328 * 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
|
329 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 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
|
331 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 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
|
333 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
|
334 ByteStream bs; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 int bslen, xmllen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 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
|
338 const char *timestr, *username; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 time_t t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 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
|
341 gchar *stripped; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
343 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
|
344 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 if (!name || !msg || !alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
348 |
24665
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23581
diff
changeset
|
349 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
|
350 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
|
351 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 time(&t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 tm = gmtime(&t); |
15822 | 354 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
|
355 |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17369
diff
changeset
|
356 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
|
357 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 /* 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
|
359 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
|
360 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 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
|
362 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
|
363 "<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
|
364 "<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
|
365 "<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
|
366 "<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
|
367 "<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
|
368 "<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
|
369 "<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
|
370 "</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
|
371 name, stripped, username, alias, timestr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17369
diff
changeset
|
373 bslen = 36 + xmllen; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 |
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
|
375 byte_stream_new(&bs, 4 + bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
377 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
|
378 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 /* 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
|
380 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
|
381 byte_stream_put16(&bs, bslen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 |
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
|
383 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
|
384 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
|
385 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
|
386 byte_stream_putle16(&bs, snacid); /* eh. */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 /* 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
|
389 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
|
390 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
|
391 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
|
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); |
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
|
395 byte_stream_put32(&bs, 0x00000000); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 |
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
|
397 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
|
398 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
|
399 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
|
400 byte_stream_put8(&bs, 0x00); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 |
30400
11c54d781835
Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents:
30381
diff
changeset
|
402 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
|
403 |
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
|
404 byte_stream_destroy(&bs); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 |
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
|
406 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
|
407 g_free(stripped); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 |
30637
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
412 static void |
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
|
413 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
|
414 { |
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 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
|
416 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
|
417 PurpleBuddy *b; |
30637
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
418 gchar *utf8 = oscar_utf8_try_convert(account, od, 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
|
419 |
30637
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
420 if (info->for_auth_request) { |
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
421 oscar_auth_recvrequest(gc, g_strdup_printf("%u", info->uin), utf8, info->auth_request_reason); |
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
422 } else { |
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
423 if (utf8 && *utf8) { |
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
424 gchar who[16]; |
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
|
425 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
|
426 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
|
427 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
|
428 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
|
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 } |
30637
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30400
diff
changeset
|
431 g_free(utf8); |
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
|
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 } |
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30360
diff
changeset
|
434 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 /** |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
436 * 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
|
437 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 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
|
439 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
|
440 { |
17369
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17191
diff
changeset
|
441 GSList *tlvlist; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 aim_tlv_t *datatlv; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 ByteStream qbs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 guint32 ouruin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 guint16 cmdlen, cmd, reqid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 |
17369
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17191
diff
changeset
|
447 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
|
448 aim_tlvlist_free(tlvlist); |
15822 | 449 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
|
450 return 0; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 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
|
454 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 cmdlen = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 ouruin = byte_stream_getle32(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 cmd = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 reqid = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 |
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
|
460 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
|
461 |
30359
8d5b0cbec844
Removed the old way of retrieving offline messages, because it is not
ivan.komarov@soc.pidgin.im
parents:
30357
diff
changeset
|
462 if (cmd == 0x07da) { /* information */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 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
|
464 GSList *info_ptr; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 struct aim_icq_info *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 subtype = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 byte_stream_advance(&qbs, 1); /* 0x0a */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 /* 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
|
471 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
|
472 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
|
473 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
|
474 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
|
475 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
|
476 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
478 info = info_ptr->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 switch (subtype) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 case 0x00a0: { /* hide ip status */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 /* nothing */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 case 0x00aa: { /* password change status */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 /* nothing */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 case 0x00c8: { /* general and "home" information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 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
|
490 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
|
491 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
|
492 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
|
493 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
|
494 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
|
495 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
|
496 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
|
497 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
|
498 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
|
499 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
|
500 info->homecountry = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 /* 0x0a 00 02 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 /* 1 byte timezone? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 /* 1 byte hide email flag? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 case 0x00dc: { /* personal information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 info->age = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 info->unknown = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 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
|
510 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
|
511 info->birthyear = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 info->birthmonth = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 info->birthday = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 info->language1 = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 info->language2 = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 info->language3 = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 /* 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
|
518 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 case 0x00d2: { /* work information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 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
|
522 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
|
523 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
|
524 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
|
525 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
|
526 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
|
527 info->workcountry = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 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
|
529 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
|
530 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
|
531 byte_stream_advance(&qbs, 2); /* 0x01 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 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
|
533 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 case 0x00e6: { /* additional personal information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 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
|
537 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 case 0x00eb: { /* email address(es) */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 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
|
542 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
|
543 for (i = 0; i < info->numaddresses; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 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
|
545 if (i+1 != info->numaddresses) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 byte_stream_advance(&qbs, 1); /* 0x00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 case 0x00f0: { /* personal interests */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 case 0x00fa: { /* past background and current organizations */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 case 0x0104: { /* alias info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 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
|
558 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
|
559 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
|
560 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
|
561 /* Then 0x00 02 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 case 0x010e: { /* unknown */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 /* 0x00 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 case 0x019a: { /* simple info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 byte_stream_advance(&qbs, 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 info->uin = byte_stream_getle32(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 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
|
572 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
|
573 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
|
574 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
|
575 /* 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
|
576 } break; |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
577 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
578 /* 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
|
579 case 0x0fb4: { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
580 GSList *tlvlist; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
581 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
|
582 FlapConnection *conn; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
583 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
|
584 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
|
585 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
586 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
|
587 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
|
588 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
589 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
|
590 break; |
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 |
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, 0x02); /* length */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
594 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
|
595 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
596 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
|
597 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
598 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
|
599 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
|
600 /* 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
|
601 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
|
602 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
603 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
|
604 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
|
605 /* 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
|
606 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
|
607 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
608 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
|
609 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
610 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
|
611 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
612 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
|
613 "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
|
614 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
|
615 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
|
616 break; |
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 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
619 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
|
620 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
621 PurpleAccount *account; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
622 PurpleBuddy *buddy; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
623 PurplePresence *presence; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
624 PurpleStatus *status; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
625 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
626 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
|
627 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
|
628 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
|
629 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
|
630 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
631 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
|
632 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
|
633 "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
|
634 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
635 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
|
636 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
637 else |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
638 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
639 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
|
640 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
|
641 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
|
642 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
|
643 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
|
644 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
645 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
|
646 |
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
|
647 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
|
648 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
|
649 |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
650 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
|
651 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
652 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
|
653 |
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
|
654 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
|
655 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
|
656 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
|
657 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
|
658 |
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
|
659 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
|
660 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
|
661 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
|
662 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
|
663 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
|
664 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
|
665 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
|
666 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
|
667 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
|
668 |
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
|
669 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
|
670 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
|
671 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
|
672 |
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
|
673 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
|
674 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
|
675 |
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
|
676 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
|
677 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
|
678 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
|
679 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
|
680 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
|
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_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
|
684 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
|
685 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
|
686 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
|
687 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
|
688 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
|
689 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
|
690 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
|
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_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
|
693 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
|
694 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
|
695 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
|
696 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
|
697 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
|
698 |
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
|
699 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
|
700 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
|
701 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
|
702 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
|
703 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
|
704 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
|
705 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
|
706 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
|
707 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
|
708 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
|
709 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
|
710 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
|
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, 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
|
714 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
|
715 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
|
716 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
|
717 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
|
718 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
|
719 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
|
720 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
|
721 |
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
|
722 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
|
723 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
|
724 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
725 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
|
726 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
|
727 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
728 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
|
729 |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
730 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
|
731 |
30400
11c54d781835
Removed unused "flags" parameter.
ivan.komarov@soc.pidgin.im
parents:
30381
diff
changeset
|
732 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
|
733 |
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
|
734 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
|
735 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
736 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
737 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
|
738 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
739 } break; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
740 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 } /* End switch statement */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
742 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 if (!(snac->flags & 0x0001)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 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
|
745 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
|
746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 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
|
748 gotalias(od, info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 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
|
751 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
|
752 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 |
17369
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17191
diff
changeset
|
755 aim_tlvlist_free(tlvlist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
757 return 1; |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 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
|
762 { |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
763 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
|
764 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
|
765 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
|
766 return icqresponse(od, snac, bs); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 return 0; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
771 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
772 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
|
773 { |
30362
879baaf87aa2
Added an error handler for family_icq.c. So far it works for
ivan.komarov@soc.pidgin.im
parents:
30361
diff
changeset
|
774 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
|
775 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
|
776 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
|
777 g_slist_free(od->icq_info); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 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
|
782 { |
23313
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22856
diff
changeset
|
783 mod->family = SNAC_FAMILY_ICQ; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
784 mod->version = 0x0001; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 mod->toolid = 0x0110; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 mod->toolversion = 0x047c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 mod->flags = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 strncpy(mod->name, "icq", sizeof(mod->name)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 mod->snachandler = snachandler; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 mod->shutdown = icq_shutdown; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
791 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
792 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
793 } |