From 02b2c6aa2bd4036cc85a64a9d3fb8d163b0e7ef7 Mon Sep 17 00:00:00 2001 From: cnangel Date: Thu, 23 Aug 2012 12:35:41 +0800 Subject: [PATCH] fixed for cnangel MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit --- buddy_memo.c | 4 +- buddy_opt.c | 132 ++++++------- group_im.c | 4 +- im.c | 596 +++++++++++++++++++++++++++++------------------------------ qq.c | 42 ++++- qq.h | 1 + qq_base.c | 3 +- qq_base.h | 6 +- qq_define.c | 8 +- qq_define.h | 3 + qq_network.c | 12 +- qq_process.c | 70 +++---- 12 个文件被修改,插入 459 行(+),删除 422 行(-) diff --git a/buddy_memo.c b/buddy_memo.c index f0cc2dd..f01efe1 100644 --- a/buddy_memo.c +++ b/buddy_memo.c @@ -349,8 +349,8 @@ void qq_process_get_buddy_memo( PurpleConnection *gc, guint8* data, gint data_le /* common action, update buddy memo */ update_buddy_alias(gc, rcv_uid, segments[QQ_MEMO_ALIAS]); - /* memo is thing that we regard our buddy as, so we need one more buddy_uid */ - /* action might be QQ_BUDDY_MEMO_MODIFY */ + /* memo is thing that we regard our buddy as, so we need one more buddy_uid */ + /* action might be QQ_BUDDY_MEMO_MODIFY */ memo_modify_dialogue(gc, rcv_uid, segments, i); g_free(segments); break; diff --git a/buddy_opt.c b/buddy_opt.c index 0523ce0..3ddfd97 100644 --- a/buddy_opt.c +++ b/buddy_opt.c @@ -821,11 +821,11 @@ void qq_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) return; } - purple_notify_error(gc, _("QQ Buddy"), _("Add buddy"), _("Invalid QQ Number")); - -free: - if (buddy == NULL) - return; + purple_notify_error(gc, _("QQ Buddy"), _("Add buddy"), _("Invalid QQ Number")); + +free: + if (buddy == NULL) + return; qq_buddy_free(buddy); } @@ -1070,30 +1070,30 @@ static gint server_buddy_check_code(PurpleConnection *gc, */ /* someone wants to add you to his buddy list */ -static void server_buddy_add_request_deprecated(PurpleConnection *gc, gchar *from, gchar *to, - guint8 *data, gint data_len) -{ - guint32 uid; - gchar *reason; - - g_return_if_fail(from != NULL && to != NULL); - uid = strtoul(from, NULL, 10); - g_return_if_fail(uid != 0); - - if (purple_prefs_get_bool("/plugins/prpl/qq/auto_get_authorize_info")) { - qq_request_get_buddy_info(gc, uid, 0, QQ_BUDDY_INFO_DISPLAY); - } - - if (data_len <= 0) { - reason = g_strdup( _("No reason given") ); - } else { - reason = g_strndup((gchar *)data, data_len); - if (reason == NULL) reason = g_strdup( _("Unknown reason") ); - } - - buddy_add_input(gc, uid, reason); - g_free(reason); -} +static void server_buddy_add_request_deprecated(PurpleConnection *gc, gchar *from, gchar *to, + guint8 *data, gint data_len) +{ + guint32 uid; + gchar *reason; + + g_return_if_fail(from != NULL && to != NULL); + uid = strtoul(from, NULL, 10); + g_return_if_fail(uid != 0); + + if (purple_prefs_get_bool("/plugins/prpl/qq/auto_get_authorize_info")) { + qq_request_get_buddy_info(gc, uid, 0, QQ_BUDDY_INFO_DISPLAY); + } + + if (data_len <= 0) { + reason = g_strdup( _("No reason given") ); + } else { + reason = g_strndup((gchar *)data, data_len); + if (reason == NULL) reason = g_strdup( _("Unknown reason") ); + } + + buddy_add_input(gc, uid, reason); + g_free(reason); +} static void server_buddy_add_request(PurpleConnection *gc, gchar *from, gchar *to, guint8 *data, gint data_len) @@ -1123,42 +1123,42 @@ static void server_buddy_add_request(PurpleConnection *gc, gchar *from, gchar *t g_free(msg); } -/* when you are added by a person, QQ server will send sys message */ -static void server_buddy_added_deprecated(PurpleConnection *gc, gchar *from, gchar *to, - guint8 *data, gint data_len) -{ - PurpleAccount *account = purple_connection_get_account(gc); - PurpleBuddy *buddy; - guint32 uid; - qq_buddy_opt_req *opt_req; - gchar *who; - gchar *primary; - - g_return_if_fail(from != NULL && to != NULL); - - uid = strtoul(from, NULL, 10); - who = uid_to_purple_name(uid); - - buddy = purple_find_buddy(account, who); - if (buddy != NULL) { - purple_account_notify_added(account, from, to, NULL, NULL); - } - - opt_req = g_new0(qq_buddy_opt_req, 1); - opt_req->gc = gc; - opt_req->uid = uid; /* only need to get value */ - primary = g_strdup_printf(_("You have been added by %s"), from); - purple_request_action(gc, NULL, primary, - _("Would you like to add him?"), - PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), who, NULL, - opt_req, 2, - _("Add"), G_CALLBACK(add_buddy_no_auth_cb), - _("Cancel"), G_CALLBACK(buddy_req_cancel_cb)); - - g_free(who); - g_free(primary); -} +/* when you are added by a person, QQ server will send sys message */ +static void server_buddy_added_deprecated(PurpleConnection *gc, gchar *from, gchar *to, + guint8 *data, gint data_len) +{ + PurpleAccount *account = purple_connection_get_account(gc); + PurpleBuddy *buddy; + guint32 uid; + qq_buddy_opt_req *opt_req; + gchar *who; + gchar *primary; + + g_return_if_fail(from != NULL && to != NULL); + + uid = strtoul(from, NULL, 10); + who = uid_to_purple_name(uid); + + buddy = purple_find_buddy(account, who); + if (buddy != NULL) { + purple_account_notify_added(account, from, to, NULL, NULL); + } + + opt_req = g_new0(qq_buddy_opt_req, 1); + opt_req->gc = gc; + opt_req->uid = uid; /* only need to get value */ + primary = g_strdup_printf(_("You have been added by %s"), from); + purple_request_action(gc, NULL, primary, + _("Would you like to add him?"), + PURPLE_DEFAULT_ACTION_NONE, + purple_connection_get_account(gc), who, NULL, + opt_req, 2, + _("Add"), G_CALLBACK(add_buddy_no_auth_cb), + _("Cancel"), G_CALLBACK(buddy_req_cancel_cb)); + + g_free(who); + g_free(primary); +} static void server_buddy_added(PurpleConnection *gc, gchar *from, gchar *to, guint8 *data, gint data_len) @@ -1282,7 +1282,7 @@ static void server_buddy_rejected_me(PurpleConnection *gc, gchar *from, gchar *t void qq_process_buddy_from_server(PurpleConnection *gc, int funct, gchar *from, gchar *to, guint8 *data, gint data_len) { - switch (funct) { + switch (funct) { case QQ_SERVER_BUDDY_ADDED_DEPRECATED: server_buddy_added_deprecated(gc, from, to, data, data_len); break; diff --git a/group_im.c b/group_im.c index ab7cc37..9a8ecad 100644 --- a/group_im.c +++ b/group_im.c @@ -414,8 +414,8 @@ static void request_room_send_im(PurpleConnection *gc, guint32 room_id, qq_im_fo bytes += qq_put32(raw_data + bytes, 0); /* 00 00 00 00 */ now = time(NULL); bytes += qq_puttime(raw_data + bytes, &now); - /* could be a random int */ - srand((unsigned)now); + /* could be a random int */ + srand((unsigned)now); bytes += qq_put32(raw_data + bytes, (rand() & 0x7fff) | ((rand() & 0x7fff) << 15)); /* font attr set */ bytes += qq_put8(raw_data + bytes, 0x00); diff --git a/im.c b/im.c index 7f1112b..fe9eb3e 100644 --- a/im.c +++ b/im.c @@ -112,283 +112,283 @@ struct _qq_image { static gboolean emoticons_is_sorted = FALSE; /* Map for purple smiley convert to qq, need qsort */ static qq_emoticon emoticons[] = { - {0x4f, 0x0E, "/:)$"}, {0x4f, 0x0E, "/wx$"}, {0x4f, 0x0E, "/small_smile$"}, - {0x42, 0x01, "/:~$"}, {0x42, 0x01, "/pz$"}, {0x42, 0x01, "/curl_lip$"}, - {0x43, 0x02, "/:*$"}, {0x43, 0x02, "/se$"}, {0x43, 0x02, "/desire$"}, - {0x44, 0x03, "/:|$"}, {0x44, 0x03, "/fd$"}, {0x44, 0x03, "/dazed$"}, - {0x45, 0x04, "/8-)$"}, {0x45, 0x04, "/dy$"}, {0x45, 0x04, "/revel$"}, - {0x46, 0x05, "/:<$"}, {0x46, 0x05, "/ll$"}, {0x46, 0x05, "/cry$"}, - {0x47, 0x06, "/:$$"}, {0x47, 0x06, "/hx$"}, {0x47, 0x06, "/bashful$"}, - {0x48, 0x07, "/:x$"}, {0x48, 0x07, "/bz$"}, {0x48, 0x07, "/shut_mouth$"}, - {0x49, 0x08, "/:z$"}, {0x49, 0x08, "/shui$"}, {0x49, 0x08, "/sleep$"}, - {0x4a, 0x09, "/:'$"}, {0x4a, 0x09, "/dk$"}, {0x4a, 0x09, "/weep$"}, - {0x4b, 0x0A, "/:-|$"}, {0x4b, 0x0A, "/gg$"}, {0x4b, 0x0A, "/embarassed$"}, - {0x4c, 0x0B, "/:@$"}, {0x4c, 0x0B, "/fn$"}, {0x4c, 0x0B, "/pissed_off$"}, - {0x4d, 0x0C, "/:P$"}, {0x4d, 0x0C, "/tp$"}, {0x4d, 0x0C, "/act_up$"}, - {0x4e, 0x0D, "/:D$"}, {0x4e, 0x0D, "/cy$"}, {0x4e, 0x0D, "/toothy_smile$"}, - {0x41, 0x00, "/:O$"}, {0x41, 0x00, "/jy$"}, {0x41, 0x00, "/surprised$"}, - {0x73, 0x0F, "/:($"}, {0x73, 0x0F, "/ng$"}, {0x73, 0x0F, "/sad$"}, - {0x74, 0x10, "/:+$"}, {0x74, 0x10, "/kuk$"}, {0x74, 0x10, "/cool$"}, - {0xa1, 0x60, "/--b$"}, {0xa1, 0x60, "/lengh$"}, - {0x76, 0x12, "/:Q$"}, {0x76, 0x12, "/zk$"}, {0x76, 0x12, "/crazy$"}, - {0x77, 0x13, "/:t$"}, {0x77, 0x13, "/tu$"}, {0x77, 0x13, "/vomit$"}, - {0x8a, 0x13, "/;P$"}, {0x8a, 0x13, "/tx$"}, {0x8a, 0x13, "/titter$"}, - {0x8b, 0x14, "/;-D$"}, {0x8b, 0x14, "/ka$"}, {0x8b, 0x14, "/cute$"}, - {0x8c, 0x16, "/;d$"}, {0x8c, 0x16, "/baiy$"}, {0x8c, 0x16, "/disdain$"}, - {0x8d, 0x17, "/;o$"}, {0x8d, 0x17, "/am$"}, {0x8d, 0x17, "/arrogant$"}, - {0x8e, 0x18, "/:g$"}, {0x8e, 0x18, "/jie$"}, {0x8e, 0x18, "/starving$"}, - {0x8f, 0x19, "/|-)$"}, {0x8f, 0x19, "/kun$"}, {0x8f, 0x19, "/sleepy$"}, - {0x78, 0x1A, "/:!$"}, {0x78, 0x1A, "/jk$"}, {0x78, 0x1A, "/terror$"}, - {0x79, 0x1B, "/:L$"}, {0x79, 0x1B, "/lh$"}, {0x79, 0x1B, "/sweat$"}, - {0x7a, 0x1C, "/:>$"}, {0x7a, 0x1C, "/hanx$"}, {0x7a, 0x1C, "/smirk$"}, - {0x7b, 0x1D, "/:;$"}, {0x7b, 0x1D, "/db$"}, {0x7b, 0x1D, "/soldier$"}, - {0x90, 0x1E, "/;f$"}, {0x90, 0x1E, "/fendou$"}, {0x90, 0x1E, "/struggle$"}, - {0x91, 0x1F, "/:-S$"}, {0x91, 0x1F, "/zhm$"}, {0x91, 0x1F, "/curse$"}, - {0x92, 0x20, "/?$"}, {0x92, 0x20, "/yiw$"}, {0x92, 0x20, "/question$"}, - {0x93, 0x21, "/;x$"}, {0x93, 0x21, "/xu$"}, {0x93, 0x21, "/shh$"}, - {0x94, 0x22, "/;@$"}, {0x94, 0x22, "/yun$"}, {0x94, 0x22, "/dizzy$"}, - {0x95, 0x23, "/:8$"}, {0x95, 0x23, "/zhem$"}, {0x95, 0x23, "/excrutiating$"}, - {0x96, 0x24, "/;!$"}, {0x96, 0x24, "/shuai$"}, {0x96, 0x24, "/freaked_out$"}, - {0x97, 0x25, "/!!!$"}, {0x97, 0x25, "/kl$"}, {0x97, 0x25, "/skeleton$"}, - {0x98, 0x26, "/xx$"}, {0x98, 0x26, "/qiao$"}, {0x98, 0x26, "/hammer$"}, - {0x99, 0x27, "/bye$"}, {0x99, 0x27, "/zj$"}, - {0xa2, 0x61, "/wipe$"}, {0xa2, 0x61, "/ch$"}, - {0xa3, 0x62, "/dig$"}, {0xa3, 0x62, "/kb$"}, - {0xa4, 0x63, "/handclap$"},{0xa4, 0x63, "/gz$"}, - {0xa5, 0x64, "/&-($"}, {0xa5, 0x64, "/qd$"}, - {0xa6, 0x65, "/B-)$"}, {0xa6, 0x65, "/huaix$"}, - {0xa7, 0x66, "/<@$"}, {0xa7, 0x66, "/zhh$"}, - {0xa8, 0x67, "/@>$"}, {0xa8, 0x67, "/yhh$"}, - {0xa9, 0x68, "/:-O$"}, {0xa9, 0x68, "/hq$"}, - {0xaa, 0x69, "/>-|$"}, {0xaa, 0x69, "/bs$"}, - {0xab, 0x6A, "/P-($"}, {0xab, 0x6A, "/wq$"}, - {0xac, 0x6B, "/:'|$"}, {0xac, 0x6B, "/kk$"}, - {0xad, 0x6C, "/X-)$"}, {0xad, 0x6C, "/yx$"}, - {0xae, 0x6D, "/:*$"}, {0xae, 0x6D, "/qq$"}, - {0xaf, 0x6E, "/@x$"}, {0xaf, 0x6E, "/xia$"}, - {0xb0, 0x6F, "/8*$"}, {0xb0, 0x6F, "/kel$"}, - {0xb1, 0x70, "/pd$"}, {0xb1, 0x70, "/cd$"}, - {0x61, 0x59, "/$"}, {0x61, 0x59, "/xig$"}, {0x61, 0x59, "/watermelon$"}, - {0xb2, 0x71, "/beer$"}, {0xb2, 0x71, "/pj$"}, - {0xb3, 0x72, "/basketb$"}, {0xb3, 0x72, "/lq$"}, - {0xb4, 0x73, "/oo$"}, {0xb4, 0x73, "/pp$"}, - {0x80, 0x3C, "/coffee$"}, {0x80, 0x3C, "/kf$"}, - {0x81, 0x3D, "/eat$"}, {0x81, 0x3D, "/fan$"}, - {0x7c, 0x2E, "/pig$"}, {0x7c, 0x2E, "/zt$"}, - {0x62, 0x3F, "/rose$"}, {0x62, 0x3F, "/mg$"}, - {0x63, 0x40, "/fade$"}, {0x63, 0x40, "/dx$"}, {0x63, 0x40, "/wilt$"}, - {0xb5, 0x74, "/showlove$"},{0xb5, 0x74, "/sa$"}, - {0x65, 0x42, "/heart$"}, {0x65, 0x42, "/xin$"}, - {0x66, 0x43, "/break$"}, {0x66, 0x43, "/xs$"}, {0x66, 0x43, "/broken_heart$"}, - {0x67, 0x35, "/cake$"}, {0x67, 0x35, "/dg$"}, - {0x9c, 0x36, "/li$"}, {0x9c, 0x36, "/shd$"}, {0x9c, 0x36, "/lightning$"}, - {0x9d, 0x37, "/bome$"}, {0x9d, 0x37, "/zhd$"}, {0x9d, 0x37, "/bomb$"}, - {0x9e, 0x38, "/kn$"}, {0x9e, 0x38, "/dao$"}, {0x9e, 0x38, "/knife$"}, - {0x5e, 0x39, "/footb$"}, {0x5e, 0x39, "/zq$"}, {0x5e, 0x39, "/soccer$"}, - {0xb6, 0x75, "/ladybug$"}, {0xb6, 0x75, "/pch$"}, - {0x89, 0x3B, "/shit$"}, {0x89, 0x3B, "/bb$"}, - {0x6e, 0x4B, "/moon$"}, {0x6e, 0x4B, "/yl$"}, - {0x6b, 0x4A, "/sun$"}, {0x6b, 0x4A, "/ty$"}, - {0x68, 0x45, "/gift$"}, {0x68, 0x45, "/lw$"}, - {0x7f, 0x31, "/hug$"}, {0x7f, 0x31, "/yb$"}, - {0x6f, 0x4C, "/strong$"}, {0x6f, 0x4C, "/qiang$"}, {0x6f, 0x4C, "/thumbs_up$"}, - {0x70, 0x4D, "/weak$"}, {0x70, 0x4D, "/ruo$"}, {0x70, 0x4D, "/thumbs_down$"}, - {0x88, 0x4E, "/share$"}, {0x88, 0x4E, "/ws$"}, {0x88, 0x4E, "/handshake$"}, - {0xa0, 0x4F, "/victory$"}, {0xa0, 0x4F, "/shl$"}, {0xa0, 0x4F, "/v$"}, - {0xb7, 0x76, "/@)$"}, {0xb7, 0x76, "/bq$"}, - {0xb8, 0x77, "/jj$"}, {0xb8, 0x77, "/gy$"}, - {0xb9, 0x78, "/@@$"}, {0xb9, 0x78, "/qt$"}, - {0xba, 0x79, "/bad$"}, {0xba, 0x79, "/cj$"}, - {0xbb, 0x7A, "/loveu$"}, {0xbb, 0x7A, "/aini$"}, - {0xbc, 0x7B, "/no$"}, {0xbc, 0x7B, "/bu$"}, - {0xbd, 0x7C, "/ok$"}, {0xbd, 0x7C, "/hd$"}, - {0x5c, 0x2A, "/love$"}, {0x5c, 0x2A, "/aiq$"}, - {0x56, 0x55, "/$"}, {0x56, 0x55, "/fw$"}, {0x56, 0x55, "/blow_kiss$"}, - {0x58, 0x2B, "/jump$"}, {0x58, 0x2B, "/tiao$"}, - {0x5a, 0x29, "/shake$"}, {0x5a, 0x29, "/fad$"}, - {0x5b, 0x56, "/$"}, {0x5b, 0x56, "/oh$"}, {0x5b, 0x56, "/angry$"}, - {0xbe, 0x7D, "/circle$"}, {0xbe, 0x7D, "/zhq$"}, - {0xbf, 0x7E, "/kotow$"}, {0xbf, 0x7E, "/kt$"}, - {0xc0, 0x7F, "/turn$"}, {0xc0, 0x7F, "/ht$"}, - {0xc1, 0x80, "/skip$"}, {0xc1, 0x80, "/tsh$"}, - {0xc2, 0x81, "/oY$"}, {0xc2, 0x81, "/hsh$"}, - {0xc3, 0x82, "/#-O$"}, {0xc3, 0x82, "/jd$"}, - {0xc4, 0x83, "/hiphop$"}, {0xc4, 0x83, "/jw$"}, - {0xc5, 0x84, "/kiss$"}, {0xc5, 0x84, "/xw$"}, - {0xc6, 0x85, "/<&$"}, {0xc6, 0x85, "/zuotj$"}, - {0xc7, 0x86, "/&>$"}, {0xc7, 0x86, "/youtj$"}, - /* emotes below deprecated in QQ, but available on pidgin */ - {0x75, 0xA0 , "/:#$"}, {0x75, 0xA0 , "/feid$"}, {0x75, 0xA0 , "/SARS$"}, - {0x59, 0xA1 , "/go$"}, {0x59, 0xA1 , "/shan$"}, - {0x57, 0xA2 , "/find$"}, {0x57, 0xA2 , "/zhao$"}, {0x57, 0xA3 , "/search$"}, - {0x55, 0xA3 , "/&$"}, {0x55, 0xA3 , "/mm$"}, {0x55, 0xA3 , "/beautiful_eyebrows$"}, - {0x7d, 0xA4 , "/cat$"}, {0x7d, 0xA4 , "/maom$"}, - {0x7e, 0xA5 , "/dog$"}, {0x7e, 0xA5 , "/xg$"}, - {0x9a, 0xA6 , "/$$"}, {0x9a, 0xA6 , "/qianc$"}, {0x9a, 0xA6 , "/money$"}, - {0x9b, 0xA7 , "/(!)$"}, {0x9b, 0xA7 , "/dp$"}, {0x9b, 0xA7 , "/lightbulb$"}, - {0x60, 0xA8 , "/cup$"}, {0x60, 0xA8 , "/bei$"}, - {0x9f, 0xA9 , "/music$"}, {0x9f, 0xA9 , "/yy$"}, - {0x82, 0xAA , "/pill$"}, {0x82, 0xAA , "/yw$"}, - {0x64, 0xAB , "/kiss$"}, {0x64, 0xAB , "/wen$"}, - {0x83, 0xAC , "/meeting$"}, {0x83, 0xAC , "/hy$"}, - {0x84, 0xAD , "/phone$"}, {0x84, 0xAD , "/dh$"}, - {0x85, 0xAE , "/time$"}, {0x85, 0xAE , "/sj$"}, - {0x86, 0xAF , "/email$"}, {0x86, 0xAF , "/yj$"}, - {0x87, 0xB0 , "/tv$"}, {0x87, 0xB0 , "/ds$"}, - {0x50, 0xB1 , "/$"}, {0x50, 0xB1 , "/dd$"}, - {0x51, 0xB2 , "/$"}, {0x51, 0xB2 , "/mn$"}, {0x51, 0xB2 , "/beauty$"}, - {0x52, 0xB3 , "/$"}, {0x52, 0xB3 , "/hl$"}, - {0x53, 0xB4 , "/$"}, {0x53, 0xB4 , "/mamao$"}, - {0x54, 0xB5 , "/$"}, {0x54, 0xB5 , "/qz$"}, {0x54, 0xB5 , "/qq$"}, - {0x5d, 0xB6 , "/$"}, {0x5d, 0xB6 , "/bj$"}, {0x5d, 0xB6 , "/baijiu$"}, - {0x5f, 0xB7 , "/$"}, {0x5f, 0xB7 , "/qsh$"}, {0x5f, 0xB7 , "/soda$"}, - {0x69, 0xB8 , "/$"}, {0x69, 0xB8 , "/xy$"}, {0x69, 0xB8 , "/rain$"}, - {0x6a, 0xB9 , "/<~>$"}, {0x6a, 0xB9 , "/duoy$"}, {0x6a, 0xB9 , "/cloudy$"}, - {0x6c, 0xBA , "/$"}, {0x6c, 0xBA , "/xr$"}, {0x6c, 0xBA , "/snowman$"}, - {0x6d, 0xBB , "/<*>$"}, {0x6d, 0xBB , "/xixing$"}, {0x6d, 0xBB , "/star$"}, - {0x71, 0xBC , "/<00>$"}, {0x71, 0xBC , "/nv$"}, {0x71, 0xBC , "/woman$"}, - {0x72, 0xBD , "/<11>$"}, {0x72, 0xBD , "/nan$"}, {0x72, 0xBD , "/man$"}, - /* end */ + {0x4f, 0x0E, "/:)$"}, {0x4f, 0x0E, "/wx$"}, {0x4f, 0x0E, "/small_smile$"}, + {0x42, 0x01, "/:~$"}, {0x42, 0x01, "/pz$"}, {0x42, 0x01, "/curl_lip$"}, + {0x43, 0x02, "/:*$"}, {0x43, 0x02, "/se$"}, {0x43, 0x02, "/desire$"}, + {0x44, 0x03, "/:|$"}, {0x44, 0x03, "/fd$"}, {0x44, 0x03, "/dazed$"}, + {0x45, 0x04, "/8-)$"}, {0x45, 0x04, "/dy$"}, {0x45, 0x04, "/revel$"}, + {0x46, 0x05, "/:<$"}, {0x46, 0x05, "/ll$"}, {0x46, 0x05, "/cry$"}, + {0x47, 0x06, "/:$$"}, {0x47, 0x06, "/hx$"}, {0x47, 0x06, "/bashful$"}, + {0x48, 0x07, "/:x$"}, {0x48, 0x07, "/bz$"}, {0x48, 0x07, "/shut_mouth$"}, + {0x49, 0x08, "/:z$"}, {0x49, 0x08, "/shui$"}, {0x49, 0x08, "/sleep$"}, + {0x4a, 0x09, "/:'$"}, {0x4a, 0x09, "/dk$"}, {0x4a, 0x09, "/weep$"}, + {0x4b, 0x0A, "/:-|$"}, {0x4b, 0x0A, "/gg$"}, {0x4b, 0x0A, "/embarassed$"}, + {0x4c, 0x0B, "/:@$"}, {0x4c, 0x0B, "/fn$"}, {0x4c, 0x0B, "/pissed_off$"}, + {0x4d, 0x0C, "/:P$"}, {0x4d, 0x0C, "/tp$"}, {0x4d, 0x0C, "/act_up$"}, + {0x4e, 0x0D, "/:D$"}, {0x4e, 0x0D, "/cy$"}, {0x4e, 0x0D, "/toothy_smile$"}, + {0x41, 0x00, "/:O$"}, {0x41, 0x00, "/jy$"}, {0x41, 0x00, "/surprised$"}, + {0x73, 0x0F, "/:($"}, {0x73, 0x0F, "/ng$"}, {0x73, 0x0F, "/sad$"}, + {0x74, 0x10, "/:+$"}, {0x74, 0x10, "/kuk$"}, {0x74, 0x10, "/cool$"}, + {0xa1, 0x60, "/--b$"}, {0xa1, 0x60, "/lengh$"}, + {0x76, 0x12, "/:Q$"}, {0x76, 0x12, "/zk$"}, {0x76, 0x12, "/crazy$"}, + {0x77, 0x13, "/:t$"}, {0x77, 0x13, "/tu$"}, {0x77, 0x13, "/vomit$"}, + {0x8a, 0x13, "/;P$"}, {0x8a, 0x13, "/tx$"}, {0x8a, 0x13, "/titter$"}, + {0x8b, 0x14, "/;-D$"}, {0x8b, 0x14, "/ka$"}, {0x8b, 0x14, "/cute$"}, + {0x8c, 0x16, "/;d$"}, {0x8c, 0x16, "/baiy$"}, {0x8c, 0x16, "/disdain$"}, + {0x8d, 0x17, "/;o$"}, {0x8d, 0x17, "/am$"}, {0x8d, 0x17, "/arrogant$"}, + {0x8e, 0x18, "/:g$"}, {0x8e, 0x18, "/jie$"}, {0x8e, 0x18, "/starving$"}, + {0x8f, 0x19, "/|-)$"}, {0x8f, 0x19, "/kun$"}, {0x8f, 0x19, "/sleepy$"}, + {0x78, 0x1A, "/:!$"}, {0x78, 0x1A, "/jk$"}, {0x78, 0x1A, "/terror$"}, + {0x79, 0x1B, "/:L$"}, {0x79, 0x1B, "/lh$"}, {0x79, 0x1B, "/sweat$"}, + {0x7a, 0x1C, "/:>$"}, {0x7a, 0x1C, "/hanx$"}, {0x7a, 0x1C, "/smirk$"}, + {0x7b, 0x1D, "/:;$"}, {0x7b, 0x1D, "/db$"}, {0x7b, 0x1D, "/soldier$"}, + {0x90, 0x1E, "/;f$"}, {0x90, 0x1E, "/fendou$"}, {0x90, 0x1E, "/struggle$"}, + {0x91, 0x1F, "/:-S$"}, {0x91, 0x1F, "/zhm$"}, {0x91, 0x1F, "/curse$"}, + {0x92, 0x20, "/?$"}, {0x92, 0x20, "/yiw$"}, {0x92, 0x20, "/question$"}, + {0x93, 0x21, "/;x$"}, {0x93, 0x21, "/xu$"}, {0x93, 0x21, "/shh$"}, + {0x94, 0x22, "/;@$"}, {0x94, 0x22, "/yun$"}, {0x94, 0x22, "/dizzy$"}, + {0x95, 0x23, "/:8$"}, {0x95, 0x23, "/zhem$"}, {0x95, 0x23, "/excrutiating$"}, + {0x96, 0x24, "/;!$"}, {0x96, 0x24, "/shuai$"}, {0x96, 0x24, "/freaked_out$"}, + {0x97, 0x25, "/!!!$"}, {0x97, 0x25, "/kl$"}, {0x97, 0x25, "/skeleton$"}, + {0x98, 0x26, "/xx$"}, {0x98, 0x26, "/qiao$"}, {0x98, 0x26, "/hammer$"}, + {0x99, 0x27, "/bye$"}, {0x99, 0x27, "/zj$"}, + {0xa2, 0x61, "/wipe$"}, {0xa2, 0x61, "/ch$"}, + {0xa3, 0x62, "/dig$"}, {0xa3, 0x62, "/kb$"}, + {0xa4, 0x63, "/handclap$"},{0xa4, 0x63, "/gz$"}, + {0xa5, 0x64, "/&-($"}, {0xa5, 0x64, "/qd$"}, + {0xa6, 0x65, "/B-)$"}, {0xa6, 0x65, "/huaix$"}, + {0xa7, 0x66, "/<@$"}, {0xa7, 0x66, "/zhh$"}, + {0xa8, 0x67, "/@>$"}, {0xa8, 0x67, "/yhh$"}, + {0xa9, 0x68, "/:-O$"}, {0xa9, 0x68, "/hq$"}, + {0xaa, 0x69, "/>-|$"}, {0xaa, 0x69, "/bs$"}, + {0xab, 0x6A, "/P-($"}, {0xab, 0x6A, "/wq$"}, + {0xac, 0x6B, "/:'|$"}, {0xac, 0x6B, "/kk$"}, + {0xad, 0x6C, "/X-)$"}, {0xad, 0x6C, "/yx$"}, + {0xae, 0x6D, "/:*$"}, {0xae, 0x6D, "/qq$"}, + {0xaf, 0x6E, "/@x$"}, {0xaf, 0x6E, "/xia$"}, + {0xb0, 0x6F, "/8*$"}, {0xb0, 0x6F, "/kel$"}, + {0xb1, 0x70, "/pd$"}, {0xb1, 0x70, "/cd$"}, + {0x61, 0x59, "/$"}, {0x61, 0x59, "/xig$"}, {0x61, 0x59, "/watermelon$"}, + {0xb2, 0x71, "/beer$"}, {0xb2, 0x71, "/pj$"}, + {0xb3, 0x72, "/basketb$"}, {0xb3, 0x72, "/lq$"}, + {0xb4, 0x73, "/oo$"}, {0xb4, 0x73, "/pp$"}, + {0x80, 0x3C, "/coffee$"}, {0x80, 0x3C, "/kf$"}, + {0x81, 0x3D, "/eat$"}, {0x81, 0x3D, "/fan$"}, + {0x7c, 0x2E, "/pig$"}, {0x7c, 0x2E, "/zt$"}, + {0x62, 0x3F, "/rose$"}, {0x62, 0x3F, "/mg$"}, + {0x63, 0x40, "/fade$"}, {0x63, 0x40, "/dx$"}, {0x63, 0x40, "/wilt$"}, + {0xb5, 0x74, "/showlove$"},{0xb5, 0x74, "/sa$"}, + {0x65, 0x42, "/heart$"}, {0x65, 0x42, "/xin$"}, + {0x66, 0x43, "/break$"}, {0x66, 0x43, "/xs$"}, {0x66, 0x43, "/broken_heart$"}, + {0x67, 0x35, "/cake$"}, {0x67, 0x35, "/dg$"}, + {0x9c, 0x36, "/li$"}, {0x9c, 0x36, "/shd$"}, {0x9c, 0x36, "/lightning$"}, + {0x9d, 0x37, "/bome$"}, {0x9d, 0x37, "/zhd$"}, {0x9d, 0x37, "/bomb$"}, + {0x9e, 0x38, "/kn$"}, {0x9e, 0x38, "/dao$"}, {0x9e, 0x38, "/knife$"}, + {0x5e, 0x39, "/footb$"}, {0x5e, 0x39, "/zq$"}, {0x5e, 0x39, "/soccer$"}, + {0xb6, 0x75, "/ladybug$"}, {0xb6, 0x75, "/pch$"}, + {0x89, 0x3B, "/shit$"}, {0x89, 0x3B, "/bb$"}, + {0x6e, 0x4B, "/moon$"}, {0x6e, 0x4B, "/yl$"}, + {0x6b, 0x4A, "/sun$"}, {0x6b, 0x4A, "/ty$"}, + {0x68, 0x45, "/gift$"}, {0x68, 0x45, "/lw$"}, + {0x7f, 0x31, "/hug$"}, {0x7f, 0x31, "/yb$"}, + {0x6f, 0x4C, "/strong$"}, {0x6f, 0x4C, "/qiang$"}, {0x6f, 0x4C, "/thumbs_up$"}, + {0x70, 0x4D, "/weak$"}, {0x70, 0x4D, "/ruo$"}, {0x70, 0x4D, "/thumbs_down$"}, + {0x88, 0x4E, "/share$"}, {0x88, 0x4E, "/ws$"}, {0x88, 0x4E, "/handshake$"}, + {0xa0, 0x4F, "/victory$"}, {0xa0, 0x4F, "/shl$"}, {0xa0, 0x4F, "/v$"}, + {0xb7, 0x76, "/@)$"}, {0xb7, 0x76, "/bq$"}, + {0xb8, 0x77, "/jj$"}, {0xb8, 0x77, "/gy$"}, + {0xb9, 0x78, "/@@$"}, {0xb9, 0x78, "/qt$"}, + {0xba, 0x79, "/bad$"}, {0xba, 0x79, "/cj$"}, + {0xbb, 0x7A, "/loveu$"}, {0xbb, 0x7A, "/aini$"}, + {0xbc, 0x7B, "/no$"}, {0xbc, 0x7B, "/bu$"}, + {0xbd, 0x7C, "/ok$"}, {0xbd, 0x7C, "/hd$"}, + {0x5c, 0x2A, "/love$"}, {0x5c, 0x2A, "/aiq$"}, + {0x56, 0x55, "/$"}, {0x56, 0x55, "/fw$"}, {0x56, 0x55, "/blow_kiss$"}, + {0x58, 0x2B, "/jump$"}, {0x58, 0x2B, "/tiao$"}, + {0x5a, 0x29, "/shake$"}, {0x5a, 0x29, "/fad$"}, + {0x5b, 0x56, "/$"}, {0x5b, 0x56, "/oh$"}, {0x5b, 0x56, "/angry$"}, + {0xbe, 0x7D, "/circle$"}, {0xbe, 0x7D, "/zhq$"}, + {0xbf, 0x7E, "/kotow$"}, {0xbf, 0x7E, "/kt$"}, + {0xc0, 0x7F, "/turn$"}, {0xc0, 0x7F, "/ht$"}, + {0xc1, 0x80, "/skip$"}, {0xc1, 0x80, "/tsh$"}, + {0xc2, 0x81, "/oY$"}, {0xc2, 0x81, "/hsh$"}, + {0xc3, 0x82, "/#-O$"}, {0xc3, 0x82, "/jd$"}, + {0xc4, 0x83, "/hiphop$"}, {0xc4, 0x83, "/jw$"}, + {0xc5, 0x84, "/kiss$"}, {0xc5, 0x84, "/xw$"}, + {0xc6, 0x85, "/<&$"}, {0xc6, 0x85, "/zuotj$"}, + {0xc7, 0x86, "/&>$"}, {0xc7, 0x86, "/youtj$"}, + /* emotes below deprecated in QQ, but available on pidgin */ + {0x75, 0xA0 , "/:#$"}, {0x75, 0xA0 , "/feid$"}, {0x75, 0xA0 , "/SARS$"}, + {0x59, 0xA1 , "/go$"}, {0x59, 0xA1 , "/shan$"}, + {0x57, 0xA2 , "/find$"}, {0x57, 0xA2 , "/zhao$"}, {0x57, 0xA3 , "/search$"}, + {0x55, 0xA3 , "/&$"}, {0x55, 0xA3 , "/mm$"}, {0x55, 0xA3 , "/beautiful_eyebrows$"}, + {0x7d, 0xA4 , "/cat$"}, {0x7d, 0xA4 , "/maom$"}, + {0x7e, 0xA5 , "/dog$"}, {0x7e, 0xA5 , "/xg$"}, + {0x9a, 0xA6 , "/$$"}, {0x9a, 0xA6 , "/qianc$"}, {0x9a, 0xA6 , "/money$"}, + {0x9b, 0xA7 , "/(!)$"}, {0x9b, 0xA7 , "/dp$"}, {0x9b, 0xA7 , "/lightbulb$"}, + {0x60, 0xA8 , "/cup$"}, {0x60, 0xA8 , "/bei$"}, + {0x9f, 0xA9 , "/music$"}, {0x9f, 0xA9 , "/yy$"}, + {0x82, 0xAA , "/pill$"}, {0x82, 0xAA , "/yw$"}, + {0x64, 0xAB , "/kiss$"}, {0x64, 0xAB , "/wen$"}, + {0x83, 0xAC , "/meeting$"}, {0x83, 0xAC , "/hy$"}, + {0x84, 0xAD , "/phone$"}, {0x84, 0xAD , "/dh$"}, + {0x85, 0xAE , "/time$"}, {0x85, 0xAE , "/sj$"}, + {0x86, 0xAF , "/email$"}, {0x86, 0xAF , "/yj$"}, + {0x87, 0xB0 , "/tv$"}, {0x87, 0xB0 , "/ds$"}, + {0x50, 0xB1 , "/$"}, {0x50, 0xB1 , "/dd$"}, + {0x51, 0xB2 , "/$"}, {0x51, 0xB2 , "/mn$"}, {0x51, 0xB2 , "/beauty$"}, + {0x52, 0xB3 , "/$"}, {0x52, 0xB3 , "/hl$"}, + {0x53, 0xB4 , "/$"}, {0x53, 0xB4 , "/mamao$"}, + {0x54, 0xB5 , "/$"}, {0x54, 0xB5 , "/qz$"}, {0x54, 0xB5 , "/qq$"}, + {0x5d, 0xB6 , "/$"}, {0x5d, 0xB6 , "/bj$"}, {0x5d, 0xB6 , "/baijiu$"}, + {0x5f, 0xB7 , "/$"}, {0x5f, 0xB7 , "/qsh$"}, {0x5f, 0xB7 , "/soda$"}, + {0x69, 0xB8 , "/$"}, {0x69, 0xB8 , "/xy$"}, {0x69, 0xB8 , "/rain$"}, + {0x6a, 0xB9 , "/<~>$"}, {0x6a, 0xB9 , "/duoy$"}, {0x6a, 0xB9 , "/cloudy$"}, + {0x6c, 0xBA , "/$"}, {0x6c, 0xBA , "/xr$"}, {0x6c, 0xBA , "/snowman$"}, + {0x6d, 0xBB , "/<*>$"}, {0x6d, 0xBB , "/xixing$"}, {0x6d, 0xBB , "/star$"}, + {0x71, 0xBC , "/<00>$"}, {0x71, 0xBC , "/nv$"}, {0x71, 0xBC , "/woman$"}, + {0x72, 0xBD , "/<11>$"}, {0x72, 0xBD , "/nan$"}, {0x72, 0xBD , "/man$"}, + /* end */ {0, 0, NULL} }; gint emoticons_num = sizeof(emoticons) / sizeof(qq_emoticon) - 1; /* Map for qq smiley convert to purple */ static qq_emoticon emoticons_sym[] = { - {0x41, 0x00, "/jy$"}, - {0x42, 0x01, "/pz$"}, - {0x43, 0x02, "/se$"}, - {0x44, 0x03, "/fd$"}, - {0x45, 0x04, "/dy$"}, - {0x46, 0x05, "/ll$"}, - {0x47, 0x06, "/hx$"}, - {0x48, 0x07, "/bz$"}, - {0x49, 0x08, "/shui$"}, - {0x4a, 0x09, "/dk$"}, - {0x4b, 0x0A, "/gg$"}, - {0x4c, 0x0B, "/fn$"}, - {0x4d, 0x0C, "/tp$"}, - {0x4e, 0x0D, "/cy$"}, - {0x4f, 0x0E, "/wx$"}, - {0x50, 0xB1 , "/dd$"}, - {0x51, 0xB2 , "/mn$"}, - {0x52, 0xB3 , "/hl$"}, - {0x53, 0xB4 , "/mamao$"}, - {0x54, 0xB5 , "/qq$"}, - {0x55, 0xA3 , "/mm$"}, - {0x56, 0x55, "/fw$"}, - {0x57, 0xA3 , "/zhao$"}, - {0x58, 0x2B, "/tiao$"}, - {0x59, 0xA1 , "/shan$"}, - {0x5a, 0x29, "/fad$"}, - {0x5b, 0x56, "/oh$"}, - {0x5c, 0x2A, "/aiq$"}, - {0x5e, 0x39, "/zq$"}, - {0x5d, 0xB6 , "/bj$"}, - {0x5f, 0xB7 , "/qsh$"}, - {0x60, 0xA8 , "/bei$"}, - {0x61, 0x59, "/xig$"}, - {0x62, 0x3F, "/mg$"}, - {0x63, 0x40, "/dx$"}, - {0x64, 0xAB , "/wen$"}, - {0x65, 0x42, "/xin$"}, - {0x66, 0x43, "/xs$"}, - {0x67, 0x35, "/dg$"}, - {0x68, 0x45, "/lw$"}, - {0x69, 0xB8 , "/xy$"}, - {0x6a, 0xB9 , "/duoy$"}, - {0x6b, 0x4A, "/ty$"}, - {0x6c, 0xBA , "/xr$"}, - {0x6d, 0xBB , "/xixing$"}, - {0x6e, 0x4B, "/yl$"}, - {0x6f, 0x4C, "/qiang$"}, - {0x70, 0x4D, "/ruo$"}, - {0x71, 0xBC , "/nv$"}, - {0x72, 0xBD , "/nan$"}, - {0x73, 0x0F, "/ng$"}, - {0x74, 0x10, "/kuk$"}, - {0x75, 0xA0 , "/feid$"}, - {0x76, 0x12, "/zk$"}, - {0x77, 0x13, "/tu$"}, - {0x78, 0x1A, "/jk$"}, - {0x79, 0x1B, "/lh$"}, - {0x7a, 0x1C, "/hanx$"}, - {0x7b, 0x1D, "/db$"}, - {0x7c, 0x2E, "/zt$"}, - {0x7d, 0xA4 , "/maom$"}, - {0x7e, 0xA5 , "/xg$"}, - {0x7f, 0x31, "/yb$"}, - {0x80, 0x3C, "/kf$"}, - {0x81, 0x3D, "/fan$"}, - {0x82, 0xAA , "/yw$"}, - {0x83, 0xAC , "/hy$"}, - {0x84, 0xAD , "/dh$"}, - {0x85, 0xAE , "/sj$"}, - {0x86, 0xAF , "/yj$"}, - {0x87, 0xB0 , "/ds$"}, - {0x88, 0x4E, "/ws$"}, - {0x89, 0x3B, "/bb$"}, - {0x8a, 0x13, "/tx$"}, - {0x8b, 0x14, "/ka$"}, - {0x8c, 0x16, "/baiy$"}, - {0x8d, 0x17, "/am$"}, - {0x8e, 0x18, "/jie$"}, - {0x8f, 0x19, "/kun$"}, - {0x90, 0x1E, "/fendou$"}, - {0x91, 0x1F, "/zhm$"}, - {0x92, 0x20, "/yiw$"}, - {0x93, 0x21, "/xu$"}, - {0x94, 0x22, "/yun$"}, - {0x95, 0x23, "/zhem$"}, - {0x96, 0x24, "/shuai$"}, - {0x97, 0x25, "/kl$"}, - {0x98, 0x26, "/qiao$"}, - {0x99, 0x27, "/zj$"}, - {0x9a, 0xA6 , "/qianc$"}, - {0x9b, 0xA7 , "/dp$"}, - {0x9c, 0x36, "/shd$"}, - {0x9d, 0x37, "/zhd$"}, + {0x41, 0x00, "/jy$"}, + {0x42, 0x01, "/pz$"}, + {0x43, 0x02, "/se$"}, + {0x44, 0x03, "/fd$"}, + {0x45, 0x04, "/dy$"}, + {0x46, 0x05, "/ll$"}, + {0x47, 0x06, "/hx$"}, + {0x48, 0x07, "/bz$"}, + {0x49, 0x08, "/shui$"}, + {0x4a, 0x09, "/dk$"}, + {0x4b, 0x0A, "/gg$"}, + {0x4c, 0x0B, "/fn$"}, + {0x4d, 0x0C, "/tp$"}, + {0x4e, 0x0D, "/cy$"}, + {0x4f, 0x0E, "/wx$"}, + {0x50, 0xB1 , "/dd$"}, + {0x51, 0xB2 , "/mn$"}, + {0x52, 0xB3 , "/hl$"}, + {0x53, 0xB4 , "/mamao$"}, + {0x54, 0xB5 , "/qq$"}, + {0x55, 0xA3 , "/mm$"}, + {0x56, 0x55, "/fw$"}, + {0x57, 0xA3 , "/zhao$"}, + {0x58, 0x2B, "/tiao$"}, + {0x59, 0xA1 , "/shan$"}, + {0x5a, 0x29, "/fad$"}, + {0x5b, 0x56, "/oh$"}, + {0x5c, 0x2A, "/aiq$"}, + {0x5e, 0x39, "/zq$"}, + {0x5d, 0xB6 , "/bj$"}, + {0x5f, 0xB7 , "/qsh$"}, + {0x60, 0xA8 , "/bei$"}, + {0x61, 0x59, "/xig$"}, + {0x62, 0x3F, "/mg$"}, + {0x63, 0x40, "/dx$"}, + {0x64, 0xAB , "/wen$"}, + {0x65, 0x42, "/xin$"}, + {0x66, 0x43, "/xs$"}, + {0x67, 0x35, "/dg$"}, + {0x68, 0x45, "/lw$"}, + {0x69, 0xB8 , "/xy$"}, + {0x6a, 0xB9 , "/duoy$"}, + {0x6b, 0x4A, "/ty$"}, + {0x6c, 0xBA , "/xr$"}, + {0x6d, 0xBB , "/xixing$"}, + {0x6e, 0x4B, "/yl$"}, + {0x6f, 0x4C, "/qiang$"}, + {0x70, 0x4D, "/ruo$"}, + {0x71, 0xBC , "/nv$"}, + {0x72, 0xBD , "/nan$"}, + {0x73, 0x0F, "/ng$"}, + {0x74, 0x10, "/kuk$"}, + {0x75, 0xA0 , "/feid$"}, + {0x76, 0x12, "/zk$"}, + {0x77, 0x13, "/tu$"}, + {0x78, 0x1A, "/jk$"}, + {0x79, 0x1B, "/lh$"}, + {0x7a, 0x1C, "/hanx$"}, + {0x7b, 0x1D, "/db$"}, + {0x7c, 0x2E, "/zt$"}, + {0x7d, 0xA4 , "/maom$"}, + {0x7e, 0xA5 , "/xg$"}, + {0x7f, 0x31, "/yb$"}, + {0x80, 0x3C, "/kf$"}, + {0x81, 0x3D, "/fan$"}, + {0x82, 0xAA , "/yw$"}, + {0x83, 0xAC , "/hy$"}, + {0x84, 0xAD , "/dh$"}, + {0x85, 0xAE , "/sj$"}, + {0x86, 0xAF , "/yj$"}, + {0x87, 0xB0 , "/ds$"}, + {0x88, 0x4E, "/ws$"}, + {0x89, 0x3B, "/bb$"}, + {0x8a, 0x13, "/tx$"}, + {0x8b, 0x14, "/ka$"}, + {0x8c, 0x16, "/baiy$"}, + {0x8d, 0x17, "/am$"}, + {0x8e, 0x18, "/jie$"}, + {0x8f, 0x19, "/kun$"}, + {0x90, 0x1E, "/fendou$"}, + {0x91, 0x1F, "/zhm$"}, + {0x92, 0x20, "/yiw$"}, + {0x93, 0x21, "/xu$"}, + {0x94, 0x22, "/yun$"}, + {0x95, 0x23, "/zhem$"}, + {0x96, 0x24, "/shuai$"}, + {0x97, 0x25, "/kl$"}, + {0x98, 0x26, "/qiao$"}, + {0x99, 0x27, "/zj$"}, + {0x9a, 0xA6 , "/qianc$"}, + {0x9b, 0xA7 , "/dp$"}, + {0x9c, 0x36, "/shd$"}, + {0x9d, 0x37, "/zhd$"}, {0x9e, 0x38, "/dao$"}, {0x9f, 0xA9 , "/yy$"}, {0xa0, 0x4F, "/shl$"}, - {0xa1, 0x60, "/lengh$"}, - {0xa2, 0x61, "/ch$"}, - {0xa3, 0x62, "/kb$"}, - {0xa4, 0x63, "/gz$"}, - {0xa5, 0x64, "/qd$"}, - {0xa6, 0x65, "/huaix$"}, - {0xa7, 0x66, "/zhh$"}, - {0xa8, 0x67, "/yhh$"}, - {0xa9, 0x68, "/hq$"}, - {0xaa, 0x69, "/bs$"}, - {0xab, 0x6A, "/wq$"}, - {0xac, 0x6B, "/kk$"}, - {0xad, 0x6C, "/yx$"}, - {0xae, 0x6D, "/qq$"}, - {0xaf, 0x6E, "/xia$"}, - {0xb0, 0x6F, "/kel$"}, - {0xb1, 0x70, "/cd$"}, - {0xb2, 0x71, "/pj$"}, - {0xb3, 0x72, "/lq$"}, - {0xb4, 0x73, "/pp$"}, - {0xb5, 0x74, "/sa$"}, - {0xb6, 0x75, "/pch$"}, - {0xb7, 0x76, "/bq$"}, - {0xb8, 0x77, "/gy$"}, - {0xb9, 0x78, "/qt$"}, - {0xba, 0x79, "/cj$"}, - {0xbb, 0x7A, "/aini$"}, - {0xbc, 0x7B, "/bu$"}, - {0xbd, 0x7C, "/hd$"}, - {0xbe, 0x7D, "/zhq$"}, - {0xbf, 0x7E, "/kt$"}, - {0xc0, 0x7F, "/ht$"}, - {0xc1, 0x80, "/tsh$"}, - {0xc2, 0x81, "/hsh$"}, - {0xc3, 0x82, "/jd$"}, - {0xc4, 0x83, "/jw$"}, - {0xc5, 0x84, "/xw$"}, - {0xc6, 0x85, "/zuotj$"}, + {0xa1, 0x60, "/lengh$"}, + {0xa2, 0x61, "/ch$"}, + {0xa3, 0x62, "/kb$"}, + {0xa4, 0x63, "/gz$"}, + {0xa5, 0x64, "/qd$"}, + {0xa6, 0x65, "/huaix$"}, + {0xa7, 0x66, "/zhh$"}, + {0xa8, 0x67, "/yhh$"}, + {0xa9, 0x68, "/hq$"}, + {0xaa, 0x69, "/bs$"}, + {0xab, 0x6A, "/wq$"}, + {0xac, 0x6B, "/kk$"}, + {0xad, 0x6C, "/yx$"}, + {0xae, 0x6D, "/qq$"}, + {0xaf, 0x6E, "/xia$"}, + {0xb0, 0x6F, "/kel$"}, + {0xb1, 0x70, "/cd$"}, + {0xb2, 0x71, "/pj$"}, + {0xb3, 0x72, "/lq$"}, + {0xb4, 0x73, "/pp$"}, + {0xb5, 0x74, "/sa$"}, + {0xb6, 0x75, "/pch$"}, + {0xb7, 0x76, "/bq$"}, + {0xb8, 0x77, "/gy$"}, + {0xb9, 0x78, "/qt$"}, + {0xba, 0x79, "/cj$"}, + {0xbb, 0x7A, "/aini$"}, + {0xbc, 0x7B, "/bu$"}, + {0xbd, 0x7C, "/hd$"}, + {0xbe, 0x7D, "/zhq$"}, + {0xbf, 0x7E, "/kt$"}, + {0xc0, 0x7F, "/ht$"}, + {0xc1, 0x80, "/tsh$"}, + {0xc2, 0x81, "/hsh$"}, + {0xc3, 0x82, "/jd$"}, + {0xc4, 0x83, "/jw$"}, + {0xc5, 0x84, "/xw$"}, + {0xc6, 0x85, "/zuotj$"}, {0xc7, 0x86, "/youtj$"}, {0, 0, NULL} }; @@ -512,8 +512,8 @@ void qq_im_fmt_free(qq_im_format *fmt) qq_im_format *qq_im_fmt_new_default(void) { qq_im_format *fmt; - const gchar Tahoma[] = { - 0x54, 0x61, 0x68, 0x6F, 0x6D, 0x61, 0x00 + const gchar Tahoma[] = { + 0x54, 0x61, 0x68, 0x6F, 0x6D, 0x61, 0x00 }; fmt = g_new0(qq_im_format, 1); memset(fmt, 0, sizeof(qq_im_format)); @@ -1064,8 +1064,8 @@ static void request_send_im(PurpleConnection *gc, guint32 uid_to, guint8 type, q guint8 raw_data[1024]; gint bytes; static guint8 fill[] = { - 0x00, 0x00, 0x00, 0x0D, - 0x00, 0x01, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x0D, + 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x01 }; @@ -1111,9 +1111,9 @@ static void request_send_im(PurpleConnection *gc, guint32 uid_to, guint8 type, q /* "MSG" */ bytes += qq_put32(raw_data + bytes, 0x4D534700); bytes += qq_put32(raw_data + bytes, 0x00000000); - bytes += qq_puttime(raw_data + bytes, &send_time); - /* Likely a random int */ - srand((unsigned)send_time); + bytes += qq_puttime(raw_data + bytes, &send_time); + /* Likely a random int */ + srand((unsigned)send_time); bytes += qq_put32(raw_data + bytes, (rand() & 0x7fff) | ((rand() & 0x7fff) << 15)); /* font attr set */ bytes += qq_put8(raw_data + bytes, 0x00); @@ -1358,30 +1358,30 @@ static GSList* qq_grab_emoticons(const char *msg, const char*username) */ unsigned int qq_send_typing( PurpleConnection *gc, const char *who, PurpleTypingState state ) -{ - qq_data *qd; +{ + qq_data *qd; guint8 raw_data[16]; - gint bytes; - guint32 uid_to=0; - + gint bytes; + guint32 uid_to=0; + g_return_val_if_fail(NULL != gc && NULL != gc->proto_data, -1); g_return_val_if_fail(who != NULL, -1); - qd = (qq_data *) gc->proto_data; - - if (state != PURPLE_TYPING) - return 0; - - uid_to = purple_name_to_uid(who); - - if (uid_to==qd->uid) - { - /* We'll just fake it, since we're sending to ourself. */ - serv_got_typing(gc, who, 7, PURPLE_TYPING); - - return 7; - } - + qd = (qq_data *) gc->proto_data; + + if (state != PURPLE_TYPING) + return 0; + + uid_to = purple_name_to_uid(who); + + if (uid_to==qd->uid) + { + /* We'll just fake it, since we're sending to ourself. */ + serv_got_typing(gc, who, 7, PURPLE_TYPING); + + return 7; + } + if (!uid_to) { return 0; @@ -1394,10 +1394,10 @@ unsigned int qq_send_typing( PurpleConnection *gc, const char *who, PurpleTyping bytes += qq_put8(raw_data + bytes, 0); /* qq_show_packet("QQ_CMD_SEND_TYPING", raw_data, bytes); */ - qq_send_cmd(gc, QQ_CMD_SEND_TYPING, raw_data, bytes); - } + qq_send_cmd(gc, QQ_CMD_SEND_TYPING, raw_data, bytes); + } - return 7; + return 7; } gint qq_send_im(PurpleConnection *gc, const gchar *who, const gchar *what, PurpleMessageFlags flags) diff --git a/qq.c b/qq.c index 3500e81..ae9b9e0 100644 --- a/qq.c +++ b/qq.c @@ -57,13 +57,16 @@ #include "utils.h" #include "version.h" -#define LIBQQ_VERSION "0.71" +#define LIBQQ_VERSION "0.72" static GList *server_list_build(gchar select) { GList *list = NULL; if ( select == 'T' || select == 'A') { + list = g_list_append(list, "219.133.60.173:443"); + list = g_list_append(list, "219.133.49.125:443"); + list = g_list_append(list, "58.60.15.33:443"); list = g_list_append(list, "tcpconn.tencent.com:8000"); list = g_list_append(list, "tcpconn2.tencent.com:8000"); list = g_list_append(list, "tcpconn3.tencent.com:8000"); @@ -72,6 +75,9 @@ static GList *server_list_build(gchar select) list = g_list_append(list, "tcpconn6.tencent.com:8000"); } if ( select == 'U' || select == 'A') { + list = g_list_append(list, "219.133.49.171:8000"); + list = g_list_append(list, "58.60.14.37:8000"); + list = g_list_append(list, "219.133.60.36:8000"); list = g_list_append(list, "sz.tencent.com:8000"); list = g_list_append(list, "sz2.tencent.com:8000"); list = g_list_append(list, "sz3.tencent.com:8000"); @@ -157,15 +163,23 @@ static void qq_login(PurpleAccount *account) purple_debug_info("QQ", "Server list has %d\n", g_list_length(qd->servers)); version_str = purple_account_get_string(account, "client_version", NULL); - qd->client_tag = QQ_CLIENT_1E0D; /* set default as QQ2010 */ - qd->client_version = 2010; + qd->client_tag = QQ_CLIENT_2227; /* set default as QQ2011 */ + qd->client_version = 2011; if (version_str != NULL && strlen(version_str) != 0) { if (strcmp(version_str, "qq2010") == 0) { qd->client_tag = QQ_CLIENT_1E0D; qd->client_version = 2010; } - } - + if (strcmp(version_str, "qq2011") == 0) { + qd->client_tag = QQ_CLIENT_2227; + qd->client_version = 2011; + } + if (strcmp(version_str, "qq2012") == 0) { + qd->client_tag = QQ_CLIENT_2227; + qd->client_version = 2012; + } + } + qd->is_show_notice = purple_account_get_bool(account, "show_notice", TRUE); qd->is_show_news = purple_account_get_bool(account, "show_news", TRUE); @@ -368,8 +382,8 @@ static void qq_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gbo if (bd->comm_flag & QQ_COMM_FLAG_VIDEO) { g_string_append( str, _(" Video") ); } - if (bd->ext_flag & QQ_EXT_FLAG_ZONE) { - g_string_append( str, _(" Zone") ); + if (bd->ext_flag & QQ_EXT_FLAG_ZONE) { + g_string_append( str, _(" Zone") ); } purple_notify_user_info_add_pair(user_info, _("Flag"), str->str); @@ -662,6 +676,7 @@ static void action_about_libqq(PurplePluginAction *action) g_string_append(info, "icesky : maintainer since 2007
\n"); g_string_append(info, "csyfek : faces, maintainer since 2007
\n"); g_string_append(info, "V.E.O : maintainer since 2011, OpenQ rename to LibQQ
\n"); + g_string_append(info, "cnangel : maintainer since 2012
\n"); g_string_append(info, "
\n"); g_string_append(info, _("

Lovely Patch Writers:
\n")); @@ -684,7 +699,8 @@ static void action_about_libqq(PurplePluginAction *action) g_string_append(info, "Pidgin Team : http://www.pidgin.im
\n"); g_string_append(info, "Huang Guan : http://home.xxsyzx.com
\n"); g_string_append(info, "OpenQ Google Group : http://groups.google.com/group/openq
\n"); - g_string_append(info, "LibQQ Google code : http://libqq-pidgin.googlecode.com
\n"); + g_string_append(info, "LibQQ Google Code : http://libqq-pidgin.googlecode.com
\n"); + g_string_append(info, "LibQQ Github Code : https://github.com/cnangel/pidgin-libqq
\n"); g_string_append(info, "
\n"); g_string_append(info, _("

Scrupulous Testers:
\n")); @@ -1198,6 +1214,16 @@ static void init_plugin(PurplePlugin *plugin) kvp->value = g_strdup("qq2010"); version_kv_list = g_list_append(version_kv_list, kvp); + kvp = g_new0(PurpleKeyValuePair, 1); + kvp->key = g_strdup(_("QQ2011")); + kvp->value = g_strdup("qq2011"); + version_kv_list = g_list_append(version_kv_list, kvp); + + kvp = g_new0(PurpleKeyValuePair, 1); + kvp->key = g_strdup(_("QQ2012")); + kvp->value = g_strdup("qq2012"); + version_kv_list = g_list_append(version_kv_list, kvp); + option = purple_account_option_list_new(_("Client Version"), "client_version", version_kv_list); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); diff --git a/qq.h b/qq.h index 42c10d8..254ab03 100644 --- a/qq.h +++ b/qq.h @@ -63,6 +63,7 @@ struct _qq_login_data { guint8 pwd_md5[QQ_KEY_LENGTH]; /* password in md5 (or md5' md5) */ guint8 pwd_twice_md5[QQ_KEY_LENGTH]; + guint8 pwd_qq_md5[QQ_KEY_LENGTH]; guint8 **token_auth; guint16 token_auth_len[4]; diff --git a/qq_base.c b/qq_base.c index 0c40b1d..dcaad4c 100644 --- a/qq_base.c +++ b/qq_base.c @@ -594,7 +594,8 @@ void qq_request_auth(PurpleConnection *gc) qd->ld.keys[4][i] = (guint8) (rand() & 0xff); bytes += qq_putdata(raw_data +bytes, qd->ld.keys[4], sizeof(qd->ld.keys[4])); - encrypted_len = qq_encrypt(encrypted, raw_data, bytes, qd->ld.pwd_twice_md5); +// encrypted_len = qq_encrypt(encrypted, raw_data, bytes, qd->ld.pwd_twice_md5); + encrypted_len = qq_encrypt(encrypted, raw_data, bytes, qd->ld.pwd_qq_md5); /* create packet */ bytes = 0; diff --git a/qq_base.h b/qq_base.h index b7338c5..eecacd5 100644 --- a/qq_base.h +++ b/qq_base.h @@ -48,9 +48,9 @@ static guint8 header_fill[] = { }; static guint8 touch_fill[] = { - 0x00, 0x01, - 0x00, 0x00, 0x04, 0x09, 0x01, 0xE0, /* touch Data1*/ - 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0B, 0xC5 /* touch Data2 */ + 0x00, 0x01, + 0x00, 0x00, 0x08, 0x04, 0x01, 0xE0, /* touch Data1 LOCALE */ + 0x00, 0x00, 0x03, 0x50, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0D, 0x6F /* touch Data2 VERSION_SPEC */ }; guint8 qq_process_login( PurpleConnection *gc, guint8 *data, gint data_len); diff --git a/qq_define.c b/qq_define.c index 1587fe7..920dd17 100644 --- a/qq_define.c +++ b/qq_define.c @@ -44,22 +44,22 @@ #define QQ_CLIENT_0C21 0x0C21 /* QQ2004 */ #define QQ_CLIENT_0C49 0x0C49 /* QQ2004II */ #define QQ_CLIENT_0D05 0x0D05 /* QQ2005 beta1 */ -#define QQ_CLIENT_0D51 0x0D51 /* QQ2005 beta2 */ +#define QQ_CLIENT_0D51 0x0D51 /* QQ2005 beta2 */ #define QQ_CLIENT_0D55 0x0d55 /* QQ2005 used by libqq before */ #define QQ_CLIENT_0D61 0x0D61 /* QQ2005 */ #define QQ_CLIENT_05A5 0x05A5 /* ? */ #define QQ_CLIENT_05F1 0x0F15 /* QQ2006 Spring Festival */ #define QQ_CLIENT_0F4B 0x0F4B /* QQ2006 Beta 3 */ -#define QQ_CLIENT_1105 0x1105 /* QQ2007 beta4*/ -#define QQ_CLIENT_111D 0x111D /* QQ2007 */ +#define QQ_CLIENT_1105 0x1105 /* QQ2007 beta4*/ +#define QQ_CLIENT_111D 0x111D /* QQ2007 */ #define QQ_CLIENT_115B 0x115B /* QQ2008 He Sui*/ #define QQ_CLIENT_1203 0x1203 /* QQ2008 */ #define QQ_CLIENT_1205 0x1205 /* QQ2008 Qi Fu */ #define QQ_CLIENT_120B 0x120B /* QQ2008 July 8.0.978.400 */ #define QQ_CLIENT_1412 0x1412 /* QQMac 1.0 preview1 build 670 */ #define QQ_CLIENT_1441 0x1441 /* QQ2009 preview2 */ - + #define QQ_SERVER_0100 0x0100 /* server */ diff --git a/qq_define.h b/qq_define.h index b65f2a7..9afea0c 100644 --- a/qq_define.h +++ b/qq_define.h @@ -34,6 +34,9 @@ #define QQ_PACKET_TAIL 0x03 /* all QQ text packets end with it */ #define QQ_CLIENT_1E0D 0x1E0D /* QQ2010 Intl */ +#define QQ_CLIENT_2227 0x2227 /* QQ2011 Intl */ +#define QQ_CLIENT_2012 0x2012 /* QQ2012 Intl */ + const gchar *qq_get_ver_desc(gint source); /* list of known QQ commands */ diff --git a/qq_network.c b/qq_network.c index f8d18b1..d46dcef 100644 --- a/qq_network.c +++ b/qq_network.c @@ -741,6 +741,13 @@ static void set_all_keys(PurpleConnection *gc) dest = qd->ld.pwd_twice_md5; qq_get_md5(dest, dest_len, qd->ld.pwd_md5, dest_len); + // password for 2011 or later + unsigned char source[24] = {0}; + memcpy( source, qd->ld.pwd_md5, 16 ); + *(unsigned int*)( &source[20] ) = htonl( qd->uid ); + + dest = qd->ld.pwd_qq_md5; + qq_get_md5(dest, dest_len, (guint8 *)source, 24); } /* the callback function after socket is built @@ -766,9 +773,7 @@ static void connect_cb(gpointer data, gint source, const gchar *error_message) } if (source < 0) { /* socket returns -1 */ - purple_debug_info("QQ_CONN", - "Could not establish a connection with the server:\n%s\n", - error_message); + purple_debug_info("QQ_CONN", "Could not establish a connection with the server:\n%s\n", error_message); if (qd->connect_watcher > 0) purple_timeout_remove(qd->connect_watcher); qd->connect_watcher = purple_timeout_add_seconds(QQ_CONNECT_INTERVAL, qq_connect_later, gc); return; @@ -1035,6 +1040,7 @@ void qq_disconnect(PurpleConnection *gc) memset(qd->ld.random_key, 0, sizeof(qd->ld.random_key)); memset(qd->ld.pwd_md5, 0, sizeof(qd->ld.pwd_md5)); memset(qd->ld.pwd_twice_md5, 0, sizeof(qd->ld.pwd_twice_md5)); + memset(qd->ld.pwd_qq_md5, 0, sizeof(qd->ld.pwd_qq_md5)); memset(qd->session_key, 0, sizeof(qd->session_key)); memset(qd->session_md5, 0, sizeof(qd->session_md5)); diff --git a/qq_process.c b/qq_process.c index 81de520..0f40296 100644 --- a/qq_process.c +++ b/qq_process.c @@ -361,35 +361,35 @@ static void process_private_msg(guint8 *data, gint data_len, guint16 cmd, guint1 } } -static void do_server_notice(PurpleConnection *gc, gchar *from, gchar *to, - guint8 *data, gint data_len) -{ - qq_data *qd = (qq_data *) gc->proto_data; - gchar *msg, *msg_utf8; - gchar *title, *content; - - g_return_if_fail(from != NULL && to != NULL && data_len > 0); - - msg = g_strndup((gchar *)data, data_len); - msg_utf8 = qq_to_utf8(msg, QQ_CHARSET_DEFAULT); - g_free(msg); - if (msg_utf8 == NULL) { - purple_debug_error("QQ", "Recv NULL sys msg from %s to %s, discard\n", - from, to); - return; - } - - title = g_strdup_printf(_("From %s:"), from); - content = g_strdup_printf(_("Server notice From %s: \n%s"), from, msg_utf8); - - if (qd->is_show_notice) { - qq_got_message(gc, content); - } else { - purple_debug_info("QQ", "QQ Server notice from %s:\n%s\n", from, msg_utf8); - } - g_free(msg_utf8); - g_free(title); - g_free(content); +static void do_server_notice(PurpleConnection *gc, gchar *from, gchar *to, + guint8 *data, gint data_len) +{ + qq_data *qd = (qq_data *) gc->proto_data; + gchar *msg, *msg_utf8; + gchar *title, *content; + + g_return_if_fail(from != NULL && to != NULL && data_len > 0); + + msg = g_strndup((gchar *)data, data_len); + msg_utf8 = qq_to_utf8(msg, QQ_CHARSET_DEFAULT); + g_free(msg); + if (msg_utf8 == NULL) { + purple_debug_error("QQ", "Recv NULL sys msg from %s to %s, discard\n", + from, to); + return; + } + + title = g_strdup_printf(_("From %s:"), from); + content = g_strdup_printf(_("Server notice From %s: \n%s"), from, msg_utf8); + + if (qd->is_show_notice) { + qq_got_message(gc, content); + } else { + purple_debug_info("QQ", "QQ Server notice from %s:\n%s\n", from, msg_utf8); + } + g_free(msg_utf8); + g_free(title); + g_free(content); } static void process_server_msg(PurpleConnection *gc, guint8 *data, gint data_len, guint16 seq) @@ -942,12 +942,12 @@ guint8 qq_proc_login_cmds(PurpleConnection *gc, guint16 cmd, guint16 seq, } qq_request_verify_E5(gc); break; - case QQ_CMD_VERIFY_E5: - ret_8 = qq_process_verify_E5(gc, data, data_len); - if (ret_8 != QQ_LOGIN_REPLY_OK) { - return ret_8; - } - qq_request_verify_E3(gc); + case QQ_CMD_VERIFY_E5: + ret_8 = qq_process_verify_E5(gc, data, data_len); + if (ret_8 != QQ_LOGIN_REPLY_OK) { + return ret_8; + } + qq_request_verify_E3(gc); break; case QQ_CMD_VERIFY_E3: ret_8 = qq_process_verify_E3(gc, data, data_len); -- 1.7.11.4