| 493 { |
493 { |
| 494 return aim_genericreq_n(sess, conn, 0x0003, 0x0002); |
494 return aim_genericreq_n(sess, conn, 0x0003, 0x0002); |
| 495 } |
495 } |
| 496 |
496 |
| 497 /* |
497 /* |
| 498 * aim_send_warning(struct aim_session_t *sess, |
498 * Send a warning to destsn. |
| 499 * struct aim_conn_t *conn, char *destsn, int anon) |
499 * |
| 500 * send a warning to destsn. |
500 * Flags: |
| 501 * anon is anonymous or not; |
501 * AIM_WARN_ANON Send as an anonymous (doesn't count as much) |
| 502 * AIM_WARN_ANON anonymous |
502 * |
| 503 * |
503 * returns -1 on error (couldn't alloc packet), 0 on success. |
| 504 * returns -1 on error (couldn't alloc packet), next snacid on success. |
504 * |
| 505 * |
505 */ |
| 506 */ |
506 faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, const char *destsn, unsigned long flags) |
| 507 faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon) |
507 { |
| 508 { |
508 struct command_tx_struct *newpacket; |
| 509 struct command_tx_struct *newpacket; |
509 int curbyte; |
| 510 int curbyte; |
510 unsigned short outflags = 0x0000; |
| 511 |
511 |
| 512 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, strlen(destsn)+13))) |
512 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, |
| 513 return -1; |
513 strlen(destsn)+13))) |
| 514 |
514 return -1; |
| 515 newpacket->lock = 1; |
515 |
| 516 |
516 newpacket->lock = 1; |
| 517 curbyte = 0; |
517 |
| 518 curbyte += aim_putsnac(newpacket->data+curbyte, |
518 curbyte = 0; |
| 519 0x0004, 0x0008, 0x0000, sess->snac_nextid); |
519 curbyte += aim_putsnac(newpacket->data+curbyte, |
| 520 |
520 0x0004, 0x0008, 0x0000, sess->snac_nextid); |
| 521 curbyte += aimutil_put16(newpacket->data+curbyte, (anon & AIM_WARN_ANON)?1:0); |
521 |
| 522 |
522 if (flags & AIM_WARN_ANON) |
| 523 curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn)); |
523 outflags |= 0x0001; |
| 524 |
524 |
| 525 curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn)); |
525 curbyte += aimutil_put16(newpacket->data+curbyte, outflags); |
| 526 |
526 curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn)); |
| 527 newpacket->commandlen = curbyte; |
527 curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn)); |
| 528 newpacket->lock = 0; |
528 |
| 529 |
529 newpacket->commandlen = curbyte; |
| 530 aim_tx_enqueue(sess, newpacket); |
530 newpacket->lock = 0; |
| 531 |
531 |
| 532 return (sess->snac_nextid++); |
532 aim_tx_enqueue(sess, newpacket); |
| |
533 |
| |
534 aim_cachesnac(sess, 0x0004, 0x0008, 0x0000, destsn, strlen(destsn)+1); |
| |
535 |
| |
536 return 0; |
| 533 } |
537 } |
| 534 |
538 |
| 535 /* |
539 /* |
| 536 * aim_debugconn_sendconnect() |
540 * aim_debugconn_sendconnect() |
| 537 * |
541 * |