Mercurial > pidgin.yaz
diff src/protocols/oscar/icq.c @ 2742:6f527cbd899d
[gaim-migrate @ 2755]
i'll commit it later.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 18 Nov 2001 00:21:49 +0000 |
parents | eeac6ea7ade6 |
children | 07283934dedd |
line wrap: on
line diff
--- a/src/protocols/oscar/icq.c Sat Nov 17 22:50:08 2001 +0000 +++ b/src/protocols/oscar/icq.c Sun Nov 18 00:21:49 2001 +0000 @@ -108,6 +108,43 @@ return 0; } +faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin) +{ + aim_conn_t *conn; + aim_frame_t *fr; + aim_snacid_t snacid; + int bslen; + + if (!uin || uin[0] < '0' || uin[0] > '9') + return -EINVAL; + + if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) + return -EINVAL; + + bslen = 2 + 4 + 2 + 2 + 2 + 4; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) + return -ENOMEM; + + snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); + + /* For simplicity, don't bother using a tlvlist */ + aimbs_put16(&fr->data, 0x0001); + aimbs_put16(&fr->data, bslen); + + aimbs_putle16(&fr->data, bslen - 2); + aimbs_putle32(&fr->data, atoi(sess->sn)); + aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */ + aimbs_putle16(&fr->data, snacid); /* eh. */ + aimbs_putle16(&fr->data, 0x051f); /* shrug. */ + aimbs_putle32(&fr->data, atoi(uin)); + + aim_tx_enqueue(sess, fr); + + return 0; +} + /* * Response to 15/2, contains an ICQ packet. */ @@ -162,6 +199,40 @@ if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE))) ret = userfunc(sess, rx); + } else if (cmd == 0x07da) { + fu16_t subtype; + + subtype = aimbs_getle16(&qbs); + + if (subtype == 0x019a) { + fu16_t tlen; + struct aim_icq_simpleinfo info; + aim_rxcallback_t userfunc; + + memset(&info, 0, sizeof(info)); + + aimbs_getle8(&qbs); /* no clue */ + aimbs_getle16(&qbs); /* no clue */ + info.uin = aimbs_getle32(&qbs); + tlen = aimbs_getle16(&qbs); + info.nick = aimbs_getstr(&qbs, tlen); + tlen = aimbs_getle16(&qbs); + info.first = aimbs_getstr(&qbs, tlen); + tlen = aimbs_getle16(&qbs); + info.last = aimbs_getstr(&qbs, tlen); + tlen = aimbs_getle16(&qbs); + info.email = aimbs_getstr(&qbs, tlen); + /* no clue what the rest of it is */ + + if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_SIMPLEINFO))) + ret = userfunc(sess, rx, &info); + + free(info.nick); + free(info.first); + free(info.last); + free(info.email); + } + } aim_freetlvchain(&tl);