+ if (!sess || !conn || !sn)
+ return -1;
+
+ /*
+ * For ICQ, we enable the ancient horrible login and stuff
+ * a key packet into the queue to make it look like we got
+ * a reply back. This is so the client doesn't know we're
+ * really not doing MD5 login.
+ *
+ * This may sound stupid, but I'm not in the best of moods and
+ * I don't plan to keep support for this crap around much longer.
+ * Its all AOL's fault anyway, really. I hate AOL. Really. They
+ * always seem to be able to piss me off by doing the dumbest little
+ * things. Like disabling MD5 logins for ICQ UINs, or adding purposefully
+ * wrong TLV lengths, or adding superfluous information to host strings,
+ * or... I'll stop.
+ *
+ */
+ if ((sn[0] >= '0') && (sn[0] <= '9')) {
+ struct command_rx_struct *newrx;
+ int i;
+
+ if (!(newrx = (struct command_rx_struct *)malloc(sizeof(struct command_rx_struct))))
+ return -1;
+ memset(newrx, 0x00, sizeof(struct command_rx_struct));
+ newrx->lock = 1;
+ newrx->hdrtype = AIM_FRAMETYPE_OSCAR;
+ newrx->hdr.oscar.type = 0x02;
+ newrx->hdr.oscar.seqnum = 0;
+ newrx->commandlen = 10+2+1;
+ newrx->nofree = 0;
+ if (!(newrx->data = malloc(newrx->commandlen))) {
+ free(newrx);
+ return -1;
+ }
+
+ i = aim_putsnac(newrx->data, 0x0017, 0x0007, 0x0000, 0x0000);
+ i += aimutil_put16(newrx->data+i, 0x01);
+ i += aimutil_putstr(newrx->data+i, "0", 1);
+
+ newrx->conn = conn;
+
+ newrx->next = sess->queue_incoming;
+ sess->queue_incoming = newrx;
+
+ newrx->lock = 0;
+
+ sess->snaclogin = 0;
+ return 0;
+ }
+
+ sess->snaclogin = 1;
+
+ aim_sendconnack(sess, conn);
+