comparison libpurple/protocols/oscar/family_icq.c @ 25028:2c80f3d839c7

Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda, and libpurple users. Retrieval of messages from libpurple users works only for statuses that are not Available. Fixes #703, #892, #4904, #4984, #6848. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author Daniel Lj <dimmuxx@yahoo.se>
date Thu, 29 Jan 2009 03:15:57 +0000
parents 531922f4ea2a
children 9d5d6b9ae18a
comparison
equal deleted inserted replaced
25027:075aa09253e7 25028:2c80f3d839c7
450 450
451 byte_stream_destroy(&bs); 451 byte_stream_destroy(&bs);
452 452
453 g_free(xml); 453 g_free(xml);
454 g_free(stripped); 454 g_free(stripped);
455
456 return 0;
457 }
458
459 /*
460 * getstatusnote may be a misleading name because the response
461 * contains a lot of different information but currently it's only
462 * used to get that.
463 */
464 int aim_icq_getstatusnote(OscarData *od, const char *uin, guint8 *note_hash, guint16 note_hash_len)
465 {
466 FlapConnection *conn;
467 ByteStream bs;
468 aim_snacid_t snacid;
469 int bslen;
470
471 purple_debug_misc("oscar", "aim_icq_getstatusnote: requesting status note for %s.\n", uin);
472
473 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
474 {
475 purple_debug_misc("oscar", "aim_icq_getstatusnote: no connection.\n");
476 return -EINVAL;
477 }
478
479 bslen = 2 + 4 + 2 + 2 + 2 + 2 + 58 + strlen(uin);
480 byte_stream_new(&bs, 4 + bslen);
481
482 snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0);
483
484 byte_stream_put16(&bs, 0x0001);
485 byte_stream_put16(&bs, bslen);
486
487 byte_stream_putle16(&bs, bslen - 2);
488 byte_stream_putuid(&bs, od);
489 byte_stream_putle16(&bs, 0x07d0); /* I command thee. */
490 byte_stream_putle16(&bs, snacid); /* eh. */
491 byte_stream_putle16(&bs, 0x0fa0); /* shrug. */
492 byte_stream_putle16(&bs, 58 + strlen(uin));
493
494 byte_stream_put32(&bs, 0x05b90002); /* don't ask */
495 byte_stream_put32(&bs, 0x80000000);
496 byte_stream_put32(&bs, 0x00000006);
497 byte_stream_put32(&bs, 0x00010002);
498 byte_stream_put32(&bs, 0x00020000);
499 byte_stream_put32(&bs, 0x04e30000);
500 byte_stream_put32(&bs, 0x00020002);
501 byte_stream_put32(&bs, 0x00000001);
502
503 byte_stream_put16(&bs, 24 + strlen(uin));
504 byte_stream_put32(&bs, 0x003c0010);
505 byte_stream_putraw(&bs, note_hash, 16); /* status note hash */
506 byte_stream_put16(&bs, 0x0032); /* buddy uin */
507 byte_stream_put16(&bs, strlen(uin));
508 byte_stream_putstr(&bs, uin);
509
510 flap_connection_send_snac_with_priority(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x000, snacid, &bs, FALSE);
511
512 byte_stream_destroy(&bs);
513 455
514 return 0; 456 return 0;
515 } 457 }
516 458
517 static void aim_icq_freeinfo(struct aim_icq_info *info) { 459 static void aim_icq_freeinfo(struct aim_icq_info *info) {