245
245
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
246
246
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
248
{OSCAR_CAPABILITY_HTML_MSGS,
249
{0x01, 0x38, 0xca, 0x7b, 0x76, 0x9a, 0x49, 0x15,
250
0x88, 0xf2, 0x13, 0xfc, 0x00, 0x97, 0x9e, 0xa8}},
248
252
{OSCAR_CAPABILITY_LAST,
249
253
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
250
254
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
1168
/* Apparently, this is never called.
1169
* If you activate it, figure out a way to know what mood to pass to
1170
* aim_tlvlist_add_caps() below. --rlaager */
1173
* Inverse of aim_info_extract()
1176
aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info)
1178
GSList *tlvlist = NULL;
1183
byte_stream_put8(bs, strlen(info->bn));
1184
byte_stream_putstr(bs, info->bn);
1186
byte_stream_put16(bs, info->warnlevel);
1188
if (info->present & AIM_USERINFO_PRESENT_FLAGS)
1189
aim_tlvlist_add_16(&tlvlist, 0x0001, info->flags);
1190
if (info->present & AIM_USERINFO_PRESENT_MEMBERSINCE)
1191
aim_tlvlist_add_32(&tlvlist, 0x0002, info->membersince);
1192
if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE)
1193
aim_tlvlist_add_32(&tlvlist, 0x0003, info->onlinesince);
1194
if (info->present & AIM_USERINFO_PRESENT_IDLE)
1195
aim_tlvlist_add_16(&tlvlist, 0x0004, info->idletime);
1197
/* XXX - So, ICQ_OSCAR_SUPPORT is never defined anywhere... */
1198
#ifdef ICQ_OSCAR_SUPPORT
1199
if (atoi(info->bn) != 0) {
1200
if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS)
1201
aim_tlvlist_add_16(&tlvlist, 0x0006, info->icqinfo.status);
1202
if (info->present & AIM_USERINFO_PRESENT_ICQIPADDR)
1203
aim_tlvlist_add_32(&tlvlist, 0x000a, info->icqinfo.ipaddr);
1207
if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES) {
1208
aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities, NULL);
1211
if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN)
1212
aim_tlvlist_add_32(&tlvlist, (guint16)((info->flags & AIM_FLAG_AOL) ? 0x0010 : 0x000f), info->sessionlen);
1214
byte_stream_put16(bs, aim_tlvlist_count(tlvlist));
1215
aim_tlvlist_write(bs, &tlvlist);
1216
aim_tlvlist_free(tlvlist);
1223
1170
* Subtype 0x0001
1226
1173
error(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
1229
aim_rxcallback_t userfunc;
1230
1175
aim_snac_t *snac2;
1231
1176
guint16 reason;
1424
1367
aim_tlvlist_write(&bs, &tlvlist);
1425
1368
aim_tlvlist_free(tlvlist);
1427
flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0004, 0x0000, snacid, &bs);
1429
byte_stream_destroy(&bs);
1435
* Subtype 0x0005 - Request info of another AIM user.
1437
* @param bn The buddy name whose info you wish to request.
1438
* @param infotype The type of info you wish to request.
1439
* 0x0001 - Info/profile
1440
* 0x0003 - Away message
1441
* 0x0004 - Capabilities
1444
aim_locate_getinfo(OscarData *od, const char *bn, guint16 infotype)
1446
FlapConnection *conn;
1448
aim_snacid_t snacid;
1450
if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE)) || !bn)
1453
byte_stream_new(&bs, 2+1+strlen(bn));
1455
snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0005, 0x0000, NULL, 0);
1457
byte_stream_put16(&bs, infotype);
1458
byte_stream_put8(&bs, strlen(bn));
1459
byte_stream_putstr(&bs, bn);
1461
flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0005, 0x0000, snacid, &bs);
1370
flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0004, snacid, &bs);
1463
1372
byte_stream_destroy(&bs);
1522
1430
g_free(userinfo);
1524
1432
/* Show the info to the user */
1525
if (userinfo2 != NULL && ((userfunc = aim_callhandler(od, snac->family, snac->subtype))))
1526
ret = userfunc(od, conn, frame, userinfo2);
1433
oscar_user_info_display_aim(od, userinfo2);
1532
* Subtype 0x0009 - Set directory profile data.
1534
* This is not the same as aim_location_setprofile!
1535
* privacy: 1 to allow searching, 0 to disallow.
1538
int aim_locate_setdirinfo(OscarData *od, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, guint16 privacy)
1540
FlapConnection *conn;
1542
aim_snacid_t snacid;
1543
GSList *tlvlist = NULL;
1545
if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE)))
1548
aim_tlvlist_add_16(&tlvlist, 0x000a, privacy);
1551
aim_tlvlist_add_str(&tlvlist, 0x0001, first);
1553
aim_tlvlist_add_str(&tlvlist, 0x0002, last);
1555
aim_tlvlist_add_str(&tlvlist, 0x0003, middle);
1557
aim_tlvlist_add_str(&tlvlist, 0x0004, maiden);
1560
aim_tlvlist_add_str(&tlvlist, 0x0007, state);
1562
aim_tlvlist_add_str(&tlvlist, 0x0008, city);
1565
aim_tlvlist_add_str(&tlvlist, 0x000c, nickname);
1567
aim_tlvlist_add_str(&tlvlist, 0x000d, zip);
1570
aim_tlvlist_add_str(&tlvlist, 0x0021, street);
1572
byte_stream_new(&bs, aim_tlvlist_size(tlvlist));
1574
snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0009, 0x0000, NULL, 0);
1576
aim_tlvlist_write(&bs, &tlvlist);
1577
aim_tlvlist_free(tlvlist);
1579
flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0009, 0x0000, snacid, &bs);
1581
byte_stream_destroy(&bs);
1587
* Subtype 0x000b - Huh? What is this?
1589
int aim_locate_000b(OscarData *od, const char *bn)
1591
FlapConnection *conn;
1593
aim_snacid_t snacid;
1597
if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE)) || !bn)
1600
byte_stream_new(&bs, 1+strlen(bn));
1602
snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x000b, 0x0000, NULL, 0);
1604
byte_stream_put8(&bs, strlen(bn));
1605
byte_stream_putstr(&bs, bn);
1607
flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x000b, 0x0000, snacid, &bs);
1609
byte_stream_destroy(&bs);
1617
* XXX pass these in better
1621
aim_locate_setinterests(OscarData *od, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy)
1623
FlapConnection *conn;
1625
aim_snacid_t snacid;
1626
GSList *tlvlist = NULL;
1628
if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE)))
1632
aim_tlvlist_add_16(&tlvlist, 0x000a, privacy);
1635
aim_tlvlist_add_str(&tlvlist, 0x0000b, interest1);
1637
aim_tlvlist_add_str(&tlvlist, 0x0000b, interest2);
1639
aim_tlvlist_add_str(&tlvlist, 0x0000b, interest3);
1641
aim_tlvlist_add_str(&tlvlist, 0x0000b, interest4);
1643
aim_tlvlist_add_str(&tlvlist, 0x0000b, interest5);
1645
byte_stream_new(&bs, aim_tlvlist_size(tlvlist));
1647
snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x000f, 0x0000, NULL, 0);
1649
aim_tlvlist_write(&bs, &tlvlist);
1650
aim_tlvlist_free(tlvlist);
1652
flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x000f, 0x0000, snacid, &bs);
1654
byte_stream_destroy(&bs);
1659
1439
* Subtype 0x0015 - Request the info of a user using the short method. This is
1660
1440
* what iChat uses. It normally is VERY leniently rate limited.