Thu, 16 Dec 2010 21:18:02 +0000
Restore the previous behavior (kind of) of falling back to the specified
Account-specific encoding when we receive a message without the encoding
specified (such as the ones that Miranda sends when "Send Unicode messages"
is disabled).
Fixes #12778
committer: Daniel Atallah <datallah@pidgin.im>
| 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 | } |
|
a82ebc3a5c3d
Added an error handler for family_icq.c. So far it works for
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30638
diff
changeset
|
91 | |
|
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); |
|
a82ebc3a5c3d
Added an error handler for family_icq.c. So far it works for
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30638
diff
changeset
|
94 | original_info = original_info_ptr->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
|
95 | |
|
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 | 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
|
97 | 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
|
98 | 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
|
99 | 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
|
100 | } |
|
a82ebc3a5c3d
Added an error handler for family_icq.c. So far it works for
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30638
diff
changeset
|
101 | |
|
a82ebc3a5c3d
Added an error handler for family_icq.c. So far it works for
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30638
diff
changeset
|
102 | 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
|
103 | 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
|
104 | 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
|
105 | 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
|
106 | 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
|
107 | 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
|
108 | 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
|
109 | /* 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
|
110 | 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
|
111 | 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
|
112 | 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
|
113 | 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
|
114 | 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
|
115 | 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
|
116 | } |
|
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 | 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
|
119 | 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
|
120 | 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
|
121 | 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
|
122 | 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
|
123 | } |
|
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 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
125 | int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
126 | aim_icq_setsecurity(OscarData *od, gboolean auth_required, gboolean webaware) |
| 13235 | 127 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
128 | 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
|
129 | ByteStream bs; |
| 13235 | 130 | aim_snacid_t snacid; |
| 131 | int bslen; | |
| 132 | ||
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
133 | if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
| 13235 | 134 | return -EINVAL; |
| 135 | ||
| 136 | bslen = 2+4+2+2+2+2+2+1+1+1+1+1+1; | |
| 137 | ||
|
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
|
138 | byte_stream_new(&bs, 4 + bslen); |
| 13235 | 139 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
140 | snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
| 13235 | 141 | |
| 142 | /* 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
|
143 | 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
|
144 | byte_stream_put16(&bs, bslen); |
| 13235 | 145 | |
|
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
|
146 | 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
|
147 | 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
|
148 | 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
|
149 | 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
|
150 | 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
|
151 | 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
|
152 | 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
|
153 | 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
|
154 | 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
|
155 | 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
|
156 | 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
|
157 | 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
|
158 | byte_stream_putle8(&bs, !auth_required); |
| 13235 | 159 | |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30656
diff
changeset
|
160 | 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
|
161 | |
|
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 | byte_stream_destroy(&bs); |
| 13235 | 163 | |
| 164 | return 0; | |
| 165 | } | |
| 166 | ||
| 167 | /** | |
| 168 | * Change your ICQ password. | |
| 169 | * | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
170 | * @param od The oscar session |
| 13235 | 171 | * @param passwd The new password. If this is longer than 8 characters it |
| 172 | * will be truncated. | |
| 173 | * @return Return 0 if no errors, otherwise return the error number. | |
| 174 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
175 | int aim_icq_changepasswd(OscarData *od, const char *passwd) |
| 13235 | 176 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
177 | 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
|
178 | ByteStream bs; |
| 13235 | 179 | aim_snacid_t snacid; |
| 180 | int bslen, passwdlen; | |
| 181 | ||
| 182 | if (!passwd) | |
| 183 | return -EINVAL; | |
| 184 | ||
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
185 | if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
| 13235 | 186 | return -EINVAL; |
| 187 | ||
| 188 | passwdlen = strlen(passwd); | |
| 189 | if (passwdlen > MAXICQPASSLEN) | |
| 190 | passwdlen = MAXICQPASSLEN; | |
| 191 | bslen = 2+4+2+2+2+2+passwdlen+1; | |
| 192 | ||
|
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
|
193 | byte_stream_new(&bs, 4 + bslen); |
| 13235 | 194 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
195 | snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
| 13235 | 196 | |
| 197 | /* 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
|
198 | 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
|
199 | byte_stream_put16(&bs, bslen); |
| 13235 | 200 | |
|
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
|
201 | 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
|
202 | 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
|
203 | 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
|
204 | 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
|
205 | 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
|
206 | 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
|
207 | 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
|
208 | byte_stream_putle8(&bs, '\0'); |
| 13235 | 209 | |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30656
diff
changeset
|
210 | 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
|
211 | |
|
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 | byte_stream_destroy(&bs); |
| 13235 | 213 | |
| 214 | return 0; | |
| 215 | } | |
| 216 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
217 | int aim_icq_getallinfo(OscarData *od, const char *uin) |
| 13235 | 218 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
219 | 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
|
220 | ByteStream bs; |
| 13235 | 221 | aim_snacid_t snacid; |
| 222 | int bslen; | |
| 223 | 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
|
224 | guint16 request_type = AIM_ICQ_INFO_REQUEST; |
| 13235 | 225 | |
| 226 | if (!uin || uin[0] < '0' || uin[0] > '9') | |
| 227 | return -EINVAL; | |
| 228 | ||
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
229 | if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
| 13235 | 230 | return -EINVAL; |
| 231 | ||
| 232 | bslen = 2 + 4 + 2 + 2 + 2 + 4; | |
| 233 | ||
|
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
|
234 | byte_stream_new(&bs, 4 + bslen); |
| 13235 | 235 | |
|
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
|
236 | snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, &request_type, sizeof(request_type)); |
| 13235 | 237 | |
| 238 | /* 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
|
239 | 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
|
240 | byte_stream_put16(&bs, bslen); |
| 13235 | 241 | |
|
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
|
242 | 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
|
243 | 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
|
244 | 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
|
245 | 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
|
246 | 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
|
247 | byte_stream_putle32(&bs, atoi(uin)); |
| 13235 | 248 | |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30656
diff
changeset
|
249 | 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
|
250 | |
|
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 | byte_stream_destroy(&bs); |
| 13235 | 252 | |
| 253 | /* 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
|
254 | info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1); |
| 13235 | 255 | info->reqid = snacid; |
| 256 | 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
|
257 | od->icq_info = g_slist_prepend(od->icq_info, info); |
| 13235 | 258 | |
| 259 | return 0; | |
| 260 | } | |
| 261 | ||
|
30634
b1fc8d55eb42
Show authorization request sender's nickname in the "Authorize buddy?"
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29969
diff
changeset
|
262 | int aim_icq_getalias(OscarData *od, const char *uin, gboolean for_auth_request, char *auth_request_reason) |
| 13235 | 263 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
264 | 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
|
265 | ByteStream bs; |
| 13235 | 266 | aim_snacid_t snacid; |
| 267 | int bslen; | |
| 268 | 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
|
269 | guint16 request_type = AIM_ICQ_ALIAS_REQUEST; |
| 13235 | 270 | |
| 271 | if (!uin || uin[0] < '0' || uin[0] > '9') | |
| 272 | return -EINVAL; | |
| 273 | ||
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
274 | if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
| 13235 | 275 | return -EINVAL; |
| 276 | ||
|
28008
0860cf49db71
oscar: Fix debug message newline I noticed in a log from #pidgin.
Paul Aurich <darkrain42@pidgin.im>
parents:
25525
diff
changeset
|
277 | 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
|
278 | |
| 13235 | 279 | bslen = 2 + 4 + 2 + 2 + 2 + 4; |
| 280 | ||
|
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
|
281 | byte_stream_new(&bs, 4 + bslen); |
| 13235 | 282 | |
|
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
|
283 | snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, &request_type, sizeof(request_type)); |
| 13235 | 284 | |
| 285 | /* 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
|
286 | 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
|
287 | byte_stream_put16(&bs, bslen); |
| 13235 | 288 | |
|
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
|
289 | 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
|
290 | 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
|
291 | 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
|
292 | 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
|
293 | 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
|
294 | byte_stream_putle32(&bs, atoi(uin)); |
| 13235 | 295 | |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30656
diff
changeset
|
296 | 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
|
297 | |
|
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
|
298 | byte_stream_destroy(&bs); |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22860
diff
changeset
|
299 | |
| 13235 | 300 | /* 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
|
301 | info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1); |
| 13235 | 302 | info->reqid = snacid; |
| 303 | 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
|
304 | 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
|
305 | 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
|
306 | od->icq_info = g_slist_prepend(od->icq_info, info); |
| 13235 | 307 | |
| 308 | return 0; | |
| 309 | } | |
| 310 | ||
| 311 | /* | |
| 312 | * Send an SMS message. This is the non-US way. The US-way is to IM | |
| 313 | * their cell phone number (+19195551234). | |
| 314 | * | |
| 315 | * We basically construct and send an XML message. The format is: | |
| 316 | * <icq_sms_message> | |
| 317 | * <destination>full_phone_without_leading_+</destination> | |
| 318 | * <text>message</text> | |
| 319 | * <codepage>1252</codepage> | |
| 320 | * <senders_UIN>self_uin</senders_UIN> | |
| 321 | * <senders_name>self_name</senders_name> | |
| 322 | * <delivery_receipt>Yes|No</delivery_receipt> | |
| 323 | * <time>Wkd, DD Mmm YYYY HH:MM:SS TMZ</time> | |
| 324 | * </icq_sms_message> | |
| 325 | * | |
| 326 | * Yeah hi Peter, whaaaat's happening. If there's any way to use | |
| 327 | * a codepage other than 1252 that would be great. Thaaaanks. | |
| 328 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
329 | int aim_icq_sendsms(OscarData *od, const char *name, const char *msg, const char *alias) |
| 13235 | 330 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
331 | 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
|
332 | 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
|
333 | ByteStream bs; |
| 13235 | 334 | aim_snacid_t snacid; |
| 335 | int bslen, xmllen; | |
| 336 | 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
|
337 | const char *timestr, *username; |
| 13235 | 338 | time_t t; |
| 339 | 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
|
340 | gchar *stripped; |
| 13235 | 341 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
342 | if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
| 13235 | 343 | return -EINVAL; |
| 344 | ||
| 345 | if (!name || !msg || !alias) | |
| 346 | return -EINVAL; | |
| 347 | ||
|
25086
fb94ee60a4f2
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <markdoliner@pidgin.im>
parents:
23893
diff
changeset
|
348 | 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
|
349 | 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
|
350 | |
| 13235 | 351 | time(&t); |
| 352 | tm = gmtime(&t); | |
| 15884 | 353 | timestr = purple_utf8_strftime("%a, %d %b %Y %T %Z", tm); |
| 13235 | 354 | |
|
19819
e9d8873f4d27
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <markdoliner@pidgin.im>
parents:
17443
diff
changeset
|
355 | 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
|
356 | |
| 13235 | 357 | /* 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
|
358 | xmllen = 209 + strlen(name) + strlen(stripped) + strlen(username) + strlen(alias) + strlen(timestr) + 1; |
| 13235 | 359 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
360 | 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
|
361 | 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
|
362 | "<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
|
363 | "<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
|
364 | "<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
|
365 | "<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
|
366 | "<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
|
367 | "<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
|
368 | "<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
|
369 | "</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
|
370 | name, stripped, username, alias, timestr); |
| 13235 | 371 | |
|
19819
e9d8873f4d27
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <markdoliner@pidgin.im>
parents:
17443
diff
changeset
|
372 | bslen = 36 + xmllen; |
| 13235 | 373 | |
|
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
|
374 | byte_stream_new(&bs, 4 + bslen); |
| 13235 | 375 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
376 | snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
| 13235 | 377 | |
| 378 | /* 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
|
379 | 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
|
380 | byte_stream_put16(&bs, bslen); |
| 13235 | 381 | |
|
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
|
382 | 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
|
383 | 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
|
384 | 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
|
385 | byte_stream_putle16(&bs, snacid); /* eh. */ |
| 13235 | 386 | |
| 387 | /* 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
|
388 | 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
|
389 | 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
|
390 | 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
|
391 | 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
|
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); |
| 13235 | 395 | |
|
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
|
396 | 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
|
397 | 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
|
398 | 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
|
399 | byte_stream_put8(&bs, 0x00); |
| 13235 | 400 | |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30656
diff
changeset
|
401 | 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
|
402 | |
|
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 | byte_stream_destroy(&bs); |
| 13235 | 404 | |
|
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
|
405 | 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
|
406 | g_free(stripped); |
| 13235 | 407 | |
| 408 | return 0; | |
| 409 | } | |
| 410 | ||
|
30874
f04d2d1937e6
We should always display the "Authorize buddy?" mini-dialog, even
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30678
diff
changeset
|
411 | 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
|
412 | 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
|
413 | { |
|
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 | 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
|
415 | 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
|
416 | PurpleBuddy *b; |
|
30874
f04d2d1937e6
We should always display the "Authorize buddy?" mini-dialog, even
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30678
diff
changeset
|
417 | 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
|
418 | |
|
30874
f04d2d1937e6
We should always display the "Authorize buddy?" mini-dialog, even
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30678
diff
changeset
|
419 | 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
|
420 | 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
|
421 | } else { |
|
f04d2d1937e6
We should always display the "Authorize buddy?" mini-dialog, even
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30678
diff
changeset
|
422 | if (utf8 && *utf8) { |
|
f04d2d1937e6
We should always display the "Authorize buddy?" mini-dialog, even
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30678
diff
changeset
|
423 | 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
|
424 | 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
|
425 | 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
|
426 | 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
|
427 | 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
|
428 | } |
|
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 | } |
|
30874
f04d2d1937e6
We should always display the "Authorize buddy?" mini-dialog, even
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30678
diff
changeset
|
430 | 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
|
431 | } |
|
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 | |
| 13235 | 434 | /** |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
435 | * Subtype 0x0003 - Response to SNAC_FAMILY_ICQ/0x002, contains an ICQesque packet. |
| 13235 | 436 | */ |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
437 | 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
|
438 | icqresponse(OscarData *od, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 439 | { |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
440 | GSList *tlvlist; |
| 13235 | 441 | aim_tlv_t *datatlv; |
|
13240
db5187cc40d1
[gaim-migrate @ 15605]
Mark Doliner <markdoliner@pidgin.im>
parents:
13235
diff
changeset
|
442 | ByteStream qbs; |
| 13235 | 443 | guint32 ouruin; |
| 444 | guint16 cmdlen, cmd, reqid; | |
| 445 | ||
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
446 | 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
|
447 | aim_tlvlist_free(tlvlist); |
| 15884 | 448 | purple_debug_misc("oscar", "corrupt ICQ response\n"); |
| 13235 | 449 | return 0; |
| 450 | } | |
| 451 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
452 | byte_stream_init(&qbs, datatlv->value, datatlv->length); |
| 13235 | 453 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
454 | cmdlen = byte_stream_getle16(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
455 | ouruin = byte_stream_getle32(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
456 | cmd = byte_stream_getle16(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
457 | reqid = byte_stream_getle16(&qbs); |
| 13235 | 458 | |
|
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
|
459 | purple_debug_misc("oscar", "icq response: %d bytes, %u, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid); |
| 13235 | 460 | |
|
30636
893e50565e7c
Removed the old way of retrieving offline messages, because it is not
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30634
diff
changeset
|
461 | if (cmd == 0x07da) { /* information */ |
| 13235 | 462 | 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
|
463 | GSList *info_ptr; |
| 13235 | 464 | struct aim_icq_info *info; |
| 465 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
466 | subtype = byte_stream_getle16(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
467 | byte_stream_advance(&qbs, 1); /* 0x0a */ |
| 13235 | 468 | |
| 469 | /* 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
|
470 | 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
|
471 | 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
|
472 | 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
|
473 | 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
|
474 | info_ptr = od->icq_info = g_slist_prepend(od->icq_info, new_info); |
| 13235 | 475 | } |
| 476 | ||
|
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
|
477 | info = info_ptr->data; |
| 13235 | 478 | switch (subtype) { |
| 479 | case 0x00a0: { /* hide ip status */ | |
| 480 | /* nothing */ | |
| 481 | } break; | |
| 482 | ||
| 483 | case 0x00aa: { /* password change status */ | |
| 484 | /* nothing */ | |
| 485 | } break; | |
| 486 | ||
| 487 | case 0x00c8: { /* general and "home" information */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
488 | info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
489 | info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
490 | info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
491 | info->email = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
492 | info->homecity = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
493 | info->homestate = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
494 | info->homephone = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
495 | info->homefax = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
496 | info->homeaddr = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
497 | info->mobile = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
498 | info->homezip = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
499 | info->homecountry = byte_stream_getle16(&qbs); |
| 13235 | 500 | /* 0x0a 00 02 00 */ |
| 501 | /* 1 byte timezone? */ | |
| 502 | /* 1 byte hide email flag? */ | |
| 503 | } break; | |
| 504 | ||
| 505 | case 0x00dc: { /* personal information */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
506 | info->age = byte_stream_getle8(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
507 | info->unknown = byte_stream_getle8(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
508 | 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
|
509 | info->personalwebpage = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
510 | info->birthyear = byte_stream_getle16(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
511 | info->birthmonth = byte_stream_getle8(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
512 | info->birthday = byte_stream_getle8(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
513 | info->language1 = byte_stream_getle8(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
514 | info->language2 = byte_stream_getle8(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
515 | info->language3 = byte_stream_getle8(&qbs); |
| 13235 | 516 | /* 0x00 00 01 00 00 01 00 00 00 00 00 */ |
| 517 | } break; | |
| 518 | ||
| 519 | case 0x00d2: { /* work information */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
520 | info->workcity = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
521 | info->workstate = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
522 | info->workphone = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
523 | info->workfax = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
524 | info->workaddr = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
525 | info->workzip = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
526 | info->workcountry = byte_stream_getle16(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
527 | info->workcompany = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
528 | info->workdivision = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
529 | info->workposition = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
530 | byte_stream_advance(&qbs, 2); /* 0x01 00 */ |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
531 | info->workwebpage = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
| 13235 | 532 | } break; |
| 533 | ||
| 534 | case 0x00e6: { /* additional personal information */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
535 | info->info = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)-1); |
| 13235 | 536 | } break; |
| 537 | ||
| 538 | case 0x00eb: { /* email address(es) */ | |
| 539 | int i; | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
540 | 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
|
541 | info->email2 = (char **)g_new0(char *, info->numaddresses); |
| 13235 | 542 | for (i = 0; i < info->numaddresses; i++) { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
543 | info->email2[i] = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
| 13235 | 544 | if (i+1 != info->numaddresses) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
545 | byte_stream_advance(&qbs, 1); /* 0x00 */ |
| 13235 | 546 | } |
| 547 | } break; | |
| 548 | ||
| 549 | case 0x00f0: { /* personal interests */ | |
| 550 | } break; | |
| 551 | ||
| 552 | case 0x00fa: { /* past background and current organizations */ | |
| 553 | } break; | |
| 554 | ||
| 555 | case 0x0104: { /* alias info */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
556 | info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
557 | info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
558 | info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
559 | byte_stream_advance(&qbs, byte_stream_getle16(&qbs)); /* email address? */ |
| 13235 | 560 | /* Then 0x00 02 00 */ |
| 561 | } break; | |
| 562 | ||
| 563 | case 0x010e: { /* unknown */ | |
| 564 | /* 0x00 00 */ | |
| 565 | } break; | |
| 566 | ||
| 567 | case 0x019a: { /* simple info */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
568 | byte_stream_advance(&qbs, 2); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
569 | info->uin = byte_stream_getle32(&qbs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
570 | info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
571 | info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
572 | info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
573 | info->email = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
| 13235 | 574 | /* Then 0x00 02 00 00 00 00 00 */ |
| 575 | } break; | |
|
22125
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
576 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
577 | /* 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
|
578 | case 0x0fb4: { |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
579 | GSList *tlvlist; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
580 | 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
|
581 | FlapConnection *conn; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
582 | 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
|
583 | 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
|
584 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
585 | 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
|
586 | 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
|
587 | { |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
588 | 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
|
589 | break; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
590 | } |
|
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 | 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
|
593 | 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
|
594 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
595 | 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
|
596 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
597 | 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
|
598 | 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
|
599 | /* 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
|
600 | 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
|
601 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
602 | 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
|
603 | 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
|
604 | /* 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
|
605 | 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
|
606 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
607 | 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
|
608 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
609 | 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
|
610 | { |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
611 | 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
|
612 | "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
|
613 | 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
|
614 | 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
|
615 | break; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
616 | } |
|
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 | 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
|
619 | { |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
620 | PurpleAccount *account; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
621 | PurpleBuddy *buddy; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
622 | PurplePresence *presence; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
623 | PurpleStatus *status; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
624 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
625 | 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
|
626 | 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
|
627 | 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
|
628 | 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
|
629 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
630 | 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
|
631 | 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
|
632 | "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
|
633 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
634 | 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
|
635 | } |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
636 | else |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
637 | { |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
638 | 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
|
639 | 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
|
640 | 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
|
641 | 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
|
642 | 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
|
643 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
644 | 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
|
645 | |
|
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
|
646 | 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
|
647 | 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
|
648 | |
|
22125
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
649 | 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
|
650 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
651 | 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
|
652 | |
|
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
|
653 | 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
|
654 | 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
|
655 | 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
|
656 | 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
|
657 | |
|
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
|
658 | 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
|
659 | 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
|
660 | 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
|
661 | 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
|
662 | 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
|
663 | 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
|
664 | 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
|
665 | 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
|
666 | 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
|
667 | |
|
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
|
668 | 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
|
669 | 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
|
670 | 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
|
671 | |
|
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
|
672 | 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
|
673 | 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
|
674 | |
|
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
|
675 | 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
|
676 | 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
|
677 | 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
|
678 | 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
|
679 | 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
|
680 | 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
|
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_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
|
684 | 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
|
685 | 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
|
686 | 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
|
687 | 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
|
688 | 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
|
689 | 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
|
690 | 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
|
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_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
|
693 | 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
|
694 | 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
|
695 | 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
|
696 | 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
|
697 | |
|
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
|
698 | 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
|
699 | 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
|
700 | 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
|
701 | 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
|
702 | 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
|
703 | 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
|
704 | 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
|
705 | 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
|
706 | 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
|
707 | 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
|
708 | 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
|
709 | 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
|
710 | 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
|
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, 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
|
714 | 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
|
715 | 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
|
716 | 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
|
717 | 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
|
718 | 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
|
719 | 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
|
720 | |
|
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
|
721 | 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
|
722 | 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
|
723 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
724 | 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
|
725 | 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
|
726 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
727 | 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
|
728 | |
|
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
|
729 | 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
|
730 | |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30656
diff
changeset
|
731 | 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
|
732 | |
|
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 | 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
|
734 | } |
|
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 | 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
|
737 | |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
738 | } break; |
|
57b7d398c30e
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
739 | |
| 13235 | 740 | } /* End switch statement */ |
| 741 | ||
| 742 | if (!(snac->flags & 0x0001)) { | |
| 743 | 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
|
744 | oscar_user_info_display_icq(od, info); |
| 13235 | 745 | |
| 746 | 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
|
747 | gotalias(od, info); |
| 13235 | 748 | |
| 749 | 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
|
750 | od->icq_info = g_slist_remove(od->icq_info, info); |
| 13235 | 751 | } |
| 752 | } | |
| 753 | ||
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
754 | aim_tlvlist_free(tlvlist); |
| 13235 | 755 | |
|
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
|
756 | return 1; |
| 13235 | 757 | } |
| 758 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
759 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
760 | snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 761 | { |
|
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
|
762 | 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
|
763 | 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
|
764 | 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
|
765 | return icqresponse(od, snac, bs); |
| 13235 | 766 | |
| 767 | return 0; | |
| 768 | } | |
| 769 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
770 | static void |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
771 | icq_shutdown(OscarData *od, aim_module_t *mod) |
| 13235 | 772 | { |
|
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
|
773 | 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
|
774 | 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
|
775 | 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
|
776 | g_slist_free(od->icq_info); |
| 13235 | 777 | } |
| 778 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
779 | int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
780 | icq_modfirst(OscarData *od, aim_module_t *mod) |
| 13235 | 781 | { |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
782 | mod->family = SNAC_FAMILY_ICQ; |
| 13235 | 783 | mod->version = 0x0001; |
| 784 | mod->toolid = 0x0110; | |
| 785 | mod->toolversion = 0x047c; | |
| 786 | mod->flags = 0; | |
| 787 | strncpy(mod->name, "icq", sizeof(mod->name)); | |
| 788 | mod->snachandler = snachandler; | |
| 789 | mod->shutdown = icq_shutdown; | |
| 790 | ||
| 791 | return 0; | |
| 792 | } |