]> andersk Git - libfaim.git/blobdiff - aim_rxhandlers.c
- Thu Aug 31 23:40:23 UTC 2000
[libfaim.git] / aim_rxhandlers.c
index 2a71d3739297509fe4763848ef10129d54eba45b..aaeba3ba98c9da2fbcb150789bd1f3c0cb40301e 100644 (file)
@@ -352,35 +352,31 @@ int aim_rxdispatch(struct aim_session_t *sess)
          
          switch (family) {
            /* New login protocol */
-#ifdef SNACLOGIN
          case 0x0017:
            if (subtype == 0x0001)
              workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0001, workingPtr);
            else if (subtype == 0x0003)
              workingPtr->handled = aim_authparse(sess, workingPtr);
            else if (subtype == 0x0007)
-             workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0007, workingPtr);
+             workingPtr->handled = aim_authkeyparse(sess, workingPtr);
            else
              workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
            break;
-#else  
-           /* XXX: this isnt foolproof */
-         case 0x0001:
-           workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_GEN, AIM_CB_GEN_SERVERREADY, workingPtr);
-           break;
-         case 0x0007:
-           if (subtype == 0x0005)
-             workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_ADM, AIM_CB_ADM_INFOCHANGE_REPLY, workingPtr);
+         case 0x0007:
+           if (subtype == 0x0005)
+             workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_ADM, AIM_CB_ADM_INFOCHANGE_REPLY, workingPtr);
+           break;
+         case AIM_CB_FAM_SPECIAL:
+           if (subtype == AIM_CB_SPECIAL_DEBUGCONN_CONNECT) {
+             workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
+             break;
+           } /* others fall through */
+         default:
+#if 0
+           /* Old login protocol */
+           /* any user callbacks will be called from here */
+           workingPtr->handled = aim_authparse(sess, workingPtr);
            break;
-         case AIM_CB_FAM_SPECIAL:
-           if (subtype == AIM_CB_SPECIAL_DEBUGCONN_CONNECT) {
-             workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
-             break;
-           } /* others fall through */
-         default:
-           /* Old login protocol */
-           /* any user callbacks will be called from here */
-           workingPtr->handled = aim_authparse(sess, workingPtr);
 #endif
          }
        }
@@ -425,6 +421,9 @@ int aim_rxdispatch(struct aim_session_t *sess)
          case 0x000f:
            workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x000f, workingPtr);
            break;
+         case 0x0010:
+           workingPtr->handled = aim_parse_evilnotify_middle(sess, workingPtr);
+           break;
          case 0x0013:
            workingPtr->handled = aim_parsemotd_middle(sess, workingPtr);
            break;
@@ -655,6 +654,31 @@ int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_st
   return ret;
 }
 
+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;
+
+  if(!(sn = (char *)calloc(1, pos+1)))
+    return 1;
+
+  memcpy(sn, command->data+13, pos);
+
+  if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0010)))
+    ret = userfunc(sess, command, sn);
+  
+  free(sn);
+
+  return ret;
+}
+
 int aim_parsemotd_middle(struct aim_session_t *sess,
                         struct command_rx_struct *command, ...)
 {
@@ -665,7 +689,14 @@ int aim_parsemotd_middle(struct aim_session_t *sess,
   u_short id;
 
   /*
-   * Dunno.
+   * Code.
+   *
+   * Valid values:
+   *   1 Mandatory upgrade
+   *   2 Advisory upgrade
+   *   3 System bulletin
+   *   4 Nothing's wrong ("top o the world" -- normal)
+   *
    */
   id = aimutil_get16(command->data+10);
 
This page took 0.184147 seconds and 4 git commands to generate.