Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/tlv.c

    rb8ef1b1 r6042a54  
    223223
    224224/**
    225  * aim_addtlvtochain_availmsg - Add a ICQ availability message to a TLV chain
    226  * @list: Destination chain
    227  * @type: TLV type to add
    228  * @val: Value to add
    229  *
    230  * Adds a available message to a TLV chain
    231  *
    232  */
    233 int aim_addtlvtochain_availmsg(aim_tlvlist_t **list, const guint16 t, const char *msg)
    234 {
    235         int ret;
    236         guint16 unknown_data = 0x00;
    237         guint8 add_data_len = 4;
    238         guint16 msg_len = strlen(msg);
    239         guint8 total_len = strlen(msg) + add_data_len;
    240         guint8 *data, *cur;
    241         guint8 alloc_len = msg_len + (3*sizeof(guint16)) + (2*sizeof(guint8));
    242         data = cur = g_malloc(alloc_len);
    243        
    244         cur += aimutil_put16(cur, 2);
    245         cur += aimutil_put8(cur, add_data_len);
    246         cur += aimutil_put8(cur, total_len);
    247         cur += aimutil_put16(cur, msg_len);
    248         cur += aimutil_putstr(cur, msg, msg_len);
    249         cur += aimutil_put16(cur, unknown_data);
    250 
    251         ret = aim_addtlvtochain_raw(list, t, alloc_len, data);
    252         g_free(data);
    253 
    254         return ret;
    255 }
    256 
    257 /**
    258225 * aim_addtlvtochain_caps - Add a capability block to a TLV chain
    259226 * @list: Destination chain
     
    278245
    279246        return aim_addtlvtochain_raw(list, t, aim_bstream_curpos(&bs), buf);
    280 }
    281 
    282 int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, guint16 type, aim_userinfo_t *ui)
    283 {
    284         guint8 buf[1024]; /* bleh */
    285         aim_bstream_t bs;
    286 
    287         aim_bstream_init(&bs, buf, sizeof(buf));
    288 
    289         aim_putuserinfo(&bs, ui);
    290 
    291         return aim_addtlvtochain_raw(list, type, aim_bstream_curpos(&bs), buf);
    292247}
    293248
Note: See TracChangeset for help on using the changeset viewer.