14192
|
1 /**
|
|
2 * The QQ2003C protocol plugin
|
|
3 *
|
|
4 * for gaim
|
|
5 *
|
|
6 * Copyright (C) 2004 Puzzlebird
|
|
7 *
|
|
8 * This program is free software; you can redistribute it and/or modify
|
|
9 * it under the terms of the GNU General Public License as published by
|
|
10 * the Free Software Foundation; either version 2 of the License, or
|
|
11 * (at your option) any later version.
|
|
12 *
|
|
13 * This program is distributed in the hope that it will be useful,
|
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 * GNU General Public License for more details.
|
|
17 *
|
|
18 * You should have received a copy of the GNU General Public License
|
|
19 * along with this program; if not, write to the Free Software
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
21 */
|
|
22
|
|
23 #ifndef _QQ_QQ_H_
|
|
24 #define _QQ_QQ_H_
|
|
25
|
|
26 #include <glib.h>
|
|
27 #include "ft.h"
|
|
28 #include "internal.h"
|
|
29 #include "proxy.h"
|
|
30 #include "roomlist.h"
|
|
31
|
|
32 #define QQ_KEY_LENGTH 16
|
|
33 #define QQ_DEBUG 1 /* whether we are doing DEBUG */
|
|
34
|
|
35 typedef struct _qq_data qq_data;
|
|
36 typedef struct _qq_buddy qq_buddy;
|
|
37
|
|
38 struct _qq_buddy {
|
|
39 guint32 uid;
|
|
40 guint8 icon; /* index: 01 - 85 */
|
|
41 guint8 age;
|
|
42 guint8 gender;
|
|
43 gchar *nickname;
|
|
44 guint8 ip[4];
|
|
45 guint16 port;
|
|
46 guint8 status;
|
|
47 guint8 flag1;
|
|
48 guint8 comm_flag; /* details in qq_buddy_list.c */
|
|
49 guint16 client_version;
|
|
50 time_t signon;
|
|
51 time_t idle;
|
|
52 time_t last_refresh;
|
|
53
|
|
54 gint8 role; /* role in group, used only in group->members list */
|
|
55 };
|
|
56
|
|
57 struct _qq_data {
|
|
58 gint fd; /* socket file handler */
|
|
59 guint32 uid; /* QQ number */
|
|
60 guint8 *inikey; /* initial key to encrypt login packet */
|
|
61 guint8 *pwkey; /* password in md5 (or md5' md5) */
|
|
62 guint8 *session_key; /* later use this as key in this session */
|
|
63
|
|
64 guint16 send_seq; /* send sequence number */
|
|
65 guint8 login_mode; /* online of invisible */
|
|
66 guint8 status;
|
|
67 gboolean logged_in; /* used by qq-add_buddy */
|
|
68 gboolean use_tcp; /* network in tcp or udp */
|
|
69
|
|
70 GaimProxyType proxy_type; /* proxy type */
|
|
71 GaimXfer *xfer; /* file transfer handler */
|
|
72 struct sockaddr_in dest_sin;
|
|
73
|
|
74 /* from real connction */
|
|
75 gchar *server_ip;
|
|
76 guint16 server_port;
|
|
77 /* get from login reply packet */
|
|
78 time_t login_time;
|
|
79 time_t last_login_time;
|
|
80 gchar *last_login_ip;
|
|
81 /* get from keep_alive packet */
|
|
82 gchar *my_ip; /* my ip address detected by server */
|
|
83 guint16 my_port; /* my port detected by server */
|
|
84 guint8 my_icon; /* my icon index */
|
|
85 guint32 all_online; /* the number of online QQ users */
|
|
86 time_t last_get_online; /* last time send get_friends_online packet */
|
|
87
|
|
88 guint8 window[1 << 13]; /* check up for duplicated packet */
|
|
89 gint sendqueue_timeout;
|
|
90
|
|
91 GaimRoomlist *roomlist;
|
|
92 gint channel; /* the id for opened chat conversation */
|
|
93
|
|
94 GList *groups;
|
|
95 GList *group_packets;
|
|
96 GList *buddies;
|
|
97 GList *contact_info_window;
|
|
98 GList *qun_info_window;
|
|
99 GList *sendqueue;
|
|
100 GList *info_query;
|
|
101 GList *add_buddy_request;
|
|
102 GQueue *before_login_packets;
|
|
103
|
|
104 gboolean modifying_info;
|
|
105 };
|
|
106
|
|
107 void qq_function_not_implemented(GaimConnection *gc);
|
|
108
|
|
109 #endif
|