/**************************************************************************
* cmd_codes.h                                                             *
* Command codes                                                           *
**************************************************************************/


#ifndef _CMD_CODES_H
#define _CMD_CODES_H


/* ICQ client commands */

#define C_ACK                0x000A      /* acknowledgement */
#define C_ACK_MSG            0x0442	     /* Ack message (delete from server) */
#define C_SEND_MESSAGE       0x010E      /* send message to offline user */
#define C_LOGIN              0x03E8      /* login on server */
#define C_CONTACT_LIST       0x0406      /* Inform the server of cont. list */
#define C_SEARCH_UIN         0x041A      /* search for user by UIN */
#define C_SEARCH_USER        0x0424      /* search for user by name/email */
#define C_KEEP_ALIVE         0x042E      /* keep alive */
#define C_SEND_TEXT_CODE     0x0438      /* send special message to server */
#define C_LOGIN_1            0x044C      /* Sent during login */
#define C_INFO_REQ           0x0460      /* Request basic information */
#define C_EXT_INFO_REQ       0x046A      /* Request extended information */
#define C_CHANGE_PASSWORD    0x049C      /* Change the user's password */
#define C_STATUS_CHANGE      0x04D8      /* Change status of user (Away etc.) */
#define C_LOGIN_2            0x0528      /* Sent during Login */
/**/
#define C_UPDATE_INFO        0x050A      /* Update my basic information */
#define C_UPDATE_EXT_INFO    0x04B0      /* Update my extended information */
#define C_ADD_TO_LIST        0x053C      /* Add user to contact list (clist)*/
#define C_REQ_ADD_TO_LIST    0x0456      /* Request auth to add to clist */
#define C_QUERY_STATUS       0x04BA      /* Query about other servers */
#define C_QUERY_ADDONS       0x04C4      /* Query about global add-ons */
#define C_NEW_USER_1         0x04EC      /* Ask for permission to add new usr */
#define C_NEW_USER_REG       0x03FC      /* Register a new user */
#define C_CMD_X1             0x0442      /* Uknown */
#define C_MSG_TO_NEW_USER    0x0456      /* Send a message to not in clist */
/**/
#define C_SEND_URL_MESSAGE   0x04F6      /* Request server advertisement */
#define C_LOGIN_3            0x04CE      /* Sent during login */
#define C_NEW_USER_INFO      0x04A6      /* Send new user's basic information */
#define C_UPDATE_AUTH        0x0514      /* Update my authorization status */
#define C_VIS_LIST           0x06AE      /* Command to use for 'See Me Invisible' */
#define C_INVIS_LIST         0x06A4      /* Command to use for 'Make Me Invisible' */
#define C_META_INFO_REQ      0x064A      /* Request extended extended (META) information */

/* ICQ server commands */

#define S_ACK                0x000A      /* Ack */
#define S_LOGIN_REPLY        0x005A      /* Login reply */
#define S_USER_ONLINE        0x006E      /* user in clist changed status */
#define S_USER_OFFLINE       0x0078      /* user in clist has gone offline */
#define S_USER_FOUND         0x008C      /* user record found matching query */
#define S_RECEIVE_MESSAGE    0x00DC      /* message sent while offline */
#define S_GET_MESSAGE        0x0104	     /* message from user (sent throu server) */
#define S_END_OF_SEARCH      0x00A0      /* No more USER_FOUND will be sent */
#define S_INFO_REPLY         0x0118      /* Return basic information */
#define S_EXT_INFO_REPLY     0x0122      /* Return extended information */
#define S_STATUS_UPDATE      0x01A4      /* User on contact list changed stat */
#define S_GO_AWAY            0x0028	     /* Been idle, logging you out */
/**/
#define S_REPLY_X1           0x021C      /* Unknown (returned during login) */
#define S_END_OFFLINE_MSGS   0x00E6      /* The last offline message has been sent */
#define S_UPDATE_REPLY       0x01E0      /* Confirmation of basic update */
#define S_UPDATE_EXT_REPLY   0x00C8      /* Confirmation of extended update */
#define S_NEW_USER_UIN       0x0046      /* Confirmation of new user with UIN */
#define S_NEW_USER_REPLY     0x00B4      /* Confirmation of new user info */
#define S_QUERY_REPLY        0x0082      /* Response to QUERY_SERVERS or QUERY_ADDONS */
#define S_SYSTEM_MESSAGE     0x01C2      /* System message with URL button */
/**/
#define S_BAD_PASSWORD       0x0064      /* Bad password sent during login */
#define S_UPDATE_AUTH_REPLY  0x01F4      /* Confirmation of Authorization update */
#define S_TOO_BUSY           0x00FA      /* Server is busy try again later */
#define S_TCP_REQUEST        0x015E      /* TCP connection request sent thru server */
#define S_INFO_NOT_FOUND     0x012C      /* User's basic information not found */
#define S_EXT_INFO_NOT_FOUND 0x0136      /* User's extended information not found */

/* Available status codes */

#define STAT_ONLINE          0x00000000
#define STAT_AWAY            0x00000001
#define STAT_DND_2           0x00000003
#define STAT_NA              0x00000005
#define STAT_DND_3           0x00000010
#define STAT_OCCUPIED        0x00000011
#define STAT_DND             0x00000013
#define STAT_FREE_CHAT       0x00000020
#define STAT_INVISIBLE       0x00000100
#define STAT_ONLINE_99       0x00000200
#define STAT_AWAY_99         0x00000201
#define STAT_NA_99           0x00000204
#define STAT_OCCUPIED_99     0x00000210
#define STAT_FREE_CHAT_99    0x00000220
#define STAT_NEWUIN          0x000000FE
#define STAT_OFFLINE         0x0000FFFF

#define STAT_HIDEIP          0x00020000
#define STAT_WEBPRESENCE     0x00010000

/* TCP client to client commands */

/* TCP Message Commands */

#define TCP_CANCEL           0x07D0
#define TCP_ACK              0x07DA
#define TCP_MESSAGE          0x07EE

/* TCP Message Types */

#define TCP_MSG_MSG          0x0001
#define TCP_MSG_CHAT         0x0002
#define TCP_MSG_FILE         0x0003
#define TCP_MSG_URL          0x0004
#define TCP_MSG_ADDUIN       0x0013
#define TCP_MSG_READAWAY     0x03E8
#define TCP_MSG_READOCCUPIED 0x03E9
#define TCP_MSG_READNA       0x03EA
#define TCP_MSG_READDND      0x03EB
#define TCP_MSG_READFFC      0x03EC
#define TCP_MSG_UNK_2        0x0802

/* TCP Message Command Types */

#define TCP_MSG_INVISIBLE    0x0090
#define TCP_MSG_UNK_1        0x00A0
#define TCP_MSG_AWAY         0x0110
#define TCP_MSG_UNK_3        0x0120
#define TCP_MSG_UNK_4        0x0140
#define TCP_MSG_OCCUPIED     0x0210
#define TCP_MSG_NA           0x0810
#define TCP_MSG_NA_2         0x0820
#define TCP_MSG_DND          0x1010

/* TCP Message Status' */

#define TCP_STAT_ONLINE      0x0000
#define TCP_STAT_REFUSE      0x0001
#define TCP_STAT_AWAY        0x0004
#define TCP_STAT_OCCUPIED    0x0009
#define TCP_STAT_DND         0x000A
#define TCP_STAT_NA          0x000E
#define TCP_STAT_FREE_CHAT   TCP_STAT_ONLINE
#define TCP_STAT_INVISIBLE   TCP_STAT_ONLINE

#endif
