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
|
14265
|
32 #define QQ_FACES 100
|
14192
|
33 #define QQ_KEY_LENGTH 16
|
|
34 #define QQ_DEBUG 1 /* whether we are doing DEBUG */
|
|
35
|
|
36 typedef struct _qq_data qq_data;
|
|
37 typedef struct _qq_buddy qq_buddy;
|
|
38
|
|
39 struct _qq_buddy {
|
|
40 guint32 uid;
|
14265
|
41 guint16 icon; /* index: 01 - 85 */
|
14192
|
42 guint8 age;
|
|
43 guint8 gender;
|
|
44 gchar *nickname;
|
|
45 guint8 ip[4];
|
|
46 guint16 port;
|
|
47 guint8 status;
|
|
48 guint8 flag1;
|
|
49 guint8 comm_flag; /* details in qq_buddy_list.c */
|
|
50 guint16 client_version;
|
|
51 time_t signon;
|
|
52 time_t idle;
|
|
53 time_t last_refresh;
|
|
54
|
|
55 gint8 role; /* role in group, used only in group->members list */
|
|
56 };
|
|
57
|
|
58 struct _qq_data {
|
|
59 gint fd; /* socket file handler */
|
|
60 guint32 uid; /* QQ number */
|
|
61 guint8 *inikey; /* initial key to encrypt login packet */
|
|
62 guint8 *pwkey; /* password in md5 (or md5' md5) */
|
|
63 guint8 *session_key; /* later use this as key in this session */
|
|
64
|
|
65 guint16 send_seq; /* send sequence number */
|
|
66 guint8 login_mode; /* online of invisible */
|
|
67 gboolean logged_in; /* used by qq-add_buddy */
|
|
68 gboolean use_tcp; /* network in tcp or udp */
|
|
69
|
14195
|
70 GaimProxyType proxy_type;
|
|
71 GaimConnection *gc;
|
|
72
|
14192
|
73 GaimXfer *xfer; /* file transfer handler */
|
|
74 struct sockaddr_in dest_sin;
|
|
75
|
|
76 /* from real connction */
|
|
77 gchar *server_ip;
|
|
78 guint16 server_port;
|
|
79 /* get from login reply packet */
|
|
80 time_t login_time;
|
|
81 time_t last_login_time;
|
|
82 gchar *last_login_ip;
|
|
83 /* get from keep_alive packet */
|
|
84 gchar *my_ip; /* my ip address detected by server */
|
|
85 guint16 my_port; /* my port detected by server */
|
14265
|
86 guint16 my_icon; /* my icon index */
|
14192
|
87 guint32 all_online; /* the number of online QQ users */
|
|
88 time_t last_get_online; /* last time send get_friends_online packet */
|
|
89
|
|
90 guint8 window[1 << 13]; /* check up for duplicated packet */
|
|
91 gint sendqueue_timeout;
|
|
92
|
|
93 GaimRoomlist *roomlist;
|
|
94 gint channel; /* the id for opened chat conversation */
|
|
95
|
|
96 GList *groups;
|
|
97 GList *group_packets;
|
14404
|
98 GSList *joining_groups;
|
|
99 GSList *adding_groups_from_server; /* internal ids of groups the server wants in my blist */
|
14192
|
100 GList *buddies;
|
|
101 GList *contact_info_window;
|
14404
|
102 GList *group_info_window;
|
14192
|
103 GList *sendqueue;
|
|
104 GList *info_query;
|
|
105 GList *add_buddy_request;
|
|
106 GQueue *before_login_packets;
|
|
107
|
14265
|
108 /* TODO is there a better way of handling these? */
|
14192
|
109 gboolean modifying_info;
|
14265
|
110 gboolean modifying_face;
|
14192
|
111 };
|
|
112
|
|
113 void qq_function_not_implemented(GaimConnection *gc);
|
|
114
|
|
115 #endif
|