Mercurial > pidgin
annotate src/protocols/oscar/info.c @ 3717:988485669631
[gaim-migrate @ 3850]
Warning fixes and WIN32 ifdef removals
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 16 Oct 2002 19:57:03 +0000 |
parents | d82f53194f09 |
children | 07283934dedd |
rev | line source |
---|---|
2086 | 1 /* |
2 * aim_info.c | |
3 * | |
4 * The functions here are responsible for requesting and parsing information- | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
5 * gathering SNACs. Or something like that. |
2086 | 6 * |
7 */ | |
8 | |
9 #define FAIM_INTERNAL | |
10 #include <aim.h> | |
11 | |
12 struct aim_priv_inforeq { | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
13 char sn[MAXSNLEN+1]; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
14 fu16_t infotype; |
2086 | 15 }; |
16 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
17 faim_export int aim_getinfo(aim_session_t *sess, aim_conn_t *conn, const char *sn, fu16_t infotype) |
2086 | 18 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
19 struct aim_priv_inforeq privdata; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
20 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
21 aim_snacid_t snacid; |
2086 | 22 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
23 if (!sess || !conn || !sn) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
24 return -EINVAL; |
2086 | 25 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
26 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 12+1+strlen(sn)))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
27 return -ENOMEM; |
2086 | 28 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
29 strncpy(privdata.sn, sn, sizeof(privdata.sn)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
30 privdata.infotype = infotype; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
31 snacid = aim_cachesnac(sess, 0x0002, 0x0005, 0x0000, &privdata, sizeof(struct aim_priv_inforeq)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
32 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
33 aim_putsnac(&fr->data, 0x0002, 0x0005, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
34 aimbs_put16(&fr->data, infotype); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
35 aimbs_put8(&fr->data, strlen(sn)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
36 aimbs_putraw(&fr->data, sn, strlen(sn)); |
2086 | 37 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
38 aim_tx_enqueue(sess, fr); |
2086 | 39 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
40 return 0; |
2086 | 41 } |
42 | |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
43 faim_export const char *aim_userinfo_sn(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
44 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
45 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
46 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
47 return NULL; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
48 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
49 return ui->sn; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
50 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
51 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
52 faim_export fu16_t aim_userinfo_flags(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
53 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
54 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
55 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
56 return 0; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
57 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
58 return ui->flags; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
59 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
60 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
61 faim_export fu16_t aim_userinfo_idle(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
62 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
63 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
64 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
65 return 0; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
66 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
67 return ui->idletime; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
68 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
69 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
70 faim_export float aim_userinfo_warnlevel(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
71 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
72 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
73 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
74 return 0.00; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
75 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
76 return (ui->warnlevel / 10); |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
77 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
78 |
3459 | 79 faim_export time_t aim_userinfo_createtime(aim_userinfo_t *ui) |
80 { | |
81 | |
82 if (!ui) | |
83 return 0; | |
84 | |
85 return (time_t)ui->createtime; | |
86 } | |
87 | |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
88 faim_export time_t aim_userinfo_membersince(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
89 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
90 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
91 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
92 return 0; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
93 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
94 return (time_t)ui->membersince; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
95 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
96 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
97 faim_export time_t aim_userinfo_onlinesince(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
98 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
99 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
100 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
101 return 0; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
102 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
103 return (time_t)ui->onlinesince; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
104 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
105 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
106 faim_export fu32_t aim_userinfo_sessionlen(aim_userinfo_t *ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
107 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
108 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
109 if (!ui) |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
110 return 0; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
111 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
112 return ui->sessionlen; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
113 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
114 |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
115 faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu32_t cap) |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
116 { |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
117 |
2993 | 118 if (!ui || !(ui->present & AIM_USERINFO_PRESENT_CAPABILITIES)) |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
119 return -1; |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
120 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
121 return !!(ui->capabilities & cap); |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
122 } |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
123 |
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
124 |
2086 | 125 /* |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
126 * Capability blocks. |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
127 * |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
128 * These are CLSIDs. They should actually be of the form: |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
129 * |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
130 * {0x0946134b, 0x4c7f, 0x11d1, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
131 * {0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}}, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
132 * |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
133 * But, eh. |
2086 | 134 */ |
135 static const struct { | |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
136 fu32_t flag; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
137 fu8_t data[16]; |
2086 | 138 } aim_caps[] = { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
139 |
2669 | 140 /* |
141 * Chat is oddball. | |
142 */ | |
143 {AIM_CAPS_CHAT, | |
144 {0x74, 0x8f, 0x24, 0x20, 0x62, 0x87, 0x11, 0xd1, | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
145 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
146 |
2669 | 147 /* |
148 * These are mostly in order. | |
149 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
150 {AIM_CAPS_VOICE, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
151 {0x09, 0x46, 0x13, 0x41, 0x4c, 0x7f, 0x11, 0xd1, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
152 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
2086 | 153 |
2669 | 154 {AIM_CAPS_SENDFILE, |
155 {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, | |
156 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, | |
157 | |
158 /* | |
159 * Advertised by the EveryBuddy client. | |
160 */ | |
2734
9fc65bb80596
[gaim-migrate @ 2747]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2672
diff
changeset
|
161 {AIM_CAPS_ICQ, |
2669 | 162 {0x09, 0x46, 0x13, 0x44, 0x4c, 0x7f, 0x11, 0xd1, |
163 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, | |
164 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
165 {AIM_CAPS_IMIMAGE, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
166 {0x09, 0x46, 0x13, 0x45, 0x4c, 0x7f, 0x11, 0xd1, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
167 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
168 |
2669 | 169 {AIM_CAPS_BUDDYICON, |
170 {0x09, 0x46, 0x13, 0x46, 0x4c, 0x7f, 0x11, 0xd1, | |
171 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, | |
172 | |
173 {AIM_CAPS_SAVESTOCKS, | |
174 {0x09, 0x46, 0x13, 0x47, 0x4c, 0x7f, 0x11, 0xd1, | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
175 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
176 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
177 {AIM_CAPS_GETFILE, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
178 {0x09, 0x46, 0x13, 0x48, 0x4c, 0x7f, 0x11, 0xd1, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
179 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
2086 | 180 |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
181 {AIM_CAPS_ICQSERVERRELAY, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
182 {0x09, 0x46, 0x13, 0x49, 0x4c, 0x7f, 0x11, 0xd1, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
183 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
184 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
185 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
186 * Indeed, there are two of these. The former appears to be correct, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
187 * but in some versions of winaim, the second one is set. Either they |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
188 * forgot to fix endianness, or they made a typo. It really doesn't |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
189 * matter which. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
190 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
191 {AIM_CAPS_GAMES, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
192 {0x09, 0x46, 0x13, 0x4a, 0x4c, 0x7f, 0x11, 0xd1, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
193 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
194 {AIM_CAPS_GAMES2, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
195 {0x09, 0x46, 0x13, 0x4a, 0x4c, 0x7f, 0x11, 0xd1, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
196 0x22, 0x82, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
2086 | 197 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
198 {AIM_CAPS_SENDBUDDYLIST, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
199 {0x09, 0x46, 0x13, 0x4b, 0x4c, 0x7f, 0x11, 0xd1, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
200 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, |
2086 | 201 |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
202 {AIM_CAPS_ICQRTF, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
203 {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
204 0xad, 0x22, 0xd6, 0xab, 0xf7, 0x3f, 0x14, 0x92}}, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
205 |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
206 {AIM_CAPS_ICQUNKNOWN, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
207 {0x2e, 0x7a, 0x64, 0x75, 0xfa, 0xdf, 0x4d, 0xc8, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
208 0x88, 0x6f, 0xea, 0x35, 0x95, 0xfd, 0xb6, 0xdf}}, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
209 |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
210 {AIM_CAPS_EMPTY, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
211 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
212 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
213 |
2920 | 214 {AIM_CAPS_TRILLIANCRYPT, |
215 {0xf2, 0xe7, 0xc7, 0xf4, 0xfe, 0xad, 0x4d, 0xfb, | |
216 0xb2, 0x35, 0x36, 0x79, 0x8b, 0xdf, 0x00, 0x00}}, | |
217 | |
2979 | 218 {AIM_CAPS_APINFO, |
219 {0xAA, 0x4A, 0x32, 0xB5, | |
220 0xF8, 0x84, | |
221 0x48, 0xc6, | |
222 0xA3, 0xD7, | |
223 0x8C, 0x50, 0x97, 0x19, 0xFD, 0x5B}}, | |
224 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
225 {AIM_CAPS_LAST} |
2086 | 226 }; |
227 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
228 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
229 * This still takes a length parameter even with a bstream because capabilities |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
230 * are not naturally bounded. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
231 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
232 */ |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
233 faim_internal fu32_t aim_getcap(aim_session_t *sess, aim_bstream_t *bs, int len) |
2086 | 234 { |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
235 fu32_t flags = 0; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
236 int offset; |
2086 | 237 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
238 for (offset = 0; aim_bstream_empty(bs) && (offset < len); offset += 0x10) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
239 fu8_t *cap; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
240 int i, identified; |
2086 | 241 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
242 cap = aimbs_getraw(bs, 0x10); |
2086 | 243 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
244 for (i = 0, identified = 0; !(aim_caps[i].flag & AIM_CAPS_LAST); i++) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
245 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
246 if (memcmp(&aim_caps[i].data, cap, 0x10) == 0) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
247 flags |= aim_caps[i].flag; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
248 identified++; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
249 break; /* should only match once... */ |
2086 | 250 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
251 } |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
252 } |
2086 | 253 |
2920 | 254 if (!identified) { |
255 faimdprintf(sess, 0, "unknown capability: {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n", | |
256 cap[0], cap[1], cap[2], cap[3], | |
257 cap[4], cap[5], | |
258 cap[6], cap[7], | |
259 cap[8], cap[9], | |
260 cap[10], cap[11], cap[12], cap[13], | |
261 cap[14], cap[15]); | |
262 } | |
2086 | 263 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
264 free(cap); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
265 } |
2086 | 266 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
267 return flags; |
2086 | 268 } |
269 | |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
270 faim_internal int aim_putcap(aim_bstream_t *bs, fu32_t caps) |
2086 | 271 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
272 int i; |
2086 | 273 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
274 if (!bs) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
275 return -EINVAL; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
276 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
277 for (i = 0; aim_bstream_empty(bs); i++) { |
2086 | 278 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
279 if (aim_caps[i].flag == AIM_CAPS_LAST) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
280 break; |
2086 | 281 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
282 if (caps & aim_caps[i].flag) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
283 aimbs_putraw(bs, aim_caps[i].data, 0x10); |
2086 | 284 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
285 } |
2086 | 286 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
287 return 0; |
2086 | 288 } |
289 | |
3459 | 290 static void dumptlv(aim_session_t *sess, fu16_t type, aim_bstream_t *bs, fu8_t len) |
291 { | |
292 int i; | |
293 | |
294 if (!sess || !bs || !len) | |
295 return; | |
296 | |
297 faimdprintf(sess, 0, "userinfo: type =0x%04x\n", type); | |
298 faimdprintf(sess, 0, "userinfo: length=0x%04x\n", len); | |
299 | |
300 faimdprintf(sess, 0, "userinfo: value:\n"); | |
301 | |
302 for (i = 0; i < len; i++) { | |
303 if ((i % 8) == 0) | |
304 faimdprintf(sess, 0, "\nuserinfo: "); | |
305 | |
306 faimdprintf(sess, 0, "0x%2x ", aimbs_get8(bs)); | |
307 } | |
308 | |
309 faimdprintf(sess, 0, "\n"); | |
310 | |
311 return; | |
312 } | |
313 | |
2086 | 314 /* |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
315 * AIM is fairly regular about providing user info. This is a generic |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
316 * routine to extract it in its standard form. |
2086 | 317 */ |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
318 faim_internal int aim_extractuserinfo(aim_session_t *sess, aim_bstream_t *bs, aim_userinfo_t *outinfo) |
2086 | 319 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
320 int curtlv, tlvcnt; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
321 fu8_t snlen; |
2086 | 322 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
323 if (!bs || !outinfo) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
324 return -EINVAL; |
2086 | 325 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
326 /* Clear out old data first */ |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
327 memset(outinfo, 0x00, sizeof(aim_userinfo_t)); |
2086 | 328 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
329 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
330 * Screen name. Stored as an unterminated string prepended with a |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
331 * byte containing its length. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
332 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
333 snlen = aimbs_get8(bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
334 aimbs_getrawbuf(bs, outinfo->sn, snlen); |
2086 | 335 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
336 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
337 * Warning Level. Stored as an unsigned short. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
338 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
339 outinfo->warnlevel = aimbs_get16(bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
340 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
341 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
342 * TLV Count. Unsigned short representing the number of |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
343 * Type-Length-Value triples that follow. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
344 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
345 tlvcnt = aimbs_get16(bs); |
2086 | 346 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
347 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
348 * Parse out the Type-Length-Value triples as they're found. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
349 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
350 for (curtlv = 0; curtlv < tlvcnt; curtlv++) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
351 int endpos; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
352 fu16_t type, length; |
2086 | 353 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
354 type = aimbs_get16(bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
355 length = aimbs_get16(bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
356 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
357 endpos = aim_bstream_curpos(bs) + length; |
2086 | 358 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
359 if (type == 0x0001) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
360 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
361 * Type = 0x0001: User flags |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
362 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
363 * Specified as any of the following ORed together: |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
364 * 0x0001 Trial (user less than 60days) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
365 * 0x0002 Unknown bit 2 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
366 * 0x0004 AOL Main Service user |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
367 * 0x0008 Unknown bit 4 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
368 * 0x0010 Free (AIM) user |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
369 * 0x0020 Away |
2315
7ec21662ffc2
[gaim-migrate @ 2325]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
370 * 0x0400 ActiveBuddy |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
371 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
372 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
373 outinfo->flags = aimbs_get16(bs); |
2993 | 374 outinfo->present |= AIM_USERINFO_PRESENT_FLAGS; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
375 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
376 } else if (type == 0x0002) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
377 /* |
3459 | 378 * Type = 0x0002: Account creation time. |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
379 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
380 * The time/date that the user originally registered for |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
381 * the service, stored in time_t format. |
3459 | 382 * |
383 * I'm not sure how this differs from type 5 ("member | |
384 * since"). | |
385 * | |
386 * Note: This is the field formerly known as "member | |
387 * since". All these years and I finally found out | |
388 * that I got the name wrong. | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
389 */ |
3459 | 390 outinfo->createtime = aimbs_get32(bs); |
391 outinfo->present |= AIM_USERINFO_PRESENT_CREATETIME; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
392 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
393 } else if (type == 0x0003) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
394 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
395 * Type = 0x0003: On-Since date. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
396 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
397 * The time/date that the user started their current |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
398 * session, stored in time_t format. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
399 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
400 outinfo->onlinesince = aimbs_get32(bs); |
2993 | 401 outinfo->present |= AIM_USERINFO_PRESENT_ONLINESINCE; |
2086 | 402 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
403 } else if (type == 0x0004) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
404 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
405 * Type = 0x0004: Idle time. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
406 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
407 * Number of seconds since the user actively used the |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
408 * service. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
409 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
410 * Note that the client tells the server when to start |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
411 * counting idle times, so this may or may not be |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
412 * related to reality. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
413 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
414 outinfo->idletime = aimbs_get16(bs); |
2993 | 415 outinfo->present |= AIM_USERINFO_PRESENT_IDLE; |
3459 | 416 } else if (type == 0x0005) { |
417 /* | |
418 * Type = 0x0005: Member since date. | |
419 * | |
420 * The time/date that the user originally registered for | |
421 * the service, stored in time_t format. | |
422 * | |
423 * This is sometimes sent instead of type 2 ("account | |
424 * creation time"), particularly in the self-info. | |
425 */ | |
426 outinfo->membersince = aimbs_get32(bs); | |
427 outinfo->present |= AIM_USERINFO_PRESENT_MEMBERSINCE; | |
2086 | 428 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
429 } else if (type == 0x0006) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
430 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
431 * Type = 0x0006: ICQ Online Status |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
432 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
433 * ICQ's Away/DND/etc "enriched" status. Some decoding |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
434 * of values done by Scott <darkagl@pcnet.com> |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
435 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
436 aimbs_get16(bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
437 outinfo->icqinfo.status = aimbs_get16(bs); |
2993 | 438 outinfo->present |= AIM_USERINFO_PRESENT_ICQEXTSTATUS; |
2086 | 439 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
440 } else if (type == 0x000a) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
441 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
442 * Type = 0x000a |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
443 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
444 * ICQ User IP Address. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
445 * Ahh, the joy of ICQ security. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
446 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
447 outinfo->icqinfo.ipaddr = aimbs_get32(bs); |
2993 | 448 outinfo->present |= AIM_USERINFO_PRESENT_ICQIPADDR; |
2086 | 449 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
450 } else if (type == 0x000c) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
451 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
452 * Type = 0x000c |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
453 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
454 * random crap containing the IP address, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
455 * apparently a port number, and some Other Stuff. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
456 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
457 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
458 aimbs_getrawbuf(bs, outinfo->icqinfo.crap, 0x25); |
2993 | 459 outinfo->present |= AIM_USERINFO_PRESENT_ICQDATA; |
2086 | 460 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
461 } else if (type == 0x000d) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
462 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
463 * Type = 0x000d |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
464 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
465 * Capability information. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
466 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
467 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
468 outinfo->capabilities = aim_getcap(sess, bs, length); |
2993 | 469 outinfo->present |= AIM_USERINFO_PRESENT_CAPABILITIES; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
470 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
471 } else if (type == 0x000e) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
472 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
473 * Type = 0x000e |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
474 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
475 * Unknown. Always of zero length, and always only |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
476 * on AOL users. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
477 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
478 * Ignore. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
479 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
480 */ |
2086 | 481 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
482 } else if ((type == 0x000f) || (type == 0x0010)) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
483 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
484 * Type = 0x000f: Session Length. (AIM) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
485 * Type = 0x0010: Session Length. (AOL) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
486 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
487 * The duration, in seconds, of the user's current |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
488 * session. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
489 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
490 * Which TLV type this comes in depends on the |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
491 * service the user is using (AIM or AOL). |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
492 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
493 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
494 outinfo->sessionlen = aimbs_get32(bs); |
2993 | 495 outinfo->present |= AIM_USERINFO_PRESENT_SESSIONLEN; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
496 |
3459 | 497 } else if (type == 0x001d) { |
498 /* | |
499 * Type 29: Unknown. | |
500 * | |
501 * Currently very rare. Always 18 bytes of mostly zero. | |
502 */ | |
503 | |
504 } else if (type == 0x001e) { | |
505 /* | |
506 * Type 30: Unknown. | |
507 * | |
508 * Always four bytes, but it doesn't look like an int. | |
509 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
510 } else { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
511 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
512 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
513 * Reaching here indicates that either AOL has |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
514 * added yet another TLV for us to deal with, |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
515 * or the parsing has gone Terribly Wrong. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
516 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
517 * Either way, inform the owner and attempt |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
518 * recovery. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
519 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
520 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
521 faimdprintf(sess, 0, "userinfo: **warning: unexpected TLV:\n"); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
522 faimdprintf(sess, 0, "userinfo: sn =%s\n", outinfo->sn); |
3459 | 523 dumptlv(sess, type, bs, length); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
524 } |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
525 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
526 /* Save ourselves. */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
527 aim_bstream_setpos(bs, endpos); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
528 } |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
529 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
530 return 0; |
2086 | 531 } |
532 | |
533 /* | |
534 * Inverse of aim_extractuserinfo() | |
535 */ | |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
536 faim_internal int aim_putuserinfo(aim_bstream_t *bs, aim_userinfo_t *info) |
2086 | 537 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
538 aim_tlvlist_t *tlvlist = NULL; |
2086 | 539 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
540 if (!bs || !info) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
541 return -EINVAL; |
2086 | 542 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
543 aimbs_put8(bs, strlen(info->sn)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
544 aimbs_putraw(bs, info->sn, strlen(info->sn)); |
2086 | 545 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
546 aimbs_put16(bs, info->warnlevel); |
2086 | 547 |
548 | |
3459 | 549 if (info->present & AIM_USERINFO_PRESENT_FLAGS) |
550 aim_addtlvtochain16(&tlvlist, 0x0001, info->flags); | |
551 if (info->present & AIM_USERINFO_PRESENT_MEMBERSINCE) | |
552 aim_addtlvtochain32(&tlvlist, 0x0002, info->membersince); | |
553 if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE) | |
554 aim_addtlvtochain32(&tlvlist, 0x0003, info->onlinesince); | |
555 if (info->present & AIM_USERINFO_PRESENT_IDLE) | |
556 aim_addtlvtochain16(&tlvlist, 0x0004, info->idletime); | |
2086 | 557 |
558 #if ICQ_OSCAR_SUPPORT | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
559 if (atoi(info->sn) != 0) { |
3459 | 560 if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) |
561 aim_addtlvtochain16(&tlvlist, 0x0006, info->icqinfo.status); | |
562 if (info->present & AIM_USERINFO_PRESENT_ICQIPADDR) | |
563 aim_addtlvtochain32(&tlvlist, 0x000a, info->icqinfo.ipaddr); | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
564 } |
2086 | 565 #endif |
566 | |
3459 | 567 if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES) |
568 aim_addtlvtochain_caps(&tlvlist, 0x000d, info->capabilities); | |
569 | |
570 if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN) | |
571 aim_addtlvtochain32(&tlvlist, (fu16_t)((info->flags & AIM_FLAG_AOL) ? 0x0010 : 0x000f), info->sessionlen); | |
2086 | 572 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
573 aimbs_put16(bs, aim_counttlvchain(&tlvlist)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
574 aim_writetlvchain(bs, &tlvlist); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
575 aim_freetlvchain(&tlvlist); |
2086 | 576 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
577 return 0; |
2086 | 578 } |
579 | |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
580 faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info) |
2086 | 581 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
582 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
583 aim_snacid_t snacid; |
2086 | 584 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
585 if (!sess || !conn || !info) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
586 return -EINVAL; |
2086 | 587 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
588 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
589 return -ENOMEM; |
2086 | 590 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
591 snacid = aim_cachesnac(sess, 0x0003, 0x000b, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
592 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
593 aim_putsnac(&fr->data, 0x0003, 0x000b, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
594 aim_putuserinfo(&fr->data, info); |
2086 | 595 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
596 aim_tx_enqueue(sess, fr); |
2086 | 597 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
598 return 0; |
2086 | 599 } |
600 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
601 faim_export int aim_sendbuddyoffgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn) |
2086 | 602 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
603 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
604 aim_snacid_t snacid; |
2086 | 605 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
606 if (!sess || !conn || !sn) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
607 return -EINVAL; |
2086 | 608 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
609 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn)))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
610 return -ENOMEM; |
2086 | 611 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
612 snacid = aim_cachesnac(sess, 0x0003, 0x000c, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
613 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
614 aim_putsnac(&fr->data, 0x0003, 0x000c, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
615 aimbs_put8(&fr->data, strlen(sn)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
616 aimbs_putraw(&fr->data, sn, strlen(sn)); |
2086 | 617 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
618 aim_tx_enqueue(sess, fr); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
619 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
620 return 0; |
2086 | 621 } |
622 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
623 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
624 * Huh? What is this? |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
625 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
626 faim_export int aim_0002_000b(aim_session_t *sess, aim_conn_t *conn, const char *sn) |
2086 | 627 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
628 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
629 aim_snacid_t snacid; |
2086 | 630 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
631 if (!sess || !conn || !sn) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
632 return -EINVAL; |
2086 | 633 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
634 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn)))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
635 return -ENOMEM; |
2086 | 636 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
637 snacid = aim_cachesnac(sess, 0x0002, 0x000b, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
638 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
639 aim_putsnac(&fr->data, 0x0002, 0x000b, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
640 aimbs_put8(&fr->data, strlen(sn)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
641 aimbs_putraw(&fr->data, sn, strlen(sn)); |
2086 | 642 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
643 aim_tx_enqueue(sess, fr); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
644 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
645 return 0; |
2086 | 646 } |
647 | |
2122 | 648 /* |
649 * Normally contains: | |
650 * t(0001) - short containing max profile length (value = 1024) | |
651 * t(0002) - short - unknown (value = 16) [max MIME type length?] | |
2315
7ec21662ffc2
[gaim-migrate @ 2325]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
652 * t(0003) - short - unknown (value = 10) |
3213 | 653 * t(0004) - short - unknown (value = 2048) [ICQ only?] |
2122 | 654 */ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
655 static int rights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 656 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
657 aim_tlvlist_t *tlvlist; |
2122 | 658 aim_rxcallback_t userfunc; |
659 int ret = 0; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
660 fu16_t maxsiglen = 0; |
2086 | 661 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
662 tlvlist = aim_readtlvchain(bs); |
2086 | 663 |
2122 | 664 if (aim_gettlv(tlvlist, 0x0001, 1)) |
665 maxsiglen = aim_gettlv16(tlvlist, 0x0001, 1); | |
2086 | 666 |
2122 | 667 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
668 ret = userfunc(sess, rx, maxsiglen); | |
2086 | 669 |
2122 | 670 aim_freetlvchain(&tlvlist); |
671 | |
672 return ret; | |
2086 | 673 } |
674 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
675 static int userinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 676 { |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2315
diff
changeset
|
677 aim_userinfo_t userinfo; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
678 char *text_encoding = NULL, *text = NULL; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
679 aim_rxcallback_t userfunc; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
680 aim_tlvlist_t *tlvlist; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
681 aim_snac_t *origsnac = NULL; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
682 struct aim_priv_inforeq *inforeq; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
683 int ret = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
684 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
685 origsnac = aim_remsnac(sess, snac->id); |
2086 | 686 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
687 if (!origsnac || !origsnac->data) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
688 faimdprintf(sess, 0, "parse_userinfo_middle: major problem: no snac stored!\n"); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
689 return 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
690 } |
2086 | 691 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
692 inforeq = (struct aim_priv_inforeq *)origsnac->data; |
2086 | 693 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
694 if ((inforeq->infotype != AIM_GETINFO_GENERALINFO) && |
2920 | 695 (inforeq->infotype != AIM_GETINFO_AWAYMESSAGE) && |
696 (inforeq->infotype != AIM_GETINFO_CAPABILITIES)) { | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
697 faimdprintf(sess, 0, "parse_userinfo_middle: unknown infotype in request! (0x%04x)\n", inforeq->infotype); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
698 return 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
699 } |
2086 | 700 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
701 aim_extractuserinfo(sess, bs, &userinfo); |
2086 | 702 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
703 tlvlist = aim_readtlvchain(bs); |
2086 | 704 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
705 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
706 * Depending on what informational text was requested, different |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
707 * TLVs will appear here. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
708 * |
2920 | 709 * Profile will be 1 and 2, away message will be 3 and 4, caps |
710 * will be 5. | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
711 */ |
2920 | 712 if (inforeq->infotype == AIM_GETINFO_GENERALINFO) { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
713 text_encoding = aim_gettlv_str(tlvlist, 0x0001, 1); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
714 text = aim_gettlv_str(tlvlist, 0x0002, 1); |
2920 | 715 } else if (inforeq->infotype == AIM_GETINFO_AWAYMESSAGE) { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
716 text_encoding = aim_gettlv_str(tlvlist, 0x0003, 1); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
717 text = aim_gettlv_str(tlvlist, 0x0004, 1); |
2920 | 718 } else if (inforeq->infotype == AIM_GETINFO_CAPABILITIES) { |
719 aim_tlv_t *ct; | |
720 | |
721 if ((ct = aim_gettlv(tlvlist, 0x0005, 1))) { | |
722 aim_bstream_t cbs; | |
723 | |
724 aim_bstream_init(&cbs, ct->value, ct->length); | |
725 | |
726 userinfo.capabilities = aim_getcap(sess, &cbs, ct->length); | |
2993 | 727 userinfo.present = AIM_USERINFO_PRESENT_CAPABILITIES; |
2920 | 728 } |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
729 } |
2086 | 730 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
731 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
2920 | 732 ret = userfunc(sess, rx, &userinfo, inforeq->infotype, text_encoding, text); |
2086 | 733 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
734 free(text_encoding); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
735 free(text); |
2086 | 736 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
737 aim_freetlvchain(&tlvlist); |
2086 | 738 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
739 if (origsnac) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
740 free(origsnac->data); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
741 free(origsnac); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
742 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
743 return ret; |
2086 | 744 } |
745 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
746 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 747 { |
748 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
749 if (snac->subtype == 0x0003) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
750 return rights(sess, mod, rx, snac, bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
751 else if (snac->subtype == 0x0006) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
752 return userinfo(sess, mod, rx, snac, bs); |
2086 | 753 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
754 return 0; |
2086 | 755 } |
756 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
757 faim_internal int locate_modfirst(aim_session_t *sess, aim_module_t *mod) |
2086 | 758 { |
759 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
760 mod->family = 0x0002; |
2672 | 761 mod->version = 0x0001; |
762 mod->toolid = 0x0101; | |
763 mod->toolversion = 0x047b; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
764 mod->flags = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
765 strncpy(mod->name, "locate", sizeof(mod->name)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
766 mod->snachandler = snachandler; |
2086 | 767 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
768 return 0; |
2086 | 769 } |