From 3b065cb082debe08dcb71be6b5521f5be5aefe4f Mon Sep 17 00:00:00 2001 From: mid Date: Fri, 3 Aug 2001 00:33:50 +0000 Subject: [PATCH] - Thu Aug 2 13:28:37 EDT 2001 - Uhm. Why does arcanejill think its in EDT? - Cache the username on warnings so errors work right. - Someday, I'm going to convert all of libfaim to that formatting style, too. --- CHANGES | 5 +++++ include/aim.h | 2 +- src/misc.c | 48 ++++++++++++++++++++++++++---------------------- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index 9c53474..ac1054c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ No release numbers ------------------ + - Thu Aug 2 13:28:37 EDT 2001 + - Uhm. Why does arcanejill think its in EDT? + - Cache the username on warnings so errors work right. + - Someday, I'm going to convert all of libfaim to that formatting style, too. + - Wed Jun 27 00:13:20 EDT 2001 - Some comments about UNICODE in faimtest. diff --git a/include/aim.h b/include/aim.h index e7a2440..b29cf65 100644 --- a/include/aim.h +++ b/include/aim.h @@ -546,7 +546,7 @@ faim_export struct aim_conn_t *aim_getconn_fd(struct aim_session_t *, int fd); #define AIM_WARN_ANON 0x01 -faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon); +faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, const char *destsn, unsigned long flags); faim_export unsigned long aim_bos_nop(struct aim_session_t *, struct aim_conn_t *); faim_export unsigned long aim_flap_nop(struct aim_session_t *sess, struct aim_conn_t *conn); faim_export unsigned long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long); diff --git a/src/misc.c b/src/misc.c index 0da3d0d..dcb9780 100644 --- a/src/misc.c +++ b/src/misc.c @@ -495,41 +495,45 @@ faim_export unsigned long aim_bos_reqbuddyrights(struct aim_session_t *sess, } /* - * aim_send_warning(struct aim_session_t *sess, - * struct aim_conn_t *conn, char *destsn, int anon) - * send a warning to destsn. - * anon is anonymous or not; - * AIM_WARN_ANON anonymous + * Send a warning to destsn. + * + * Flags: + * AIM_WARN_ANON Send as an anonymous (doesn't count as much) * - * returns -1 on error (couldn't alloc packet), next snacid on success. + * returns -1 on error (couldn't alloc packet), 0 on success. * */ -faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon) +faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, const char *destsn, unsigned long flags) { - struct command_tx_struct *newpacket; - int curbyte; + struct command_tx_struct *newpacket; + int curbyte; + unsigned short outflags = 0x0000; - if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, strlen(destsn)+13))) - return -1; + if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, + strlen(destsn)+13))) + return -1; - newpacket->lock = 1; + newpacket->lock = 1; - curbyte = 0; - curbyte += aim_putsnac(newpacket->data+curbyte, - 0x0004, 0x0008, 0x0000, sess->snac_nextid); + curbyte = 0; + curbyte += aim_putsnac(newpacket->data+curbyte, + 0x0004, 0x0008, 0x0000, sess->snac_nextid); - curbyte += aimutil_put16(newpacket->data+curbyte, (anon & AIM_WARN_ANON)?1:0); + if (flags & AIM_WARN_ANON) + outflags |= 0x0001; - curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn)); + curbyte += aimutil_put16(newpacket->data+curbyte, outflags); + curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn)); + curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn)); - curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn)); + newpacket->commandlen = curbyte; + newpacket->lock = 0; - newpacket->commandlen = curbyte; - newpacket->lock = 0; + aim_tx_enqueue(sess, newpacket); - aim_tx_enqueue(sess, newpacket); + aim_cachesnac(sess, 0x0004, 0x0008, 0x0000, destsn, strlen(destsn)+1); - return (sess->snac_nextid++); + return 0; } /* -- 2.45.1