No release numbers
------------------
+ - Fri Dec 15 21:51:32 UTC 2000
+ - Add more info to evilnotify callback
+ - Add a few values to aim_cbtypes.h
+
- Fri Dec 15 20:41:15 UTC 2000
- Revise README
- Make aimdebugd compile
faim_internal int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command)
{
rxcallback_t userfunc = NULL;
- int ret = 1, pos;
- char *sn = NULL;
-
- if(command->commandlen < 12) /* a warning level dec sends this */
- return 1;
-
- if ((pos = aimutil_get8(command->data+ 12)) > MAXSNLEN)
- return 1;
+ int ret = 1;
+ int i;
+ unsigned short newevil;
+ struct aim_userinfo_s userinfo;
- if(!(sn = (char *)calloc(1, pos+1)))
- return 1;
+ i = 10;
+ newevil = aimutil_get16(command->data+10);
+ i += 2;
- memcpy(sn, command->data+13, pos);
+ memset(&userinfo, 0, sizeof(struct aim_userinfo_s));
+ if (command->commandlen-i)
+ i += aim_extractuserinfo(command->data+i, &userinfo);
if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0010)))
- ret = userfunc(sess, command, sn);
+ ret = userfunc(sess, command, newevil, &userinfo);
- free(sn);
-
return ret;
}
* SNAC Family: Misc BOS Services.
*/
#define AIM_CB_BOS_ERROR 0x0001
+#define AIM_CB_BOS_RIGHTSQUERY 0x0002
+#define AIM_CB_BOS_RIGHTS 0x0003
#define AIM_CB_BOS_DEFAULT 0xffff
/*
/*
* Known parameter ID's...
+ * 0x0001 Warnings
* 0x0003 BOS (normal ICBMs, userinfo requests, etc)
* 0x0005 Chat messages
*/
int faimtest_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...)
{
va_list ap;
- char *sn;
+ int newevil;
+ struct aim_userinfo_s *userinfo;
va_start(ap, command);
- sn = va_arg(ap, char *);
+ newevil = va_arg(ap, int);
+ userinfo = va_arg(ap, struct aim_userinfo_s *);
va_end(ap);
- printf("faimtest: warning from: %s\n", sn);
+ /*
+ * Evil Notifications that are lacking userinfo->sn are anon-warns
+ * if they are an evil increases, but are not warnings at all if its
+ * a decrease (its the natural backoff happening).
+ *
+ * newevil is passed as an int representing the new evil value times
+ * ten.
+ */
+ printf("faimtest: evil level change: new value = %2.1f%% (caused by %s)\n", ((float)newevil)/10, (userinfo && strlen(userinfo->sn))?userinfo->sn:"anonymous");
return 1;
}