| |
1 /** |
| |
2 * @file qq_define.h |
| |
3 * |
| |
4 * purple |
| |
5 * |
| |
6 * Purple is the legal property of its developers, whose names are too numerous |
| |
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
| |
8 * source distribution. |
| |
9 * |
| |
10 * This program is free software; you can redistribute it and/or modify |
| |
11 * it under the terms of the GNU General Public License as published by |
| |
12 * the Free Software Foundation; either version 2 of the License, or |
| |
13 * (at your option) any later version. |
| |
14 * |
| |
15 * This program is distributed in the hope that it will be useful, |
| |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
18 * GNU General Public License for more details. |
| |
19 * |
| |
20 * You should have received a copy of the GNU General Public License |
| |
21 * along with this program; if not, write to the Free Software |
| |
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| |
23 */ |
| |
24 |
| |
25 #ifndef _QQ_HEADER_INFO_H_ |
| |
26 #define _QQ_HEADER_INFO_H_ |
| |
27 |
| |
28 #include <glib.h> |
| |
29 |
| |
30 #define QQ_UDP_HEADER_LENGTH 7 |
| |
31 #define QQ_TCP_HEADER_LENGTH 9 |
| |
32 |
| |
33 #define QQ_PACKET_TAG 0x02 /* all QQ text packets starts with it */ |
| |
34 #define QQ_PACKET_TAIL 0x03 /* all QQ text packets end with it */ |
| |
35 |
| |
36 #define QQ_CLIENT_0D55 0x0d55 /* QQ2005 used by openq before */ |
| |
37 #define QQ_CLIENT_111D 0x111D /* QQ2007 */ |
| |
38 #define QQ_CLIENT_115B 0x115B /* QQ2008 He Sui*/ |
| |
39 |
| |
40 const gchar *qq_get_ver_desc(gint source); |
| |
41 |
| |
42 /* list of known QQ commands */ |
| |
43 enum { |
| |
44 QQ_CMD_LOGOUT = 0x0001, /* log out */ |
| |
45 QQ_CMD_KEEP_ALIVE = 0x0002, /* get onlines from tencent */ |
| |
46 QQ_CMD_UPDATE_INFO = 0x0004, /* update information */ |
| |
47 QQ_CMD_SEARCH_USER = 0x0005, /* search for user */ |
| |
48 QQ_CMD_GET_BUDDY_INFO = 0x0006, /* get user information */ |
| |
49 QQ_CMD_ADD_BUDDY_NO_AUTH = 0x0009, /* add buddy without auth */ |
| |
50 QQ_CMD_REMOVE_BUDDY = 0x000a, /* delete a buddy */ |
| |
51 QQ_CMD_ADD_BUDDY_AUTH = 0x000b, /* buddy authentication */ |
| |
52 QQ_CMD_CHANGE_STATUS = 0x000d, /* change my online status */ |
| |
53 QQ_CMD_ACK_SYS_MSG = 0x0012, /* ack system message */ |
| |
54 QQ_CMD_SEND_IM = 0x0016, /* send message */ |
| |
55 QQ_CMD_RECV_IM = 0x0017, /* receive message */ |
| |
56 QQ_CMD_REMOVE_ME = 0x001c, /* remove self */ |
| |
57 QQ_CMD_REQUEST_KEY = 0x001d, /* request key for file transfer */ |
| |
58 QQ_CMD_CELL_PHONE_1 = 0x0021, /* cell phone 1 */ |
| |
59 QQ_CMD_LOGIN = 0x0022, /* login */ |
| |
60 QQ_CMD_GET_BUDDIES_LIST = 0x0026, /* get buddies list */ |
| |
61 QQ_CMD_GET_BUDDIES_ONLINE = 0x0027, /* get online buddies list */ |
| |
62 QQ_CMD_CELL_PHONE_2 = 0x0029, /* cell phone 2 */ |
| |
63 QQ_CMD_ROOM = 0x0030, /* room command */ |
| |
64 QQ_CMD_GET_BUDDIES_AND_ROOMS = 0x0058, |
| |
65 QQ_CMD_GET_LEVEL = 0x005C, /* get level for one or more buddies */ |
| |
66 QQ_CMD_TOKEN = 0x0062, /* get login token */ |
| |
67 QQ_CMD_RECV_MSG_SYS = 0x0080, /* receive a system message */ |
| |
68 QQ_CMD_BUDDY_CHANGE_STATUS = 0x0081, /* buddy change status */ |
| |
69 /* for QQ2007*/ |
| |
70 QQ_CMD_GET_SERVER = 0x0091, /* select login server */ |
| |
71 QQ_CMD_TOKEN_EX = 0x00BA, /* get LOGIN token */ |
| |
72 QQ_CMD_CHECK_PWD = 0x00DD, /* Password verify */ |
| |
73 QQ_CMD_AUTH_CODE = 0x00AE, /* the request verification of information */ |
| |
74 QQ_CMD_ADD_BUDDY_NO_AUTH_EX = 0x00A7, /* add friend without auth */ |
| |
75 QQ_CMD_ADD_BUDDY_AUTH_EX = 0x00A8, /* add buddy with auth */ |
| |
76 QQ_CMD_BUDDY_CHECK_CODE = 0x00B5, |
| |
77 QQ_CMD_BUDDY_QUESTION = 0x00B7, |
| |
78 }; |
| |
79 |
| |
80 const gchar *qq_get_cmd_desc(gint type); |
| |
81 |
| |
82 enum { |
| |
83 QQ_ROOM_CMD_CREATE = 0x01, |
| |
84 QQ_ROOM_CMD_MEMBER_OPT = 0x02, |
| |
85 QQ_ROOM_CMD_CHANGE_INFO = 0x03, |
| |
86 QQ_ROOM_CMD_GET_INFO = 0x04, |
| |
87 QQ_ROOM_CMD_ACTIVATE = 0x05, |
| |
88 QQ_ROOM_CMD_SEARCH = 0x06, |
| |
89 QQ_ROOM_CMD_JOIN = 0x07, |
| |
90 QQ_ROOM_CMD_AUTH = 0x08, |
| |
91 QQ_ROOM_CMD_QUIT = 0x09, |
| |
92 QQ_ROOM_CMD_SEND_MSG = 0x0a, |
| |
93 QQ_ROOM_CMD_GET_ONLINES = 0x0b, |
| |
94 QQ_ROOM_CMD_GET_BUDDIES = 0x0c, |
| |
95 |
| |
96 QQ_ROOM_CMD_CHANGE_CARD = 0x0E, |
| |
97 QQ_ROOM_CMD_GET_REALNAMES = 0x0F, |
| |
98 QQ_ROOM_CMD_GET_CARD = 0x10, |
| |
99 QQ_ROOM_CMD_SEND_IM_EX = 0x1A, |
| |
100 QQ_ROOM_CMD_ADMIN = 0x1B, |
| |
101 QQ_ROOM_CMD_TRANSFER = 0x1C, |
| |
102 QQ_ROOM_CMD_TEMP_CREATE = 0x30, |
| |
103 QQ_ROOM_CMD_TEMP_CHANGE_MEMBER = 0x31, |
| |
104 QQ_ROOM_CMD_TEMP_QUIT = 0x32, |
| |
105 QQ_ROOM_CMD_TEMP_GET_INFO = 0x33, |
| |
106 QQ_ROOM_CMD_TEMP_SEND_IM = 0x35, |
| |
107 QQ_ROOM_CMD_TEMP_GET_MEMBERS = 0x37, |
| |
108 }; |
| |
109 |
| |
110 const gchar *qq_get_room_cmd_desc(gint room_cmd); |
| |
111 |
| |
112 enum { |
| |
113 QQ_SERVER_BUDDY_ADDED = 1, |
| |
114 QQ_SERVER_BUDDY_ADD_REQUEST = 2, |
| |
115 QQ_SERVER_BUDDY_ADDED_ME = 3, |
| |
116 QQ_SERVER_BUDDY_REJECTED_ME = 4, |
| |
117 QQ_SERVER_NOTICE= 6, |
| |
118 QQ_SERVER_NEW_CLIENT = 9, |
| |
119 QQ_SERVER_BUDDY_ADDING_EX = 40, |
| |
120 QQ_SERVER_BUDDY_ADD_REQUEST_EX = 41, |
| |
121 QQ_SERVER_BUDDY_ADDED_ANSWER = 42, |
| |
122 QQ_SERVER_BUDDY_ADDED_EX = 43, |
| |
123 }; |
| |
124 |
| |
125 enum { |
| |
126 QQ_BUDDY_OFFLINE = 0x00, |
| |
127 QQ_BUDDY_ONLINE_NORMAL = 10, |
| |
128 QQ_BUDDY_CHANGE_TO_OFFLINE = 20, |
| |
129 QQ_BUDDY_ONLINE_AWAY = 30, |
| |
130 QQ_BUDDY_ONLINE_INVISIBLE = 40, |
| |
131 QQ_BUDDY_ONLINE_BUSY = 50, |
| |
132 }; |
| |
133 |
| |
134 gboolean is_online(guint8 status); |
| |
135 |
| |
136 #endif |