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