view libfaim/aim_search.c @ 243:3414ff74cb0f

[gaim-migrate @ 253] Sat May 20 09:56:16 UTC 2000 EWarmenhoven - That 2 second delay in updates is gone, and I think it's actually faster than the TOC code now. - I figured out why it was segfaulting. I'm stupid sometimes. - I figured out why the idle times were appearing bizarrely. Once again, I'm stupid sometimes. - You can now be idle - You can now get a user's info (sort of - use the debug window) (still no away messages though....) - You can now be away - You can now set your info (but not your dir info - yet) - I think it's almost at a point where it's ready for use. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 20 May 2000 10:03:16 +0000
parents 6ced2f1c8b24
children 0f14e6d8a51b
line wrap: on
line source


/*
 * aim_search.c
 *
 * TODO: Add aim_usersearch_name()
 *
 */

#include <aim.h>

u_long aim_usersearch_address(struct aim_session_t *sess,
			      struct aim_conn_t *conn, 
			      char *address)
{
  struct command_tx_struct *newpacket;
  
  if (!address)
    return -1;

  if (!(newpacket = aim_tx_new(0x0002, conn, 10+strlen(address))))
    return -1;

  newpacket->lock = 1;

  aim_putsnac(newpacket->data, 0x000a, 0x0002, 0x0000, sess->snac_nextid);

  aimutil_putstr(newpacket->data+10, address, strlen(address));

  aim_tx_enqueue(sess, newpacket);

  {
    struct aim_snac_t snac;
    
    snac.id = sess->snac_nextid;
    snac.family = 0x000a;
    snac.type = 0x0002;
    snac.flags = 0x0000;

    snac.data = malloc(strlen(address)+1);
    memcpy(snac.data, address, strlen(address)+1);

    aim_newsnac(sess, &snac);
  }

  return (sess->snac_nextid++);
}