diff options
author | Nelson Elhage <nelhage@mit.edu> | 2005-12-04 14:32:14 -0500 |
---|---|---|
committer | Nelson Elhage <nelhage@mit.edu> | 2005-12-04 14:32:14 -0500 |
commit | b8ef1b1aacfa2f407b6245174a06a67fa2f114af (patch) | |
tree | 9c09f6170f68667c57025e297e373b72b6c0da9e /protocols/oscar/tlv.c | |
parent | d636233a518fbe46264230866d4b8ea463f1474e (diff) |
Merging the Hanji groupchat patch
Diffstat (limited to 'protocols/oscar/tlv.c')
-rw-r--r-- | protocols/oscar/tlv.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/protocols/oscar/tlv.c b/protocols/oscar/tlv.c index 11b89758..9d827caf 100644 --- a/protocols/oscar/tlv.c +++ b/protocols/oscar/tlv.c @@ -339,6 +339,31 @@ int aim_addtlvtochain_frozentlvlist(aim_tlvlist_t **list, guint16 type, aim_tlvl return buflen; } +int aim_addtlvtochain_chatroom(aim_tlvlist_t **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance) +{ + guint8 *buf; + int buflen; + aim_bstream_t bs; + + buflen = 2 + 1 + strlen(roomname) + 2; + + if (!(buf = g_malloc(buflen))) + return 0; + + aim_bstream_init(&bs, buf, buflen); + + aimbs_put16(&bs, exchange); + aimbs_put8(&bs, strlen(roomname)); + aimbs_putraw(&bs, (guint8 *)roomname, strlen(roomname)); + aimbs_put16(&bs, instance); + + aim_addtlvtochain_raw(list, type, aim_bstream_curpos(&bs), buf); + + g_free(buf); + + return 0; +} + /** * aim_writetlvchain - Write a TLV chain into a data buffer. * @buf: Destination buffer |