Mercurial > pidgin.yaz
annotate libpurple/protocols/oscar/family_icq.c @ 24613:531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 07 Dec 2008 23:34:12 +0000 |
parents | 8c480872b620 |
children | 2c80f3d839c7 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15823 | 2 * Purple's oscar protocol plugin |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * This file is the legal property of its developers. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 * Please see the AUTHORS file distributed alongside this file. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 * This library is free software; you can redistribute it and/or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * modify it under the terms of the GNU Lesser General Public |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * License as published by the Free Software Foundation; either |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * version 2 of the License, or (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * This library is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * Lesser General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU Lesser General Public |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * License along with this library; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19640
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * Family 0x0015 - Encapsulated ICQ. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "oscar.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 |
22337
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
28 #ifdef OLDSTYLE_ICQ_OFFLINEMSGS |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 int aim_icq_reqofflinemsgs(OscarData *od) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
32 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
36 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
39 purple_debug_info("oscar", "Requesting offline messages\n"); |
23622
60030a36506e
Shift several rate-limiting-costly ICQ info requests to be low priority
Evan Schoenberg <evan.s@dreskin.net>
parents:
23613
diff
changeset
|
40 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 bslen = 2 + 4 + 2 + 2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
43 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
45 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
48 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
49 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
51 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
52 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
53 byte_stream_putle16(&bs, 0x003c); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
54 byte_stream_putle16(&bs, snacid); /* eh. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
56 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
57 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
58 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 int aim_icq_ackofflinemsgs(OscarData *od) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 { |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
65 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 FlapFrame *frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
70 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
73 purple_debug_info("oscar", "Acknowledged receipt of offline messages\n"); |
23622
60030a36506e
Shift several rate-limiting-costly ICQ info requests to be low priority
Evan Schoenberg <evan.s@dreskin.net>
parents:
23613
diff
changeset
|
74 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 bslen = 2 + 4 + 2 + 2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
77 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
79 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
82 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
83 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
85 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
86 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
87 byte_stream_putle16(&bs, 0x003e); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
88 byte_stream_putle16(&bs, snacid); /* eh. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
90 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
91 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
92 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 } |
22337
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
96 #endif /* OLDSTYLE_ICQ_OFFLINEMSGS */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 aim_icq_setsecurity(OscarData *od, gboolean auth_required, gboolean webaware) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
102 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
106 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 bslen = 2+4+2+2+2+2+2+1+1+1+1+1+1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
111 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
113 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
116 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
117 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
119 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
120 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
121 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
122 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
123 byte_stream_putle16(&bs, 0x0c3a); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
124 byte_stream_putle16(&bs, 0x030c); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
125 byte_stream_putle16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
126 byte_stream_putle8(&bs, webaware); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
127 byte_stream_putle8(&bs, 0xf8); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
128 byte_stream_putle8(&bs, 0x02); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
129 byte_stream_putle8(&bs, 0x01); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
130 byte_stream_putle8(&bs, 0x00); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
131 byte_stream_putle8(&bs, !auth_required); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
133 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
134 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
135 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 * Change your ICQ password. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 * @param od The oscar session |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 * @param passwd The new password. If this is longer than 8 characters it |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 * will be truncated. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 * @return Return 0 if no errors, otherwise return the error number. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 int aim_icq_changepasswd(OscarData *od, const char *passwd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
151 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 int bslen, passwdlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 if (!passwd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
158 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 passwdlen = strlen(passwd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 if (passwdlen > MAXICQPASSLEN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 passwdlen = MAXICQPASSLEN; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 bslen = 2+4+2+2+2+2+passwdlen+1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
166 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
168 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
171 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
172 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
174 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
175 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
176 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
177 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
178 byte_stream_putle16(&bs, 0x042e); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
179 byte_stream_putle16(&bs, passwdlen+1); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
180 byte_stream_putstr(&bs, passwd); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
181 byte_stream_putle8(&bs, '\0'); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
183 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
184 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
185 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 int aim_icq_getallinfo(OscarData *od, const char *uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
193 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 struct aim_icq_info *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 if (!uin || uin[0] < '0' || uin[0] > '9') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
201 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 bslen = 2 + 4 + 2 + 2 + 2 + 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
206 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
208 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
211 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
212 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
214 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
215 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
216 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
217 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
218 byte_stream_putle16(&bs, 0x04b2); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
219 byte_stream_putle32(&bs, atoi(uin)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 |
23623
38a30596ff49
This looks good to me. I'm thinking we probably don't want to get
Mark Doliner <mark@kingant.net>
parents:
23613
diff
changeset
|
221 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs, FALSE); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
222 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
223 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 /* Keep track of this request and the ICQ number and request ID */ |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
226 info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 info->reqid = snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 info->uin = atoi(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 info->next = od->icq_info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 od->icq_info = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 int aim_icq_getalias(OscarData *od, const char *uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
238 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 struct aim_icq_info *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 if (!uin || uin[0] < '0' || uin[0] > '9') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
246 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 |
23622
60030a36506e
Shift several rate-limiting-costly ICQ info requests to be low priority
Evan Schoenberg <evan.s@dreskin.net>
parents:
23613
diff
changeset
|
249 purple_debug_info("oscar", "Requesting ICQ alias for %s", uin); |
60030a36506e
Shift several rate-limiting-costly ICQ info requests to be low priority
Evan Schoenberg <evan.s@dreskin.net>
parents:
23613
diff
changeset
|
250 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 bslen = 2 + 4 + 2 + 2 + 2 + 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
253 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
255 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
258 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
259 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
261 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
262 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
263 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
264 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
265 byte_stream_putle16(&bs, 0x04ba); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
266 byte_stream_putle32(&bs, atoi(uin)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 |
23626
8c480872b620
Get rid of a few low priority "high priority" comments
Mark Doliner <mark@kingant.net>
parents:
23625
diff
changeset
|
268 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs, FALSE); |
22829
ab2322195dab
Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents:
22700
diff
changeset
|
269 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
270 byte_stream_destroy(&bs); |
22829
ab2322195dab
Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents:
22700
diff
changeset
|
271 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 /* Keep track of this request and the ICQ number and request ID */ |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
273 info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 info->reqid = snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 info->uin = atoi(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 info->next = od->icq_info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 od->icq_info = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 int aim_icq_getsimpleinfo(OscarData *od, const char *uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
285 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 if (!uin || uin[0] < '0' || uin[0] > '9') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
292 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 bslen = 2 + 4 + 2 + 2 + 2 + 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
297 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
299 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
302 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
303 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
305 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
306 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
307 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
308 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
309 byte_stream_putle16(&bs, 0x051f); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
310 byte_stream_putle32(&bs, atoi(uin)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 |
23626
8c480872b620
Get rid of a few low priority "high priority" comments
Mark Doliner <mark@kingant.net>
parents:
23625
diff
changeset
|
312 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs, FALSE); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
313 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
314 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 int aim_icq_sendxmlreq(OscarData *od, const char *xml) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
323 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 int bslen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 if (!xml || !strlen(xml)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
330 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 bslen = 2 + 10 + 2 + strlen(xml) + 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
335 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
337 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
340 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
341 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
343 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
344 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
345 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
346 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
347 byte_stream_putle16(&bs, 0x0998); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
348 byte_stream_putle16(&bs, strlen(xml) + 1); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
349 byte_stream_putraw(&bs, (guint8 *)xml, strlen(xml) + 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
351 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); |
22829
ab2322195dab
Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents:
22700
diff
changeset
|
352 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
353 byte_stream_destroy(&bs); |
22829
ab2322195dab
Minor changes... mostly whitespace related.
Mark Doliner <mark@kingant.net>
parents:
22700
diff
changeset
|
354 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 * Send an SMS message. This is the non-US way. The US-way is to IM |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 * their cell phone number (+19195551234). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 * We basically construct and send an XML message. The format is: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 * <icq_sms_message> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 * <destination>full_phone_without_leading_+</destination> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 * <text>message</text> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 * <codepage>1252</codepage> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 * <senders_UIN>self_uin</senders_UIN> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 * <senders_name>self_name</senders_name> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 * <delivery_receipt>Yes|No</delivery_receipt> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 * <time>Wkd, DD Mmm YYYY HH:MM:SS TMZ</time> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 * </icq_sms_message> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
373 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 * Yeah hi Peter, whaaaat's happening. If there's any way to use |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 * a codepage other than 1252 that would be great. Thaaaanks. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 int aim_icq_sendsms(OscarData *od, const char *name, const char *msg, const char *alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 FlapConnection *conn; |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
380 PurpleAccount *account; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
381 ByteStream bs; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 aim_snacid_t snacid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 int bslen, xmllen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 char *xml; |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
385 const char *timestr, *username; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 time_t t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 struct tm *tm; |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
388 gchar *stripped; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
390 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 if (!name || !msg || !alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
394 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
396 account = purple_connection_get_account(od->gc); |
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
397 username = purple_account_get_username(account); |
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
398 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 time(&t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
400 tm = gmtime(&t); |
15823 | 401 timestr = purple_utf8_strftime("%a, %d %b %Y %T %Z", tm); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
402 |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
403 stripped = purple_markup_strip_html(msg); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
404 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 /* The length of xml included the null terminating character */ |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
406 xmllen = 209 + strlen(name) + strlen(stripped) + strlen(username) + strlen(alias) + strlen(timestr) + 1; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 xml = g_new(char, xmllen); |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
409 snprintf(xml, xmllen, "<icq_sms_message>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
410 "<destination>%s</destination>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
411 "<text>%s</text>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
412 "<codepage>1252</codepage>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
413 "<senders_UIN>%s</senders_UIN>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
414 "<senders_name>%s</senders_name>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
415 "<delivery_receipt>Yes</delivery_receipt>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
416 "<time>%s</time>" |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
417 "</icq_sms_message>", |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
418 name, stripped, username, alias, timestr); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
420 bslen = 36 + xmllen; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
422 byte_stream_new(&bs, 4 + bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
424 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
426 /* For simplicity, don't bother using a tlvlist */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
427 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
428 byte_stream_put16(&bs, bslen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
429 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
430 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
431 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
432 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
433 byte_stream_putle16(&bs, snacid); /* eh. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
434 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 /* From libicq200-0.3.2/src/SNAC-SRV.cpp */ |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
436 byte_stream_putle16(&bs, 0x1482); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
437 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
438 byte_stream_put16(&bs, 0x0016); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
439 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
440 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
441 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
442 byte_stream_put32(&bs, 0x00000000); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
444 byte_stream_put16(&bs, 0x0000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
445 byte_stream_put16(&bs, xmllen); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
446 byte_stream_putstr(&bs, xml); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
447 byte_stream_put8(&bs, 0x00); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
449 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
450 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
451 byte_stream_destroy(&bs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
453 g_free(xml); |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
17445
diff
changeset
|
454 g_free(stripped); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
459 /* |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
460 * getstatusnote may be a misleading name because the response |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
461 * contains a lot of different information but currently it's only |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
462 * used to get that. |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
463 */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
464 int aim_icq_getstatusnote(OscarData *od, const char *uin, guint8 *note_hash, guint16 note_hash_len) |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
465 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
466 FlapConnection *conn; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
467 ByteStream bs; |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
468 aim_snacid_t snacid; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
469 int bslen; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
470 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
471 purple_debug_misc("oscar", "aim_icq_getstatusnote: requesting status note for %s.\n", uin); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
472 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
473 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
474 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
475 purple_debug_misc("oscar", "aim_icq_getstatusnote: no connection.\n"); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
476 return -EINVAL; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
477 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
478 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
479 bslen = 2 + 4 + 2 + 2 + 2 + 2 + 58 + strlen(uin); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
480 byte_stream_new(&bs, 4 + bslen); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
481 |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
482 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
483 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
484 byte_stream_put16(&bs, 0x0001); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
485 byte_stream_put16(&bs, bslen); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
486 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
487 byte_stream_putle16(&bs, bslen - 2); |
24613
531922f4ea2a
Minor cleanup: remove od->sn, since it's the same as PurpleAccount->username
Mark Doliner <mark@kingant.net>
parents:
23626
diff
changeset
|
488 byte_stream_putuid(&bs, od); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
489 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
490 byte_stream_putle16(&bs, snacid); /* eh. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
491 byte_stream_putle16(&bs, 0x0fa0); /* shrug. */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
492 byte_stream_putle16(&bs, 58 + strlen(uin)); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
493 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
494 byte_stream_put32(&bs, 0x05b90002); /* don't ask */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
495 byte_stream_put32(&bs, 0x80000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
496 byte_stream_put32(&bs, 0x00000006); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
497 byte_stream_put32(&bs, 0x00010002); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
498 byte_stream_put32(&bs, 0x00020000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
499 byte_stream_put32(&bs, 0x04e30000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
500 byte_stream_put32(&bs, 0x00020002); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
501 byte_stream_put32(&bs, 0x00000001); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
502 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
503 byte_stream_put16(&bs, 24 + strlen(uin)); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
504 byte_stream_put32(&bs, 0x003c0010); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
505 byte_stream_putraw(&bs, note_hash, 16); /* status note hash */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
506 byte_stream_put16(&bs, 0x0032); /* buddy uin */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
507 byte_stream_put16(&bs, strlen(uin)); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
508 byte_stream_putstr(&bs, uin); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
509 |
23623
38a30596ff49
This looks good to me. I'm thinking we probably don't want to get
Mark Doliner <mark@kingant.net>
parents:
23613
diff
changeset
|
510 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x000, snacid, &bs, FALSE); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
511 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
512 byte_stream_destroy(&bs); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
513 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
514 return 0; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
515 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
516 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 static void aim_icq_freeinfo(struct aim_icq_info *info) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 if (!info) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 return; |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
522 g_free(info->nick); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
523 g_free(info->first); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
524 g_free(info->last); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
525 g_free(info->email); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
526 g_free(info->homecity); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
527 g_free(info->homestate); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
528 g_free(info->homephone); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
529 g_free(info->homefax); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
530 g_free(info->homeaddr); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
531 g_free(info->mobile); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
532 g_free(info->homezip); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
533 g_free(info->personalwebpage); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 if (info->email2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 for (i = 0; i < info->numaddresses; i++) |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
536 g_free(info->email2[i]); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
537 g_free(info->email2); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
538 g_free(info->workcity); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
539 g_free(info->workstate); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
540 g_free(info->workphone); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
541 g_free(info->workfax); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
542 g_free(info->workaddr); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
543 g_free(info->workzip); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
544 g_free(info->workcompany); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
545 g_free(info->workdivision); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
546 g_free(info->workposition); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
547 g_free(info->workwebpage); |
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
548 g_free(info->info); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
549 g_free(info->status_note_title); |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
550 g_free(info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 /** |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
554 * Subtype 0x0003 - Response to SNAC_FAMILY_ICQ/0x002, contains an ICQesque packet. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 icqresponse(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 int ret = 0; |
17445
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17235
diff
changeset
|
560 GSList *tlvlist; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 aim_tlv_t *datatlv; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 ByteStream qbs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 guint32 ouruin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 guint16 cmdlen, cmd, reqid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 |
17445
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17235
diff
changeset
|
566 if (!(tlvlist = aim_tlvlist_read(bs)) || !(datatlv = aim_tlv_gettlv(tlvlist, 0x0001, 1))) { |
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17235
diff
changeset
|
567 aim_tlvlist_free(tlvlist); |
15823 | 568 purple_debug_misc("oscar", "corrupt ICQ response\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 byte_stream_init(&qbs, datatlv->value, datatlv->length); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 cmdlen = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
575 ouruin = byte_stream_getle32(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 cmd = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 reqid = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
22475
3225c99785b8
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
579 purple_debug_misc("oscar", "icq response: %d bytes, %u, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 if (cmd == 0x0041) { /* offline message */ |
22337
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
582 #ifdef OLDSTYLE_ICQ_OFFLINEMSGS |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
583 struct aim_icq_offlinemsg msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 aim_rxcallback_t userfunc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 memset(&msg, 0, sizeof(msg)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
587 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 msg.sender = byte_stream_getle32(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 msg.year = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 msg.month = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
591 msg.day = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 msg.hour = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 msg.minute = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 msg.type = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 msg.flags = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 msg.msglen = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 msg.msg = byte_stream_getstr(&qbs, msg.msglen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 if ((userfunc = aim_callhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSG))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 ret = userfunc(od, conn, frame, &msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
602 g_free(msg.msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
604 } else if (cmd == 0x0042) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
605 aim_rxcallback_t userfunc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
606 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 if ((userfunc = aim_callhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSGCOMPLETE))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
608 ret = userfunc(od, conn, frame); |
22337
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
609 #endif /* OLDSTYLE_ICQ_OFFLINEMSGS */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 } else if (cmd == 0x07da) { /* information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 guint16 subtype; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 struct aim_icq_info *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 aim_rxcallback_t userfunc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 subtype = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 byte_stream_advance(&qbs, 1); /* 0x0a */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 /* find other data from the same request */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 for (info = od->icq_info; info && (info->reqid != reqid); info = info->next); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 if (!info) { |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
622 info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 info->reqid = reqid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 info->next = od->icq_info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 od->icq_info = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 switch (subtype) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 case 0x00a0: { /* hide ip status */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 /* nothing */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 case 0x00aa: { /* password change status */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 /* nothing */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 case 0x00c8: { /* general and "home" information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 info->email = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 info->homecity = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 info->homestate = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 info->homephone = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 info->homefax = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 info->homeaddr = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 info->mobile = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 info->homezip = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 info->homecountry = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 /* 0x0a 00 02 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 /* 1 byte timezone? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 /* 1 byte hide email flag? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 case 0x00dc: { /* personal information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 info->age = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 info->unknown = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 info->gender = byte_stream_getle8(&qbs); /* Not specified=0x00, Female=0x01, Male=0x02 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 info->personalwebpage = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 info->birthyear = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 info->birthmonth = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 info->birthday = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 info->language1 = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 info->language2 = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 info->language3 = byte_stream_getle8(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 /* 0x00 00 01 00 00 01 00 00 00 00 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
669 case 0x00d2: { /* work information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 info->workcity = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 info->workstate = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 info->workphone = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 info->workfax = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 info->workaddr = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 info->workzip = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 info->workcountry = byte_stream_getle16(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 info->workcompany = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 info->workdivision = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 info->workposition = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 byte_stream_advance(&qbs, 2); /* 0x01 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 info->workwebpage = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
683 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 case 0x00e6: { /* additional personal information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 info->info = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)-1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 case 0x00eb: { /* email address(es) */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 info->numaddresses = byte_stream_getle16(&qbs); |
17235
1927f4ead3ca
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15823
diff
changeset
|
691 info->email2 = (char **)g_new0(char *, info->numaddresses); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 for (i = 0; i < info->numaddresses; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 info->email2[i] = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 if (i+1 != info->numaddresses) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 byte_stream_advance(&qbs, 1); /* 0x00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 case 0x00f0: { /* personal interests */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 case 0x00fa: { /* past background and current organizations */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 case 0x0104: { /* alias info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 byte_stream_advance(&qbs, byte_stream_getle16(&qbs)); /* email address? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 /* Then 0x00 02 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 case 0x010e: { /* unknown */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 /* 0x00 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
716 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 case 0x019a: { /* simple info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 byte_stream_advance(&qbs, 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 info->uin = byte_stream_getle32(&qbs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 info->nick = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 info->first = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 info->last = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 info->email = byte_stream_getstr(&qbs, byte_stream_getle16(&qbs)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 /* Then 0x00 02 00 00 00 00 00 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 } break; |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
726 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
727 /* status note title and send request for status note text */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
728 case 0x0fb4: { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
729 GSList *tlvlist; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
730 aim_tlv_t *tlv; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
731 FlapConnection *conn; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
732 char *uin = NULL; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
733 char *status_note_title = NULL; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
734 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
735 conn = flap_connection_findbygroup(od, 0x0004); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
736 if (conn == NULL) |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
737 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
738 purple_debug_misc("oscar", "icq/0x0fb4: flap connection was not found.\n"); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
739 break; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
740 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
741 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
742 byte_stream_advance(&qbs, 0x02); /* length */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
743 byte_stream_advance(&qbs, 0x2f); /* unknown stuff */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
744 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
745 tlvlist = aim_tlvlist_read(&qbs); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
746 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
747 tlv = aim_tlv_gettlv(tlvlist, 0x0032, 1); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
748 if (tlv != NULL) |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
749 /* Get user number */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
750 uin = aim_tlv_getvalue_as_string(tlv); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
751 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
752 tlv = aim_tlv_gettlv(tlvlist, 0x0226, 1); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
753 if (tlv != NULL) |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
754 /* Get status note title */ |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
755 status_note_title = aim_tlv_getvalue_as_string(tlv); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
756 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
757 aim_tlvlist_free(tlvlist); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
758 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
759 if (uin == NULL || status_note_title == NULL) |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
760 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
761 purple_debug_misc("oscar", "icq/0x0fb4: uin or " |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
762 "status_note_title was not found\n"); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
763 g_free(uin); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
764 g_free(status_note_title); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
765 break; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
766 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
767 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
768 if (status_note_title[0] == '\0') |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
769 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
770 PurpleAccount *account; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
771 PurpleBuddy *buddy; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
772 PurplePresence *presence; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
773 PurpleStatus *status; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
774 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
775 account = purple_connection_get_account(od->gc); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
776 buddy = purple_find_buddy(account, uin); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
777 presence = purple_buddy_get_presence(buddy); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
778 status = purple_presence_get_active_status(presence); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
779 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
780 purple_prpl_got_user_status(account, uin, |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
781 purple_status_get_id(status), |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
782 "message", NULL, NULL); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
783 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
784 g_free(status_note_title); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
785 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
786 else |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
787 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
788 struct aim_icq_info *info; |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
789 ByteStream bs; |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
790 guint32 bslen; |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
791 aim_snacid_t snacid; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
792 guchar cookie[8]; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
793 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
794 info = g_new0(struct aim_icq_info, 1); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
795 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
796 if (info == NULL) |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
797 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
798 g_free(uin); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
799 g_free(status_note_title); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
800 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
801 break; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
802 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
803 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
804 bslen = 13 + strlen(uin) + 30 + 6 + 4 + 55 + 85 + 4; |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
805 byte_stream_new(&bs, 4 + bslen); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
806 |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
807 snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
808 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
809 aim_icbm_makecookie(cookie); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
810 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
811 byte_stream_putraw(&bs, cookie, 8); /* ICBM cookie */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
812 byte_stream_put16(&bs, 0x0002); /* message channel */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
813 byte_stream_put8(&bs, strlen(uin)); /* uin */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
814 byte_stream_putstr(&bs, uin); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
815 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
816 byte_stream_put16(&bs, 0x0005); /* rendez vous data */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
817 byte_stream_put16(&bs, 0x00b2); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
818 byte_stream_put16(&bs, 0x0000); /* request */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
819 byte_stream_putraw(&bs, cookie, 8); /* ICBM cookie */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
820 byte_stream_put32(&bs, 0x09461349); /* ICQ server relaying */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
821 byte_stream_put16(&bs, 0x4c7f); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
822 byte_stream_put16(&bs, 0x11d1); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
823 byte_stream_put32(&bs, 0x82224445); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
824 byte_stream_put32(&bs, 0x53540000); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
825 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
826 byte_stream_put16(&bs, 0x000a); /* unknown TLV */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
827 byte_stream_put16(&bs, 0x0002); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
828 byte_stream_put16(&bs, 0x0001); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
829 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
830 byte_stream_put16(&bs, 0x000f); /* unknown TLV */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
831 byte_stream_put16(&bs, 0x0000); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
832 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
833 byte_stream_put16(&bs, 0x2711); /* extended data */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
834 byte_stream_put16(&bs, 0x008a); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
835 byte_stream_putle16(&bs, 0x001b); /* length */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
836 byte_stream_putle16(&bs, 0x0009); /* version */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
837 byte_stream_putle32(&bs, 0x00000000); /* plugin: none */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
838 byte_stream_putle32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
839 byte_stream_putle32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
840 byte_stream_putle32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
841 byte_stream_putle16(&bs, 0x0000); /* unknown */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
842 byte_stream_putle32(&bs, 0x00000000); /* client capabilities flags */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
843 byte_stream_put8(&bs, 0x00); /* unknown */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
844 byte_stream_putle16(&bs, 0x0064); /* downcounter? */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
845 byte_stream_putle16(&bs, 0x000e); /* length */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
846 byte_stream_putle16(&bs, 0x0064); /* downcounter? */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
847 byte_stream_putle32(&bs, 0x00000000); /* unknown */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
848 byte_stream_putle32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
849 byte_stream_putle32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
850 byte_stream_put8(&bs, 0x1a); /* message type: plugin message descibed by text string */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
851 byte_stream_put8(&bs, 0x00); /* message flags */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
852 byte_stream_putle16(&bs, 0x0000); /* status code */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
853 byte_stream_putle16(&bs, 0x0001); /* priority code */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
854 byte_stream_putle16(&bs, 0x0000); /* text length */ |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
855 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
856 byte_stream_put8(&bs, 0x3a); /* message dump */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
857 byte_stream_put32(&bs, 0x00811a18); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
858 byte_stream_put32(&bs, 0xbc0e6c18); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
859 byte_stream_put32(&bs, 0x47a5916f); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
860 byte_stream_put32(&bs, 0x18dcc76f); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
861 byte_stream_put32(&bs, 0x1a010013); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
862 byte_stream_put32(&bs, 0x00000041); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
863 byte_stream_put32(&bs, 0x77617920); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
864 byte_stream_put32(&bs, 0x53746174); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
865 byte_stream_put32(&bs, 0x7573204d); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
866 byte_stream_put32(&bs, 0x65737361); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
867 byte_stream_put32(&bs, 0x67650100); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
868 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
869 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
870 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
871 byte_stream_put32(&bs, 0x00000015); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
872 byte_stream_put32(&bs, 0x00000000); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
873 byte_stream_put32(&bs, 0x0000000d); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
874 byte_stream_put32(&bs, 0x00000074); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
875 byte_stream_put32(&bs, 0x6578742f); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
876 byte_stream_put32(&bs, 0x782d616f); |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
877 byte_stream_put32(&bs, 0x6c727466); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
878 |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
879 byte_stream_put16(&bs, 0x0003); /* server ACK requested */ |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
880 byte_stream_put16(&bs, 0x0000); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
881 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
882 info->uin = atoi(uin); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
883 info->status_note_title = status_note_title; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
884 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
885 memcpy(&info->icbm_cookie, cookie, 8); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
886 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
887 info->next = od->icq_info; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
888 od->icq_info = info; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
889 |
23626
8c480872b620
Get rid of a few low priority "high priority" comments
Mark Doliner <mark@kingant.net>
parents:
23625
diff
changeset
|
890 flap_connection_send_snac_with_priority(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs, FALSE); |
22700
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
891 |
979a81468e19
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evan.s@dreskin.net>
parents:
22475
diff
changeset
|
892 byte_stream_destroy(&bs); |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
893 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
894 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
895 g_free(uin); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
896 |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
897 } break; |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
898 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 } /* End switch statement */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 if (!(snac->flags & 0x0001)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 if (subtype != 0x0104) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 if ((userfunc = aim_callhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_INFO))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 ret = userfunc(od, conn, frame, info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 if (info->uin && info->nick) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 if ((userfunc = aim_callhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_ALIAS))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 ret = userfunc(od, conn, frame, info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 if (od->icq_info == info) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 od->icq_info = info->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 struct aim_icq_info *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 for (cur=od->icq_info; (cur->next && (cur->next!=info)); cur=cur->next); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 if (cur->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 cur->next = cur->next->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 aim_icq_freeinfo(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 |
17445
f80f7e1047be
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <mark@kingant.net>
parents:
17235
diff
changeset
|
922 aim_tlvlist_free(tlvlist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 if (snac->subtype == 0x0003) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 return icqresponse(od, conn, mod, frame, snac, bs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 icq_shutdown(OscarData *od, aim_module_t *mod) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 struct aim_icq_info *del; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 while (od->icq_info) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 del = od->icq_info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 od->icq_info = od->icq_info->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 aim_icq_freeinfo(del); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 icq_modfirst(OscarData *od, aim_module_t *mod) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 { |
23315
9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evan.s@dreskin.net>
parents:
22829
diff
changeset
|
953 mod->family = SNAC_FAMILY_ICQ; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 mod->version = 0x0001; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 mod->toolid = 0x0110; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 mod->toolversion = 0x047c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
957 mod->flags = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 strncpy(mod->name, "icq", sizeof(mod->name)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 mod->snachandler = snachandler; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 mod->shutdown = icq_shutdown; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
961 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 } |