comparison src/protocols/oscar/info.c @ 2993:7239a392486c

[gaim-migrate @ 3006] 0.53 :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sat, 02 Mar 2002 04:52:21 +0000
parents 8e924e4aa256
children 7ed9fa994055
comparison
equal deleted inserted replaced
2992:d16a0504f1c8 2993:7239a392486c
104 } 104 }
105 105
106 faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu32_t cap) 106 faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu32_t cap)
107 { 107 {
108 108
109 if (!ui || !ui->capspresent) 109 if (!ui || !(ui->present & AIM_USERINFO_PRESENT_CAPABILITIES))
110 return -1; 110 return -1;
111 111
112 return !!(ui->capabilities & cap); 112 return !!(ui->capabilities & cap);
113 } 113 }
114 114
336 * 0x0020 Away 336 * 0x0020 Away
337 * 0x0400 ActiveBuddy 337 * 0x0400 ActiveBuddy
338 * 338 *
339 */ 339 */
340 outinfo->flags = aimbs_get16(bs); 340 outinfo->flags = aimbs_get16(bs);
341 outinfo->present |= AIM_USERINFO_PRESENT_FLAGS;
341 342
342 } else if (type == 0x0002) { 343 } else if (type == 0x0002) {
343 /* 344 /*
344 * Type = 0x0002: Member-Since date. 345 * Type = 0x0002: Member-Since date.
345 * 346 *
346 * The time/date that the user originally registered for 347 * The time/date that the user originally registered for
347 * the service, stored in time_t format. 348 * the service, stored in time_t format.
348 */ 349 */
349 outinfo->membersince = aimbs_get32(bs); 350 outinfo->membersince = aimbs_get32(bs);
351 outinfo->present |= AIM_USERINFO_PRESENT_MEMBERSINCE;
350 352
351 } else if (type == 0x0003) { 353 } else if (type == 0x0003) {
352 /* 354 /*
353 * Type = 0x0003: On-Since date. 355 * Type = 0x0003: On-Since date.
354 * 356 *
355 * The time/date that the user started their current 357 * The time/date that the user started their current
356 * session, stored in time_t format. 358 * session, stored in time_t format.
357 */ 359 */
358 outinfo->onlinesince = aimbs_get32(bs); 360 outinfo->onlinesince = aimbs_get32(bs);
361 outinfo->present |= AIM_USERINFO_PRESENT_ONLINESINCE;
359 362
360 } else if (type == 0x0004) { 363 } else if (type == 0x0004) {
361 /* 364 /*
362 * Type = 0x0004: Idle time. 365 * Type = 0x0004: Idle time.
363 * 366 *
367 * Note that the client tells the server when to start 370 * Note that the client tells the server when to start
368 * counting idle times, so this may or may not be 371 * counting idle times, so this may or may not be
369 * related to reality. 372 * related to reality.
370 */ 373 */
371 outinfo->idletime = aimbs_get16(bs); 374 outinfo->idletime = aimbs_get16(bs);
375 outinfo->present |= AIM_USERINFO_PRESENT_IDLE;
372 376
373 } else if (type == 0x0006) { 377 } else if (type == 0x0006) {
374 /* 378 /*
375 * Type = 0x0006: ICQ Online Status 379 * Type = 0x0006: ICQ Online Status
376 * 380 *
377 * ICQ's Away/DND/etc "enriched" status. Some decoding 381 * ICQ's Away/DND/etc "enriched" status. Some decoding
378 * of values done by Scott <darkagl@pcnet.com> 382 * of values done by Scott <darkagl@pcnet.com>
379 */ 383 */
380 aimbs_get16(bs); 384 aimbs_get16(bs);
381 outinfo->icqinfo.status = aimbs_get16(bs); 385 outinfo->icqinfo.status = aimbs_get16(bs);
386 outinfo->present |= AIM_USERINFO_PRESENT_ICQEXTSTATUS;
382 387
383 } else if (type == 0x000a) { 388 } else if (type == 0x000a) {
384 /* 389 /*
385 * Type = 0x000a 390 * Type = 0x000a
386 * 391 *
387 * ICQ User IP Address. 392 * ICQ User IP Address.
388 * Ahh, the joy of ICQ security. 393 * Ahh, the joy of ICQ security.
389 */ 394 */
390 outinfo->icqinfo.ipaddr = aimbs_get32(bs); 395 outinfo->icqinfo.ipaddr = aimbs_get32(bs);
396 outinfo->present |= AIM_USERINFO_PRESENT_ICQIPADDR;
391 397
392 } else if (type == 0x000c) { 398 } else if (type == 0x000c) {
393 /* 399 /*
394 * Type = 0x000c 400 * Type = 0x000c
395 * 401 *
396 * random crap containing the IP address, 402 * random crap containing the IP address,
397 * apparently a port number, and some Other Stuff. 403 * apparently a port number, and some Other Stuff.
398 * 404 *
399 */ 405 */
400 aimbs_getrawbuf(bs, outinfo->icqinfo.crap, 0x25); 406 aimbs_getrawbuf(bs, outinfo->icqinfo.crap, 0x25);
407 outinfo->present |= AIM_USERINFO_PRESENT_ICQDATA;
401 408
402 } else if (type == 0x000d) { 409 } else if (type == 0x000d) {
403 /* 410 /*
404 * Type = 0x000d 411 * Type = 0x000d
405 * 412 *
406 * Capability information. 413 * Capability information.
407 * 414 *
408 */ 415 */
409 outinfo->capabilities = aim_getcap(sess, bs, length); 416 outinfo->capabilities = aim_getcap(sess, bs, length);
410 outinfo->capspresent = 1; 417 outinfo->present |= AIM_USERINFO_PRESENT_CAPABILITIES;
411 418
412 } else if (type == 0x000e) { 419 } else if (type == 0x000e) {
413 /* 420 /*
414 * Type = 0x000e 421 * Type = 0x000e
415 * 422 *
431 * Which TLV type this comes in depends on the 438 * Which TLV type this comes in depends on the
432 * service the user is using (AIM or AOL). 439 * service the user is using (AIM or AOL).
433 * 440 *
434 */ 441 */
435 outinfo->sessionlen = aimbs_get32(bs); 442 outinfo->sessionlen = aimbs_get32(bs);
443 outinfo->present |= AIM_USERINFO_PRESENT_SESSIONLEN;
436 444
437 } else { 445 } else {
438 446
439 /* 447 /*
440 * Reaching here indicates that either AOL has 448 * Reaching here indicates that either AOL has
642 aim_bstream_t cbs; 650 aim_bstream_t cbs;
643 651
644 aim_bstream_init(&cbs, ct->value, ct->length); 652 aim_bstream_init(&cbs, ct->value, ct->length);
645 653
646 userinfo.capabilities = aim_getcap(sess, &cbs, ct->length); 654 userinfo.capabilities = aim_getcap(sess, &cbs, ct->length);
647 userinfo.capspresent = 1; 655 userinfo.present = AIM_USERINFO_PRESENT_CAPABILITIES;
648 } 656 }
649 } 657 }
650 658
651 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 659 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
652 ret = userfunc(sess, rx, &userinfo, inforeq->infotype, text_encoding, text); 660 ret = userfunc(sess, rx, &userinfo, inforeq->infotype, text_encoding, text);