From: mid Date: Tue, 27 Mar 2001 00:17:47 +0000 (+0000) Subject: - Mon Mar 26 16:08:45 PST 2001 X-Git-Tag: rel_0_99_2~55 X-Git-Url: http://andersk.mit.edu/gitweb/libfaim.git/commitdiff_plain/69e7980c7d8afb7e06fe4d8f52e12c0f28b5c162 - Mon Mar 26 16:08:45 PST 2001 - Why didn't anyone tell me buddy-offgoing wasn't working? - *** REQUIRES CLIENT CHANGES... buddy-offgoing now passes a userinfo struct (its now identical to buddy-oncoming) Also fixed mfaim..."fix" is a relative term... --- diff --git a/CHANGES b/CHANGES index 2859499..c5fd6ba 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ No release numbers ------------------ + - Mon Mar 26 16:08:45 PST 2001 + - Why didn't anyone tell me buddy-offgoing wasn't working? + - *** REQUIRES CLIENT CHANGES... buddy-offgoing now passes a userinfo + struct (its now identical to buddy-oncoming) + - Mon Mar 26 15:57:41 PST 2001 - Hrmph. - Debuglevel wasn't getting set properly by aim_session_init diff --git a/src/buddylist.c b/src/buddylist.c index 6e3ae9c..2c64a9b 100644 --- a/src/buddylist.c +++ b/src/buddylist.c @@ -7,8 +7,11 @@ * user information structure. Its close enough to run * through aim_extractuserinfo() however. * + * Although the offgoing notification contains no information, + * it is still in a format parsable by extractuserinfo. + * */ -static int oncoming(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen) +static int buddychange(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen) { struct aim_userinfo_s userinfo; rxcallback_t userfunc; @@ -21,24 +24,6 @@ static int oncoming(struct aim_session_t *sess, aim_module_t *mod, struct comman return 0; } -/* - * Offgoing Buddy notifications contain no useful - * information other than the name it applies to. - * - */ -static int offgoing(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen) -{ - char sn[MAXSNLEN+1]; - rxcallback_t userfunc; - - strncpy(sn, (char *)data+1, (int)*data); - - if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) - return userfunc(sess, rx, sn); - - return 0; -} - static int rights(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen) { rxcallback_t userfunc; @@ -80,10 +65,8 @@ static int snachandler(struct aim_session_t *sess, aim_module_t *mod, struct com if (snac->subtype == 0x0003) return rights(sess, mod, rx, snac, data, datalen); - else if (snac->subtype == 0x000b) - return oncoming(sess, mod, rx, snac, data, datalen); - else if (snac->subtype == 0x000c) - return offgoing(sess, mod, rx, snac, data, datalen); + else if ((snac->subtype == 0x000b) || (snac->subtype == 0x000c)) + return buddychange(sess, mod, rx, snac, data, datalen); return 0; } diff --git a/utils/faimtest/faimtest.c b/utils/faimtest/faimtest.c index 2875afc..44276c5 100644 --- a/utils/faimtest/faimtest.c +++ b/utils/faimtest/faimtest.c @@ -1472,15 +1472,25 @@ int faimtest_parse_oncoming(struct aim_session_t *sess, struct command_rx_struct int faimtest_parse_offgoing(struct aim_session_t *sess, struct command_rx_struct *command, ...) { - char *sn; + struct aim_userinfo_s *userinfo; + va_list ap; - va_start(ap, command); - sn = va_arg(ap, char *); + userinfo = va_arg(ap, struct aim_userinfo_s *); va_end(ap); - dvprintf("\n%s has left\n", sn); - + dvprintf("%ld %s is now offline (flags: %04x = %s%s%s%s%s%s%s%s) (caps = 0x%04x)\n", + time(NULL), + userinfo->sn, userinfo->flags, + (userinfo->flags&AIM_FLAG_UNCONFIRMED)?" UNCONFIRMED":"", + (userinfo->flags&AIM_FLAG_ADMINISTRATOR)?" ADMINISTRATOR":"", + (userinfo->flags&AIM_FLAG_AOL)?" AOL":"", + (userinfo->flags&AIM_FLAG_OSCAR_PAY)?" OSCAR_PAY":"", + (userinfo->flags&AIM_FLAG_FREE)?" FREE":"", + (userinfo->flags&AIM_FLAG_AWAY)?" AWAY":"", + (userinfo->flags&AIM_FLAG_UNKNOWN40)?" UNKNOWN40":"", + (userinfo->flags&AIM_FLAG_UNKNOWN80)?" UNKNOWN80":"", + userinfo->capabilities); return 1; }