- newpacket.data = (u_char *) calloc (1, newpacket.commandlen );
- newpacket.lock = 1;
- newpacket.type = 0x02;
-
- curbyte = aim_putsnac(newpacket.data+curbyte, 0x0017, 0x0002, 0x0000, 0x00010000);
- curbyte+= aim_puttlv_str(newpacket.data+curbyte, 0x0001, strlen(sn), sn);
- password_encoded = (u_char *) malloc(strlen(password));
- aim_encode_password(password, password_encoded);
- curbyte+= aim_puttlv_str(newpacket.data+curbyte, 0x0002, strlen(password), password_encoded);
- curbyte+= aim_puttlv_str(newpacket.data+curbyte, 0x0003,
- strlen(clientinfo->clientstring),
- clientinfo->clientstring);
- /* XXX: should use clientinfo provided version info */
- curbyte+= aim_puttlv_16(newpacket.data+curbyte, 0x0016, 0x0004);
- curbyte+= aim_puttlv_16(newpacket.data+curbyte, 0x0017, 0x0003);
- curbyte+= aim_puttlv_16(newpacket.data+curbyte, 0x0018, 0x0005);
- curbyte+= aim_puttlv_16(newpacket.data+curbyte, 0x0019, 0x0000);
- curbyte+= aim_puttlv_16(newpacket.data+curbyte, 0x001a, 0x0686);
- curbyte+= aim_puttlv_str(newpacket.data+curbyte, 0x0001, 0x0002, clientinfo->country);
- curbyte+= aim_puttlv_str(newpacket.data+curbyte, 0x0001, 0x0002, clientinfo->lang);
- curbyte+= aim_puttlv_32(newpacket.data+curbyte, 0x0014, 0x0000002a);
- curbyte+= aim_puttlv_16(newpacket.data+curbyte, 0x0009, 0x0015);
-#else
+ if (sess->flags & AIM_SESS_FLAGS_SNACLOGIN)
+ curbyte = aim_putsnac(newpacket->data, 0x0017, 0x0002, 0x0000, 0x00010000);
+ else {
+ curbyte = aimutil_put16(newpacket->data, 0x0000);
+ curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
+ }
+
+ curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x0001, strlen(sn), sn);