Changeset 862371b for libfaim/search.c


Ignore:
Timestamp:
Jun 29, 2003, 1:47:04 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e016fc2
Parents:
03ad7b2
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfaim/search.c

    r5e53c4a r862371b  
    1 
    21/*
    3  * aim_search.c
     2 * Family 0x000a - User Search.
    43 *
    54 * TODO: Add aim_usersearch_name()
     
    109#include <aim.h>
    1110
    12 faim_export int aim_usersearch_address(aim_session_t *sess, aim_conn_t *conn, const char *address)
    13 {
    14         aim_frame_t *fr;
    15         aim_snacid_t snacid;
    16 
    17         if (!sess || !conn || !address)
    18                 return -EINVAL;
    19 
    20         if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+strlen(address))))
    21                 return -ENOMEM;
    22 
    23         snacid = aim_cachesnac(sess, 0x000a, 0x0002, 0x0000, strdup(address), strlen(address)+1);
    24         aim_putsnac(&fr->data, 0x000a, 0x0002, 0x0000, snacid);
    25        
    26         aimbs_putraw(&fr->data, address, strlen(address));
    27 
    28         aim_tx_enqueue(sess, fr);
    29 
    30         return 0;
    31 }
    32 
    33 /* XXX can this be integrated with the rest of the error handling? */
     11/*
     12 * Subtype 0x0001
     13 *
     14 * XXX can this be integrated with the rest of the error handling?
     15 */
    3416static int error(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
    3517{
     
    5537}
    5638
     39/*
     40 * Subtype 0x0002
     41 *
     42 */
     43faim_export int aim_usersearch_address(aim_session_t *sess, aim_conn_t *conn, const char *address)
     44{
     45        aim_frame_t *fr;
     46        aim_snacid_t snacid;
     47
     48        if (!sess || !conn || !address)
     49                return -EINVAL;
     50
     51        if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+strlen(address))))
     52                return -ENOMEM;
     53
     54        snacid = aim_cachesnac(sess, 0x000a, 0x0002, 0x0000, strdup(address), strlen(address)+1);
     55        aim_putsnac(&fr->data, 0x000a, 0x0002, 0x0000, snacid);
     56       
     57        aimbs_putraw(&fr->data, address, strlen(address));
     58
     59        aim_tx_enqueue(sess, fr);
     60
     61        return 0;
     62}
     63
     64/*
     65 * Subtype 0x0003
     66 *
     67 */
    5768static int reply(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
    5869{
     
    119130        return 0;
    120131}
    121 
    122 
Note: See TracChangeset for help on using the changeset viewer.