]> andersk Git - libfaim.git/commitdiff
- Fri Dec 15 21:51:32 UTC 2000
authormid <mid>
Fri, 15 Dec 2000 21:55:39 +0000 (21:55 +0000)
committermid <mid>
Fri, 15 Dec 2000 21:55:39 +0000 (21:55 +0000)
  - Add more info to evilnotify callback
  - Add a few values to aim_cbtypes.h

CHANGES
aim_rxhandlers.c
faim/aim_cbtypes.h
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index 53311f4aac1d44f54863a663c5b5c77109e1c317..bda46f4c9301aad506ab33dbdcc8f962fd89b45a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
 
 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
index c0a8c72d06aca1c7f35004a308ccbdc697cf5223..076f99bb0b1ad4778baa7f1e58f843aacf7dc073 100644 (file)
@@ -700,25 +700,22 @@ faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct
 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;
 }
 
index c0705ba9b037dbe10b8bc724acc4a0337a08cd1b..a18be3f645943bcd2ca3117a74ca22fd31f09cee 100644 (file)
  * 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
 
 /*
index 5370a492bae241026641664858685f28ecb4b24b..fc0acaf2109350794986bd3f75250d6db45d99e2 100644 (file)
@@ -1621,6 +1621,7 @@ int faimtest_parse_ratechange(struct aim_session_t *sess, struct command_rx_stru
 
   /*
    * Known parameter ID's...
+   *   0x0001  Warnings
    *   0x0003  BOS (normal ICBMs, userinfo requests, etc)
    *   0x0005  Chat messages
    */
@@ -1690,13 +1691,23 @@ int faimtest_parse_ratechange(struct aim_session_t *sess, struct command_rx_stru
 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;
 }
This page took 0.091581 seconds and 5 git commands to generate.