libpurple/protocols/qq/qq.h

changeset 24019
c0801ae3c886
parent 24018
91f0294f2377
child 24020
fe90d74977b6
equal deleted inserted replaced
24018:91f0294f2377 24019:c0801ae3c886
66 guint8 onlineTime; 66 guint8 onlineTime;
67 guint16 level; 67 guint16 level;
68 guint16 timeRemainder; 68 guint16 timeRemainder;
69 time_t signon; 69 time_t signon;
70 time_t idle; 70 time_t idle;
71 time_t last_refresh; 71 time_t last_update;
72 72
73 gint8 role; /* role in group, used only in group->members list */ 73 gint8 role; /* role in group, used only in group->members list */
74 };
75
76 typedef struct _qq_connection qq_connection;
77 struct _qq_connection {
78 int fd; /* socket file handler */
79 int input_handler;
80
81 /* tcp related */
82 int can_write_handler; /* use in tcp_send_out */
83 PurpleCircBuffer *tcp_txbuf;
84 guint8 *tcp_rxqueue;
85 int tcp_rxlen;
74 }; 86 };
75 87
76 struct _qq_data { 88 struct _qq_data {
77 PurpleConnection *gc; 89 PurpleConnection *gc;
78 90
79 /* common network resource */ 91 GSList *openconns;
92 gboolean use_tcp; /* network in tcp or udp */
93 PurpleProxyConnectData *conn_data;
94 gint fd; /* socket file handler */
95
80 GList *servers; 96 GList *servers;
81 gchar *user_server; 97 gchar *curr_server; /* point to servers->data, do not free*/
82 gint user_port;
83 gboolean use_tcp; /* network in tcp or udp */
84 98
85 gchar *server_name; 99 struct in_addr redirect_ip;
86 gboolean is_redirect; 100 guint16 redirect_port;
87 gchar *real_hostname; /* from real connction */ 101 guint check_watcher;
88 guint16 real_port; 102 guint connect_watcher;
89 guint reconnect_timeout; 103 gint connect_retry;
90 gint reconnect_times;
91
92 PurpleProxyConnectData *connect_data;
93 gint fd; /* socket file handler */
94 gint tx_handler; /* socket can_write handle, use in udp connecting and tcp send out */
95 104
96 qq_interval itv_config; 105 qq_interval itv_config;
97 qq_interval itv_count; 106 qq_interval itv_count;
98 guint network_timeout; 107 guint network_watcher;
99 108
100 GList *transactions; /* check ack packet and resend */ 109 GList *transactions; /* check ack packet and resend */
101
102 /* tcp related */
103 PurpleCircBuffer *tcp_txbuf;
104 guint8 *tcp_rxqueue;
105 int tcp_rxlen;
106
107 /* udp related */
108 PurpleDnsQueryData *udp_query_data;
109 110
110 guint32 uid; /* QQ number */ 111 guint32 uid; /* QQ number */
111 guint8 *token; /* get from server*/ 112 guint8 *token; /* get from server*/
112 int token_len; 113 int token_len;
113 guint8 inikey[QQ_KEY_LENGTH]; /* initial key to encrypt login packet */ 114 guint8 inikey[QQ_KEY_LENGTH]; /* initial key to encrypt login packet */
115 guint8 session_key[QQ_KEY_LENGTH]; /* later use this as key in this session */ 116 guint8 session_key[QQ_KEY_LENGTH]; /* later use this as key in this session */
116 guint8 session_md5[QQ_KEY_LENGTH]; /* concatenate my uid with session_key and md5 it */ 117 guint8 session_md5[QQ_KEY_LENGTH]; /* concatenate my uid with session_key and md5 it */
117 118
118 guint16 send_seq; /* send sequence number */ 119 guint16 send_seq; /* send sequence number */
119 guint8 login_mode; /* online of invisible */ 120 guint8 login_mode; /* online of invisible */
120 gboolean logged_in; /* used by qq-add_buddy */ 121 gboolean is_login; /* used by qq-add_buddy */
122 gboolean is_finish_update;
121 123
122 PurpleXfer *xfer; /* file transfer handler */ 124 PurpleXfer *xfer; /* file transfer handler */
123 125
124 /* get from login reply packet */ 126 /* get from login reply packet */
125 time_t login_time; 127 time_t login_time;
146 GList *add_buddy_request; 148 GList *add_buddy_request;
147 149
148 /* TODO pass qq_send_packet_get_info() a callback and use signals to get rid of these */ 150 /* TODO pass qq_send_packet_get_info() a callback and use signals to get rid of these */
149 gboolean modifying_info; 151 gboolean modifying_info;
150 gboolean modifying_face; 152 gboolean modifying_face;
153
154 gboolean is_show_notice;
155 gboolean is_show_news;
151 }; 156 };
152 157
153 #endif 158 #endif

mercurial