view libfaim/aim_search.c @ 412:ad08e67ec874

[gaim-migrate @ 422] A woman went to her doctor for advice. She told him that her husband had developed a penchant for anal sex, and she was not sure that it was such a good idea. The doctor asked, "Do you enjoy it?" She said that she did. He asked, "Does it hurt you?" She said that it didn't. The doctor then told her, "Well, then, there's no reason that you shouldn't practice anal sex, if that's what you like, so long as you take care not to get pregnant." The woman was mystified. She asked "You can get pregnant from anal sex?" The doctor replied, "Of course. Where do you think attorneys come from?" committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 16 Jun 2000 09:29:36 +0000
parents 0f14e6d8a51b
children e4c34ca88d9b
line wrap: on
line source


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

#include <faim/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++);
}