comparison src/protocols/oscar/info.c @ 2866:6d62d4520460

[gaim-migrate @ 2879] try that committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 10 Dec 2001 00:48:27 +0000
parents 9fc65bb80596
children 93e2c99ccf50
comparison
equal deleted inserted replaced
2865:88dc3623a2ae 2866:6d62d4520460
104 return 0; 104 return 0;
105 105
106 return ui->sessionlen; 106 return ui->sessionlen;
107 } 107 }
108 108
109 faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu16_t cap) 109 faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu32_t cap)
110 { 110 {
111 111
112 if (!ui || !ui->capspresent) 112 if (!ui || !ui->capspresent)
113 return -1; 113 return -1;
114 114
115 return !!(ui->capabilities & cap); 115 return !!(ui->capabilities & cap);
116 } 116 }
117 117
118 118
119 /* 119 /*
120 * Capability blocks. 120 * Capability blocks.
121 *
122 * These are CLSIDs. They should actually be of the form:
123 *
124 * {0x0946134b, 0x4c7f, 0x11d1,
125 * {0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}},
126 *
127 * But, eh.
121 */ 128 */
122 static const struct { 129 static const struct {
123 unsigned short flag; 130 fu32_t flag;
124 unsigned char data[16]; 131 fu8_t data[16];
125 } aim_caps[] = { 132 } aim_caps[] = {
126 133
127 /* 134 /*
128 * Chat is oddball. 135 * Chat is oddball.
129 */ 136 */
161 {0x09, 0x46, 0x13, 0x47, 0x4c, 0x7f, 0x11, 0xd1, 168 {0x09, 0x46, 0x13, 0x47, 0x4c, 0x7f, 0x11, 0xd1,
162 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 169 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
163 170
164 {AIM_CAPS_GETFILE, 171 {AIM_CAPS_GETFILE,
165 {0x09, 0x46, 0x13, 0x48, 0x4c, 0x7f, 0x11, 0xd1, 172 {0x09, 0x46, 0x13, 0x48, 0x4c, 0x7f, 0x11, 0xd1,
173 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
174
175 {AIM_CAPS_ICQSERVERRELAY,
176 {0x09, 0x46, 0x13, 0x49, 0x4c, 0x7f, 0x11, 0xd1,
166 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 177 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
167 178
168 /* 179 /*
169 * Indeed, there are two of these. The former appears to be correct, 180 * Indeed, there are two of these. The former appears to be correct,
170 * but in some versions of winaim, the second one is set. Either they 181 * but in some versions of winaim, the second one is set. Either they
184 195
185 {AIM_CAPS_ABINTERNAL, 196 {AIM_CAPS_ABINTERNAL,
186 {0x09, 0x46, 0x13, 0x4f, 0x4c, 0x7f, 0x11, 0xd1, 197 {0x09, 0x46, 0x13, 0x4f, 0x4c, 0x7f, 0x11, 0xd1,
187 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 198 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
188 199
200 {AIM_CAPS_ICQRTF,
201 {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34,
202 0xad, 0x22, 0xd6, 0xab, 0xf7, 0x3f, 0x14, 0x92}},
203
204 {AIM_CAPS_ICQUNKNOWN,
205 {0x2e, 0x7a, 0x64, 0x75, 0xfa, 0xdf, 0x4d, 0xc8,
206 0x88, 0x6f, 0xea, 0x35, 0x95, 0xfd, 0xb6, 0xdf}},
207
208 {AIM_CAPS_EMPTY,
209 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
210 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
211
189 {AIM_CAPS_LAST} 212 {AIM_CAPS_LAST}
190 }; 213 };
191 214
192 /* 215 /*
193 * This still takes a length parameter even with a bstream because capabilities 216 * This still takes a length parameter even with a bstream because capabilities
194 * are not naturally bounded. 217 * are not naturally bounded.
195 * 218 *
196 */ 219 */
197 faim_internal fu16_t aim_getcap(aim_session_t *sess, aim_bstream_t *bs, int len) 220 faim_internal fu32_t aim_getcap(aim_session_t *sess, aim_bstream_t *bs, int len)
198 { 221 {
199 fu16_t flags = 0; 222 fu32_t flags = 0;
200 int offset; 223 int offset;
201 224
202 for (offset = 0; aim_bstream_empty(bs) && (offset < len); offset += 0x10) { 225 for (offset = 0; aim_bstream_empty(bs) && (offset < len); offset += 0x10) {
203 fu8_t *cap; 226 fu8_t *cap;
204 int i, identified; 227 int i, identified;
222 } 245 }
223 246
224 return flags; 247 return flags;
225 } 248 }
226 249
227 faim_internal int aim_putcap(aim_bstream_t *bs, fu16_t caps) 250 faim_internal int aim_putcap(aim_bstream_t *bs, fu32_t caps)
228 { 251 {
229 int i; 252 int i;
230 253
231 if (!bs) 254 if (!bs)
232 return -EINVAL; 255 return -EINVAL;