pidgin.openq: a5dd5fe7: 2009.02.21 - flos <lonicerae(at)gmail.co...
csyfek at gmail.com
csyfek at gmail.com
Tue Feb 24 08:15:38 EST 2009
-----------------------------------------------------------------
Revision: a5dd5fe732d799dcb70435cee8a0df2b375df0e8
Ancestor: c0040ac0330880f54a9a39863a3ca6d0dfb94f70
Author: csyfek at gmail.com
Date: 2009-02-24T13:15:34
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/a5dd5fe732d799dcb70435cee8a0df2b375df0e8
Modified files:
libpurple/protocols/qq/ChangeLog
libpurple/protocols/qq/buddy_info.c
libpurple/protocols/qq/buddy_info.h
libpurple/protocols/qq/buddy_list.c
libpurple/protocols/qq/buddy_list.h
libpurple/protocols/qq/buddy_memo.c
libpurple/protocols/qq/buddy_memo.h
libpurple/protocols/qq/group_info.c
libpurple/protocols/qq/group_info.h
libpurple/protocols/qq/qq.c libpurple/protocols/qq/qq.h
libpurple/protocols/qq/qq_network.c
libpurple/protocols/qq/qq_network.h
libpurple/protocols/qq/qq_process.c
libpurple/protocols/qq/qq_process.h
libpurple/protocols/qq/qq_trans.c
libpurple/protocols/qq/qq_trans.h
ChangeLog:
2009.02.21 - flos <lonicerae(at)gmail.com>
* Added 'qq_strlen' and 'qq_strcmp' funtions in qq.h
* Fixed compiling problems with lower version of GTK+
-------------- next part --------------
============================================================
--- libpurple/protocols/qq/ChangeLog 4c3f43cfcea8872f57940e7b626617f6e4606c8e
+++ libpurple/protocols/qq/ChangeLog 1a8230fa965992f04045611e2c73e5dbc668d21e
@@ -1,4 +1,8 @@ 2009.02.21 - flos <lonicerae(at)gmail.co
2009.02.21 - flos <lonicerae(at)gmail.com>
+ * Added 'qq_strlen' and 'qq_strcmp' funtions in qq.h
+ * Fixed compiling problems with lower version of GTK+
+
+2009.02.21 - flos <lonicerae(at)gmail.com>
* Rewrite whole buddy memo part
* Remove 'qq_to_utf8_len' and 'utf8_to_qq_len' functions in char_conv.c
* Update ChangeLog, AUTHORS
============================================================
--- libpurple/protocols/qq/buddy_info.c 7cdeab7e7e95f3b5e6d3ad8ab32976ffc7a2bcca
+++ libpurple/protocols/qq/buddy_info.c cc5dafcc5a806c197e60d5b8a3d7cf408333c5d8
@@ -222,7 +222,7 @@ void qq_request_buddy_info(PurpleConnect
}
void qq_request_buddy_info(PurpleConnection *gc, guint32 uid,
- gint update_class, int action)
+ guint32 update_class, int action)
{
qq_data *qd;
gchar raw_data[16] = {0};
@@ -752,7 +752,7 @@ void qq_request_get_level_2007(PurpleCon
qq_send_cmd(gc, QQ_CMD_GET_LEVEL, buf, bytes);
}
-void qq_request_get_buddies_level(PurpleConnection *gc, gint update_class)
+void qq_request_get_buddies_level(PurpleConnection *gc, guint32 update_class)
{
qq_data *qd = (qq_data *) gc->proto_data;
PurpleBuddy *buddy;
============================================================
--- libpurple/protocols/qq/buddy_info.h a1236727e369a43166a4f9283eaa1a4a81cf5da3
+++ libpurple/protocols/qq/buddy_info.h 52fda46038e310247f497f99260754dcf94c0fea
@@ -79,14 +79,14 @@ void qq_request_buddy_info(PurpleConnect
void qq_change_icon_cb(PurpleConnection *gc, const char *filepath);
void qq_request_buddy_info(PurpleConnection *gc, guint32 uid,
- gint update_class, int action);
+ guint32 update_class, int action);
void qq_set_custom_icon(PurpleConnection *gc, PurpleStoredImage *img);
void qq_process_change_info(PurpleConnection *gc, guint8 *data, gint data_len);
void qq_process_get_buddy_info(guint8 *data, gint data_len, guint32 action, PurpleConnection *gc);
void qq_request_get_level(PurpleConnection *gc, guint32 uid);
void qq_request_get_level_2007(PurpleConnection *gc, guint32 uid);
-void qq_request_get_buddies_level(PurpleConnection *gc, gint update_class);
+void qq_request_get_buddies_level(PurpleConnection *gc, guint32 update_class);
void qq_process_get_level_reply(guint8 *buf, gint buf_len, PurpleConnection *gc);
void qq_update_buddy_icon(PurpleAccount *account, const gchar *who, gint face);
============================================================
--- libpurple/protocols/qq/buddy_list.c 281be6d4a32bd32477d457ee12284cec4b4e32d5
+++ libpurple/protocols/qq/buddy_list.c cf30c14cc9eabc1b2179e741e2a250b9691381de
@@ -56,7 +56,7 @@ typedef struct _qq_buddy_online {
} qq_buddy_online;
/* get a list of online_buddies */
-void qq_request_get_buddies_online(PurpleConnection *gc, guint8 position, gint update_class)
+void qq_request_get_buddies_online(PurpleConnection *gc, guint8 position, guint32 update_class)
{
qq_data *qd;
guint8 *raw_data;
@@ -82,7 +82,7 @@ void qq_request_get_buddies_online(Purpl
/* position starts with 0x0000,
* server may return a position tag if list is too long for one packet */
-void qq_request_get_buddies(PurpleConnection *gc, guint16 position, gint update_class)
+void qq_request_get_buddies(PurpleConnection *gc, guint16 position, guint32 update_class)
{
qq_data *qd;
guint8 raw_data[16] = {0};
@@ -106,7 +106,7 @@ void qq_request_get_buddies(PurpleConnec
}
/* get all list, buddies & Quns with groupsid support */
-void qq_request_get_buddies_and_rooms(PurpleConnection *gc, guint32 position, gint update_class)
+void qq_request_get_buddies_and_rooms(PurpleConnection *gc, guint32 position, guint32 update_class)
{
guint8 raw_data[16] = {0};
gint bytes = 0;
@@ -462,7 +462,7 @@ static guint8 get_status_from_purple(Pu
}
/* send a packet to change my online status */
-void qq_request_change_status(PurpleConnection *gc, gint update_class)
+void qq_request_change_status(PurpleConnection *gc, guint32 update_class)
{
qq_data *qd;
guint8 raw_data[16] = {0};
============================================================
--- libpurple/protocols/qq/buddy_list.h 0c679eef517b4ea9508063ded2f8943e32367ad9
+++ libpurple/protocols/qq/buddy_list.h 1dfb72eb97dd62e2260662a29725666d438b759e
@@ -40,16 +40,16 @@ typedef struct _qq_buddy_status {
guint8 unknown_key[QQ_KEY_LENGTH];
} qq_buddy_status;
-void qq_request_get_buddies_online(PurpleConnection *gc, guint8 position, gint update_class);
+void qq_request_get_buddies_online(PurpleConnection *gc, guint8 position, guint32 update_class);
guint8 qq_process_get_buddies_online(guint8 *data, gint data_len, PurpleConnection *gc);
-void qq_request_get_buddies(PurpleConnection *gc, guint16 position, gint update_class);
+void qq_request_get_buddies(PurpleConnection *gc, guint16 position, guint32 update_class);
guint16 qq_process_get_buddies(guint8 *data, gint data_len, PurpleConnection *gc);
-void qq_request_get_buddies_and_rooms(PurpleConnection *gc, guint32 position, gint update_class);
+void qq_request_get_buddies_and_rooms(PurpleConnection *gc, guint32 position, guint32 update_class);
guint32 qq_process_get_buddies_and_rooms(guint8 *data, gint data_len, PurpleConnection *gc);
-void qq_request_change_status(PurpleConnection *gc, gint update_class);
+void qq_request_change_status(PurpleConnection *gc, guint32 update_class);
void qq_process_change_status(guint8 *data, gint data_len, PurpleConnection *gc);
void qq_process_buddy_change_status(guint8 *data, gint data_len, PurpleConnection *gc);
============================================================
--- libpurple/protocols/qq/buddy_memo.c 3d46ece85f32bdc5859020f8ed08352bddbd7ff4
+++ libpurple/protocols/qq/buddy_memo.c ff08973b641edd8c1e0d6a8257268a27d5ee5e93
@@ -171,7 +171,7 @@ static void memo_modify_ok_cb(modify_mem
else {
value = utf8_to_qq(utf8_str, QQ_CHARSET_DEFAULT);
/* Warnning: value will be string "(NULL)" instead of NULL */
- if (!g_strcmp0("(NULL)", value)) {
+ if (!qq_strcmp("(NULL)", value)) {
value = g_strdup("");
}
}
@@ -321,7 +321,7 @@ void qq_process_get_buddy_memo(PurpleCon
}
/* request buddy memo */
-void qq_request_buddy_memo(PurpleConnection *gc, guint32 bd_uid, gint update_class, int action)
+void qq_request_buddy_memo(PurpleConnection *gc, guint32 bd_uid, guint32 update_class, int action)
{
guint8 raw_data[16] = {0};
gint bytes;
============================================================
--- libpurple/protocols/qq/buddy_memo.h e118c28727db35763354b3c8e47ae3472ad80f6d
+++ libpurple/protocols/qq/buddy_memo.h dd9a02506ce8a79294995801a6e8210af1ddf067
@@ -18,7 +18,7 @@ void qq_process_get_buddy_memo(PurpleCon
void qq_process_get_buddy_memo(PurpleConnection *gc, guint8* data, gint data_len, guint32 action);
-void qq_request_buddy_memo(PurpleConnection *gc, guint32 bd_uid, gint update_class, int action);
+void qq_request_buddy_memo(PurpleConnection *gc, guint32 bd_uid, guint32 update_class, int action);
void qq_create_buddy_memo(PurpleConnection *gc, guint32 bd_uid, int action);
============================================================
--- libpurple/protocols/qq/group_info.c 93b0420c3803471c64e247b2cb2716870edf739a
+++ libpurple/protocols/qq/group_info.c 182f6e39b964e6b82dc5bfb373f55d12e78a94f6
@@ -65,7 +65,7 @@ static void set_all_offline(qq_room_data
}
/* send packet to get info for each group member */
-gint qq_request_room_get_buddies(PurpleConnection *gc, guint32 room_id, gint update_class)
+gint qq_request_room_get_buddies(PurpleConnection *gc, guint32 room_id, guint32 update_class)
{
guint8 *raw_data;
gint bytes, num;
============================================================
--- libpurple/protocols/qq/group_info.h a61e4fcf8c7fb4b09ce22c5e504c1b414bcc97a4
+++ libpurple/protocols/qq/group_info.h 7ef27bed8ba72a525ff07ca1918ce0d130035428
@@ -34,7 +34,7 @@ enum {
QQ_ROOM_INFO_DISPLAY
};
-gint qq_request_room_get_buddies(PurpleConnection *gc, guint32 room_id, gint update_class);
+gint qq_request_room_get_buddies(PurpleConnection *gc, guint32 room_id, guint32 update_class);
void qq_process_room_cmd_get_info(guint8 *data, gint len, guint32 action, PurpleConnection *gc);
void qq_process_room_cmd_get_onlines(guint8 *data, gint len, PurpleConnection *gc);
============================================================
--- libpurple/protocols/qq/qq.c e87d411bf89408612fc693b4b9544d8ad507c3ea
+++ libpurple/protocols/qq/qq.c 4665f83d3ddfb16006481ddefb856b1cf232c840
@@ -851,7 +851,7 @@ static void qq_modify_buddy_memo_from_me
purple_debug_info("QQ", "alias=%s\n", alias);
purple_debug_info("QQ", "server_alias=%s\n", server_alias);
- if (!g_strcmp0(alias, server_alias)) {
+ if (!qq_strcmp(alias, server_alias)) {
qq_create_buddy_memo(gc, bd_uid, QQ_BUDDY_MEMO_MODIFY);
}
}
============================================================
--- libpurple/protocols/qq/qq.h a205915d300de6ffa69d6fe5467b3751225434eb
+++ libpurple/protocols/qq/qq.h 3d091bca4889c327acc9af50a8a39466ba316a60
@@ -36,6 +36,10 @@
#define QQ_KEY_LENGTH 16
+/* steal from kazehakase :) */
+#define qq_strlen(s) ((s)!=NULL?strlen(s):0)
+#define qq_strcmp(s1,s2) ((s1)!=NULL && (s2)!=NULL?strcmp(s1,s2):0)
+
typedef struct _qq_data qq_data;
typedef struct _qq_buddy_data qq_buddy_data;
typedef struct _qq_interval qq_interval;
============================================================
--- libpurple/protocols/qq/qq_network.c 7efc1ba7cf25c27c33c635663af8fbf9cc2cff3f
+++ libpurple/protocols/qq/qq_network.c 2157ebcbcf5a955908441364e7edcaf4561d2d6d
@@ -268,7 +268,7 @@ static gboolean packet_process(PurpleCon
guint16 seq; /* May be ack_seq or send_seq, depends on cmd */
guint8 room_cmd;
guint32 room_id;
- gint update_class;
+ guint32 update_class;
guint32 ship32;
int ret;
@@ -1130,7 +1130,8 @@ static gint send_cmd_detail(PurpleConnec
/* Encrypt data with session_key, and send packet out */
static gint send_cmd_detail(PurpleConnection *gc, guint16 cmd, guint16 seq,
- guint8 *data, gint data_len, gboolean is_save2trans, gint update_class, guint32 ship32)
+ guint8 *data, gint data_len, gboolean is_save2trans,
+ guint32 update_class, guint32 ship32)
{
qq_data *qd;
guint8 *encrypted;
@@ -1160,7 +1161,7 @@ gint qq_send_cmd_mess(PurpleConnection *
}
gint qq_send_cmd_mess(PurpleConnection *gc, guint16 cmd, guint8 *data, gint data_len,
- gint update_class, guint32 ship32)
+ guint32 update_class, guint32 ship32)
{
qq_data *qd;
guint16 seq;
@@ -1234,7 +1235,7 @@ static gint send_room_cmd(PurpleConnecti
}
static gint send_room_cmd(PurpleConnection *gc, guint8 room_cmd, guint32 room_id,
- guint8 *data, gint data_len, gint update_class, guint32 ship32)
+ guint8 *data, gint data_len, guint32 update_class, guint32 ship32)
{
qq_data *qd;
guint8 *buf;
@@ -1288,7 +1289,7 @@ gint qq_send_room_cmd_mess(PurpleConnect
}
gint qq_send_room_cmd_mess(PurpleConnection *gc, guint8 room_cmd, guint32 room_id,
- guint8 *data, gint data_len, gint update_class, guint32 ship32)
+ guint8 *data, gint data_len, guint32 update_class, guint32 ship32)
{
g_return_val_if_fail(room_cmd > 0, -1);
return send_room_cmd(gc, room_cmd, room_id, data, data_len, update_class, ship32);
============================================================
--- libpurple/protocols/qq/qq_network.h b5da3ac74a10b4a53df0b6ea29860d12e42d0d61
+++ libpurple/protocols/qq/qq_network.h 7581edb90c19b84bf1257d8af103f3026d8d0bc8
@@ -39,7 +39,7 @@ gint qq_send_cmd_mess(PurpleConnection *
guint8 *encrypted_data, gint encrypted_len, gboolean is_save2trans);
gint qq_send_cmd(PurpleConnection *gc, guint16 cmd, guint8 *data, gint datalen);
gint qq_send_cmd_mess(PurpleConnection *gc, guint16 cmd, guint8 *data, gint data_len,
- gint update_class, guint32 ship32);
+ guint32 update_class, guint32 ship32);
gint qq_send_server_reply(PurpleConnection *gc, guint16 cmd, guint16 seq,
guint8 *data, gint data_len);
@@ -47,7 +47,7 @@ gint qq_send_room_cmd_mess(PurpleConnect
gint qq_send_room_cmd(PurpleConnection *gc, guint8 room_cmd, guint32 room_id,
guint8 *data, gint data_len);
gint qq_send_room_cmd_mess(PurpleConnection *gc, guint8 room_cmd, guint32 room_id,
- guint8 *data, gint data_len, gint update_class, guint32 ship32);
+ guint8 *data, gint data_len, guint32 update_class, guint32 ship32);
gint qq_send_room_cmd_only(PurpleConnection *gc, guint8 room_cmd, guint32 room_id);
gint qq_send_room_cmd_noid(PurpleConnection *gc, guint8 room_cmd,
guint8 *data, gint data_len);
============================================================
--- libpurple/protocols/qq/qq_process.c 567b9254352e362e6692d86897b85cb936af7215
+++ libpurple/protocols/qq/qq_process.c a9c96a02c3ef43589244a781533fd7217744537f
@@ -741,7 +741,7 @@ void qq_proc_room_cmds(PurpleConnection
void qq_proc_room_cmds(PurpleConnection *gc, guint16 seq,
guint8 room_cmd, guint32 room_id, guint8 *rcved, gint rcved_len,
- gint update_class, guint32 ship32)
+ guint32 update_class, guint32 ship32)
{
qq_data *qd;
guint8 *data;
@@ -877,7 +877,7 @@ guint8 qq_proc_login_cmds(PurpleConnecti
}
guint8 qq_proc_login_cmds(PurpleConnection *gc, guint16 cmd, guint16 seq,
- guint8 *rcved, gint rcved_len, gint update_class, guint32 ship32)
+ guint8 *rcved, gint rcved_len, guint32 update_class, guint32 ship32)
{
qq_data *qd;
guint8 *data = NULL;
@@ -1029,7 +1029,7 @@ void qq_proc_client_cmds(PurpleConnectio
}
void qq_proc_client_cmds(PurpleConnection *gc, guint16 cmd, guint16 seq,
- guint8 *rcved, gint rcved_len, gint update_class, guint32 ship32)
+ guint8 *rcved, gint rcved_len, guint32 update_class, guint32 ship32)
{
qq_data *qd;
============================================================
--- libpurple/protocols/qq/qq_process.h 1fe1c1eb1b1c51643d952a6943961379f8178740
+++ libpurple/protocols/qq/qq_process.h 907e4bb3611adb98e24483d04929eb56b4cc9195
@@ -39,12 +39,12 @@ guint8 qq_proc_login_cmds(PurpleConnecti
};
guint8 qq_proc_login_cmds(PurpleConnection *gc, guint16 cmd, guint16 seq,
- guint8 *rcved, gint rcved_len, gint update_class, guint32 ship32);
+ guint8 *rcved, gint rcved_len, guint32 update_class, guint32 ship32);
void qq_proc_client_cmds(PurpleConnection *gc, guint16 cmd, guint16 seq,
- guint8 *rcved, gint rcved_len, gint update_class, guint32 ship32);
+ guint8 *rcved, gint rcved_len, guint32 update_class, guint32 ship32);
void qq_proc_room_cmds(PurpleConnection *gc, guint16 seq,
guint8 room_cmd, guint32 room_id, guint8 *rcved, gint rcved_len,
- gint update_class, guint32 ship32);
+ guint32 update_class, guint32 ship32);
void qq_proc_server_cmd(PurpleConnection *gc, guint16 cmd, guint16 seq, guint8 *rcved, gint rcved_len);
============================================================
--- libpurple/protocols/qq/qq_trans.c 00d3b66dd18b97baf3b6c898f9bf0a6faac2a7a2
+++ libpurple/protocols/qq/qq_trans.c 16389a8403567a22eb2682501b61a909b3e7139c
@@ -58,7 +58,7 @@ struct _qq_transaction {
gint rcved_times;
gint scan_times;
- gint update_class;
+ guint32 update_class;
guint32 ship32;
};
@@ -94,20 +94,20 @@ guint32 qq_trans_get_room_id(qq_transact
return trans->room_id;
}
-gint qq_trans_get_class(qq_transaction *trans)
+guint32 qq_trans_get_class(qq_transaction *trans)
{
g_return_val_if_fail(trans != NULL, QQ_CMD_CLASS_NONE);
return trans->update_class;
}
-gint qq_trans_get_ship(qq_transaction *trans)
+guint32 qq_trans_get_ship(qq_transaction *trans)
{
g_return_val_if_fail(trans != NULL, 0);
return trans->ship32;
}
static qq_transaction *trans_create(PurpleConnection *gc, gint fd,
- guint16 cmd, guint16 seq, guint8 *data, gint data_len, gint update_class, guint32 ship32)
+ guint16 cmd, guint16 seq, guint8 *data, gint data_len, guint32 update_class, guint32 ship32)
{
qq_data *qd;
qq_transaction *trans;
@@ -179,7 +179,7 @@ void qq_trans_add_client_cmd(PurpleConne
}
void qq_trans_add_client_cmd(PurpleConnection *gc,
- guint16 cmd, guint16 seq, guint8 *data, gint data_len, gint update_class, guint32 ship32)
+ guint16 cmd, guint16 seq, guint8 *data, gint data_len, guint32 update_class, guint32 ship32)
{
qq_data *qd = (qq_data *)gc->proto_data;
qq_transaction *trans = trans_create(gc, qd->fd, cmd, seq, data, data_len, update_class, ship32);
@@ -219,7 +219,7 @@ void qq_trans_add_room_cmd(PurpleConnect
void qq_trans_add_room_cmd(PurpleConnection *gc,
guint16 seq, guint8 room_cmd, guint32 room_id, guint8 *data, gint data_len,
- gint update_class, guint32 ship32)
+ guint32 update_class, guint32 ship32)
{
qq_data *qd = (qq_data *)gc->proto_data;
qq_transaction *trans = trans_create(gc, qd->fd, QQ_CMD_ROOM, seq, data, data_len,
============================================================
--- libpurple/protocols/qq/qq_trans.h f79dcf08ca23b5b64e2c7b927714d69a33d2e8e2
+++ libpurple/protocols/qq/qq_trans.h ef2f184120a42289fd9b775b11b629a505ee0ff6
@@ -35,14 +35,14 @@ guint32 qq_trans_get_room_id(qq_transact
gboolean qq_trans_is_dup(qq_transaction *trans);
guint8 qq_trans_get_room_cmd(qq_transaction *trans);
guint32 qq_trans_get_room_id(qq_transaction *trans);
-gint qq_trans_get_class(qq_transaction *trans);
-gint qq_trans_get_ship(qq_transaction *trans);
+guint32 qq_trans_get_class(qq_transaction *trans);
+guint32 qq_trans_get_ship(qq_transaction *trans);
void qq_trans_add_client_cmd(PurpleConnection *gc, guint16 cmd, guint16 seq,
- guint8 *data, gint data_len, gint update_class, guint32 ship32);
+ guint8 *data, gint data_len, guint32 update_class, guint32 ship32);
void qq_trans_add_room_cmd(PurpleConnection *gc,
guint16 seq, guint8 room_cmd, guint32 room_id,
- guint8 *data, gint data_len, gint update_class, guint32 ship32);
+ guint8 *data, gint data_len, guint32 update_class, guint32 ship32);
void qq_trans_add_server_cmd(PurpleConnection *gc, guint16 cmd, guint16 seq,
guint8 *rcved, gint rcved_len);
void qq_trans_add_server_reply(PurpleConnection *gc, guint16 cmd, guint16 seq,
More information about the Commits
mailing list