Mercurial > pidgin.yaz
diff libfaim/aim_misc.c @ 835:88f8f98de02d
[gaim-migrate @ 845]
libfaim changes. should improve reliablity and stability.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 03 Sep 2000 23:22:05 +0000 |
parents | 9a123b171f46 |
children | e1da6a6ec42b |
line wrap: on
line diff
--- a/libfaim/aim_misc.c Sat Sep 02 12:46:05 2000 +0000 +++ b/libfaim/aim_misc.c Sun Sep 03 23:22:05 2000 +0000 @@ -260,6 +260,45 @@ return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask); } +int aim_parse_bosrights(struct aim_session_t *sess, + struct command_rx_struct *command, ...) +{ + rxcallback_t userfunc = NULL; + int ret=1; + struct aim_tlvlist_t *tlvlist; + struct aim_tlv_t *tlv; + unsigned short maxpermits = 0, maxdenies = 0; + + /* + * TLVs follow + */ + if (!(tlvlist = aim_readtlvchain(command->data+10, command->commandlen-10))) + return ret; + + /* + * TLV type 0x0001: Maximum number of buddies on permit list. + */ + if ((tlv = aim_gettlv(tlvlist, 0x0001, 1))) { + maxpermits = aimutil_get16(tlv->value); + } + + /* + * TLV type 0x0002: Maximum number of buddies on deny list. + * + */ + if ((tlv = aim_gettlv(tlvlist, 0x0002, 1))) { + maxdenies = aimutil_get16(tlv->value); + } + + userfunc = aim_callhandler(command->conn, 0x0009, 0x0003); + if (userfunc) + ret = userfunc(sess, command, maxpermits, maxdenies); + + aim_freetlvchain(&tlvlist); + + return ret; +} + /* * aim_bos_clientready() *