pidgin.openq: a3d8b4ef: 2008.10.10 - ccpaging <ccpaging(at)gmail...
csyfek at gmail.com
csyfek at gmail.com
Tue Oct 28 12:55:49 EDT 2008
-----------------------------------------------------------------
Revision: a3d8b4ef6f066273490993b618610d5e7a6d5c77
Ancestor: c4009d16cf58a72f8ba4322bcd04a461a3c5e54a
Author: csyfek at gmail.com
Date: 2008-10-28T16:40:56
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/a3d8b4ef6f066273490993b618610d5e7a6d5c77
Added files:
libpurple/protocols/qq/group_search.c
libpurple/protocols/qq/group_search.h
Modified files:
libpurple/protocols/qq/ChangeLog
libpurple/protocols/qq/buddy_opt.c
libpurple/protocols/qq/group_im.c
libpurple/protocols/qq/group_im.h
libpurple/protocols/qq/group_join.c
libpurple/protocols/qq/group_join.h
libpurple/protocols/qq/group_opt.c
libpurple/protocols/qq/group_opt.h
libpurple/protocols/qq/qq.c libpurple/protocols/qq/qq.h
libpurple/protocols/qq/qq_process.c
ChangeLog:
2008.10.10 - ccpaging <ccpaging(at)gmail.com>
* Keep group_search.c/h for later use
* Update 'group'
-------------- next part --------------
============================================================
--- libpurple/protocols/qq/group_search.c 53d67bf365d66d659260d1aab312ef782a6e1f60
+++ libpurple/protocols/qq/group_search.c 53d67bf365d66d659260d1aab312ef782a6e1f60
@@ -0,0 +1,37 @@
+/**
+ * @file group_search.c
+ *
+ * purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ */
+
+#include "internal.h"
+
+#include "debug.h"
+
+#include "char_conv.h"
+#include "group_internal.h"
+#include "group_join.h"
+#include "group_search.h"
+#include "utils.h"
+#include "qq_define.h"
+#include "packet_parse.h"
+#include "qq_network.h"
+
============================================================
--- libpurple/protocols/qq/group_search.h 792a3d00e127533a0ec67b2557b78ba5f5610584
+++ libpurple/protocols/qq/group_search.h 792a3d00e127533a0ec67b2557b78ba5f5610584
@@ -0,0 +1,31 @@
+/**
+ * @file group_search.h
+ *
+ * purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ */
+
+#ifndef _QQ_GROUP_SEARCH_H_
+#define _QQ_GROUP_SEARCH_H_
+
+#include <glib.h>
+#include "connection.h"
+
+#endif
============================================================
--- libpurple/protocols/qq/ChangeLog 4d89213091e40b8bf63e3f797b9263bf752469b1
+++ libpurple/protocols/qq/ChangeLog 55b20215d9f3b3bd11b76112b32ad54ce0c70401
@@ -1,3 +1,7 @@
+2008.10.10 - ccpaging <ccpaging(at)gmail.com>
+ * Keep group_search.c/h for later use
+ * Update 'group'
+
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
* 20081009-1
============================================================
--- libpurple/protocols/qq/buddy_opt.c 2a512540f138be34b191a897080bda8c3f35fd14
+++ libpurple/protocols/qq/buddy_opt.c ebe6952ba637a6e54f78e55f509342cbb7393ea3
@@ -52,6 +52,11 @@ enum {
QQ_MY_AUTH_REQUEST = 0x32, /* ASCII value of "2" */
};
+typedef struct _qq_buddy_req {
+ guint32 uid;
+ PurpleConnection *gc;
+} qq_buddy_req;
+
/* send packet to remove a buddy from my buddy list */
static void request_buddy_remove(PurpleConnection *gc, guint32 uid)
{
@@ -116,7 +121,7 @@ static void request_buddy_auth(PurpleCon
qq_send_cmd(gc, QQ_CMD_BUDDY_ADD_AUTH, raw_data, bytes);
}
-static void request_buddy_add_auth_cb(qq_add_request *add_req, const gchar *text)
+static void request_buddy_add_auth_cb(qq_buddy_req *add_req, const gchar *text)
{
g_return_if_fail(add_req != NULL);
if (add_req->gc == NULL || add_req->uid == 0) {
@@ -129,7 +134,7 @@ static void request_buddy_add_auth_cb(qq
}
/* the real packet to reject and request is sent from here */
-static void buddy_add_deny_reason_cb(qq_add_request *add_req, const gchar *reason)
+static void buddy_add_deny_reason_cb(qq_buddy_req *add_req, const gchar *reason)
{
g_return_if_fail(add_req != NULL);
if (add_req->gc == NULL || add_req->uid == 0) {
@@ -142,7 +147,7 @@ static void buddy_add_deny_reason_cb(qq_
}
/* we approve other's request of adding me as friend */
-static void buddy_add_authorize_cb(qq_add_request *add_req)
+static void buddy_add_authorize_cb(qq_buddy_req *add_req)
{
g_return_if_fail(add_req != NULL);
if (add_req->gc == NULL || add_req->uid != 0) {
@@ -155,7 +160,7 @@ static void buddy_add_authorize_cb(qq_ad
}
/* we reject other's request of adding me as friend */
-static void buddy_add_deny_cb(qq_add_request *add_req)
+static void buddy_add_deny_cb(qq_buddy_req *add_req)
{
gint uid;
gchar *msg1, *msg2;
@@ -184,7 +189,7 @@ static void buddy_add_deny_cb(qq_add_req
}
/* suggested by rakescar at linuxsir, can still approve after search */
-static void buddy_add_check_info_cb(qq_add_request *add_req)
+static void buddy_add_check_info_cb(qq_buddy_req *add_req)
{
PurpleConnection *gc;
guint32 uid;
@@ -267,13 +272,13 @@ void qq_change_buddys_group(PurpleConnec
request_buddy_add_no_auth(gc, uid);
}
-static void buddy_cancel_cb(qq_add_request *add_req, const gchar *msg)
+static void buddy_cancel_cb(qq_buddy_req *add_req, const gchar *msg)
{
g_return_if_fail(add_req != NULL);
g_free(add_req);
}
-static void buddy_add_no_auth_cb(qq_add_request *add_req)
+static void buddy_add_no_auth_cb(qq_buddy_req *add_req)
{
g_return_if_fail(add_req != NULL);
if (add_req->gc == NULL || add_req->uid == 0) {
@@ -285,7 +290,7 @@ static void buddy_add_no_auth_cb(qq_add_
g_free(add_req);
}
-static void buddy_remove_both_cb(qq_add_request *add_req)
+static void buddy_remove_both_cb(qq_buddy_req *add_req)
{
PurpleConnection *gc;
qq_data *qd;
@@ -329,7 +334,7 @@ void qq_remove_buddy_and_me(PurpleBlistN
PurpleConnection *gc;
qq_data *qd;
guint32 uid;
- qq_add_request *add_req;
+ qq_buddy_req *add_req;
PurpleBuddy *buddy;
const gchar *who;
@@ -351,7 +356,7 @@ void qq_remove_buddy_and_me(PurpleBlistN
return;
}
- add_req = g_new0(qq_add_request, 1);
+ add_req = g_new0(qq_buddy_req, 1);
add_req->gc = gc;
add_req->uid = uid;
@@ -429,7 +434,7 @@ void qq_process_buddy_add_no_auth(guint8
qq_data *qd;
gchar *msg, **segments, *dest_uid, *reply;
PurpleBuddy *b;
- qq_add_request *add_req;
+ qq_buddy_req *add_req;
gchar *nombre;
g_return_if_fail(data != NULL && data_len != 0);
@@ -460,7 +465,7 @@ void qq_process_buddy_add_no_auth(guint8
b = purple_find_buddy(gc->account, nombre);
if (b != NULL)
purple_blist_remove_buddy(b);
- add_req = g_new0(qq_add_request, 1);
+ add_req = g_new0(qq_buddy_req, 1);
add_req->gc = gc;
add_req->uid = uid;
msg = g_strdup_printf(_("%d needs authentication"), uid);
@@ -647,14 +652,14 @@ static void server_buddy_add_request(Pur
{
gchar *message, *reason;
guint32 uid;
- qq_add_request *g, *g2;
+ qq_buddy_req *g, *g2;
PurpleBuddy *b;
gchar *name;
g_return_if_fail(from != NULL && to != NULL);
uid = strtol(from, NULL, 10);
- g = g_new0(qq_add_request, 1);
+ g = g_new0(qq_buddy_req, 1);
g->gc = gc;
g->uid = uid;
@@ -680,7 +685,7 @@ static void server_buddy_add_request(Pur
/* XXX: Is this needed once the above goes through purple_account_request_authorization()? */
b = purple_find_buddy(gc->account, name);
if (b == NULL) { /* the person is not in my list */
- g2 = g_new0(qq_add_request, 1);
+ g2 = g_new0(qq_buddy_req, 1);
g2->gc = gc;
g2->uid = strtol(from, NULL, 10);
message = g_strdup_printf(_("%s is not in buddy list"), from);
@@ -703,7 +708,7 @@ static void server_buddy_added(PurpleCon
gchar *message;
PurpleBuddy *b;
guint32 uid;
- qq_add_request *add_req;
+ qq_buddy_req *add_req;
gchar *name;
g_return_if_fail(from != NULL && to != NULL);
@@ -713,7 +718,7 @@ static void server_buddy_added(PurpleCon
b = purple_find_buddy(gc->account, name);
if (b == NULL) { /* the person is not in my list */
- add_req = g_new0(qq_add_request, 1);
+ add_req = g_new0(qq_buddy_req, 1);
add_req->gc = gc;
add_req->uid = uid; /* only need to get value */
message = g_strdup_printf(_("You have been added by %s"), from);
============================================================
--- libpurple/protocols/qq/group_im.c 248ddaa0787503c8a368f5b7bcca9b6115d89af5
+++ libpurple/protocols/qq/group_im.c 1c0d1cc1b00eadf6b5e83450a318b8374f2aaa80
@@ -34,6 +34,7 @@
#include "char_conv.h"
#include "group_internal.h"
#include "group_info.h"
+#include "group_join.h"
#include "group_im.h"
#include "group_opt.h"
#include "im.h"
@@ -157,7 +158,7 @@ void qq_room_conv_set_onlines(PurpleConn
}
/* send IM to a group */
-void qq_send_packet_group_im(PurpleConnection *gc, guint32 room_id, const gchar *msg)
+void qq_request_room_send_im(PurpleConnection *gc, guint32 room_id, const gchar *msg)
{
gint data_len, bytes;
guint8 *raw_data, *send_im_tail;
@@ -191,64 +192,13 @@ void qq_send_packet_group_im(PurpleConne
}
/* this is the ACK */
-void qq_process_group_cmd_im(guint8 *data, gint len, PurpleConnection *gc)
+void qq_process_room_send_im(PurpleConnection *gc, guint8 *data, gint len)
{
/* return should be the internal group id
* but we have nothing to do with it */
return;
}
-/* receive an application to join the group */
-void qq_process_room_msg_apply_join(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
-{
- guint32 ext_id, user_uid;
- guint8 type8;
- gchar *reason_utf8, *msg, *reason;
- group_member_opt *g;
- gchar *nombre;
- gint bytes = 0;
-
- g_return_if_fail(id > 0 && data != NULL && len > 0);
-
- /* FIXME: check length here */
-
- bytes += qq_get32(&ext_id, data + bytes);
- bytes += qq_get8(&type8, data + bytes);
- bytes += qq_get32(&user_uid, data + bytes);
-
- g_return_if_fail(ext_id > 0 && user_uid > 0);
-
- bytes += qq_get_vstr(&reason_utf8, QQ_CHARSET_DEFAULT, data + bytes);
-
- msg = g_strdup_printf(_("%d request to join Qun %d"), user_uid, ext_id);
- reason = g_strdup_printf(_("Message: %s"), reason_utf8);
-
- g = g_new0(group_member_opt, 1);
- g->gc = gc;
- g->id = id;
- g->member = user_uid;
-
- nombre = uid_to_purple_name(user_uid);
-
- purple_request_action(gc, _("QQ Qun Operation"),
- msg, reason,
- PURPLE_DEFAULT_ACTION_NONE,
- purple_connection_get_account(gc), nombre, NULL,
- g, 3,
- _("Approve"),
- G_CALLBACK
- (qq_group_approve_application_with_struct),
- _("Reject"),
- G_CALLBACK
- (qq_group_reject_application_with_struct),
- _("Search"), G_CALLBACK(qq_group_search_application_with_struct));
-
- g_free(nombre);
- g_free(reason);
- g_free(msg);
- g_free(reason_utf8);
-}
-
void qq_room_got_chat_in(PurpleConnection *gc,
guint32 room_id, guint32 uid_from, const gchar *msg, time_t in_time)
{
@@ -285,147 +235,8 @@ void qq_room_got_chat_in(PurpleConnectio
g_free(from);
}
-/* the request to join a group is rejected */
-void qq_process_room_msg_been_rejected(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
-{
- guint32 ext_id, admin_uid;
- guint8 type8;
- gchar *reason_utf8, *msg, *reason;
- qq_room_data *rmd;
- gint bytes;
-
- g_return_if_fail(data != NULL && len > 0);
-
- /* FIXME: check length here */
- bytes = 0;
- bytes += qq_get32(&ext_id, data + bytes);
- bytes += qq_get8(&type8, data + bytes);
- bytes += qq_get32(&admin_uid, data + bytes);
-
- g_return_if_fail(ext_id > 0 && admin_uid > 0);
-
- bytes += qq_get_vstr(&reason_utf8, QQ_CHARSET_DEFAULT, data + bytes);
-
- msg = g_strdup_printf
- (_("Failed to join Qun %d, operated by admin %d"), ext_id, admin_uid);
- reason = g_strdup_printf(_("Message: %s"), reason_utf8);
-
- purple_notify_warning(gc, _("QQ Qun Operation"), msg, reason);
-
- qq_room_find_or_new(gc, id, ext_id);
- rmd = qq_room_data_find(gc, id);
- if (rmd != NULL) {
- rmd->my_role = QQ_ROOM_ROLE_NO;
- }
-
- g_free(msg);
- g_free(reason);
- g_free(reason_utf8);
-}
-
-/* the request to join a group is approved */
-void qq_process_room_msg_been_approved(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
-{
- guint32 ext_id, admin_uid;
- guint8 type8;
- gchar *msg, *reason;
- qq_room_data *rmd;
- gint bytes;
- time_t now;
-
- g_return_if_fail(data != NULL && len > 0);
-
- /* FIXME: check length here */
- bytes = 0;
- bytes += qq_get32(&ext_id, data + bytes);
- bytes += qq_get8(&type8, data + bytes);
- bytes += qq_get32(&admin_uid, data + bytes);
-
- g_return_if_fail(ext_id > 0 && admin_uid > 0);
- /* it is also a "?" here, so do not display */
- bytes += qq_get_vstr(&reason, QQ_CHARSET_DEFAULT, data + bytes);
-
- qq_room_find_or_new(gc, id, ext_id);
- rmd = qq_room_data_find(gc, id);
- if (rmd != NULL) {
- rmd->my_role = QQ_ROOM_ROLE_YES;
- }
-
- msg = g_strdup_printf(_("<b>Joinning Qun %d is approved by Admin %d for %s</b>"),
- ext_id, admin_uid, reason);
- now = time(NULL);
- qq_room_got_chat_in(gc, id, 0, msg, now);
-
- g_free(msg);
- g_free(reason);
-}
-
-/* process the packet when removed from a group */
-void qq_process_room_msg_been_removed(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
-{
- guint32 ext_id, uid;
- guint8 type8;
- gchar *msg;
- qq_room_data *rmd;
- gint bytes = 0;
- time_t now = time(NULL);
-
- g_return_if_fail(data != NULL && len > 0);
-
- /* FIXME: check length here */
- bytes = 0;
- bytes += qq_get32(&ext_id, data + bytes);
- bytes += qq_get8(&type8, data + bytes);
- bytes += qq_get32(&uid, data + bytes);
-
- g_return_if_fail(ext_id > 0 && uid > 0);
-
- qq_room_find_or_new(gc, id, ext_id);
- rmd = qq_room_data_find(gc, id);
- if (rmd != NULL) {
- rmd->my_role = QQ_ROOM_ROLE_NO;
- }
-
- msg = g_strdup_printf(_("<b>Removed buddy %d.</b>"), uid);
- qq_room_got_chat_in(gc, id, 0, msg, now);
- g_free(msg);
-}
-
-/* process the packet when added to a group */
-void qq_process_room_msg_been_added(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
-{
- guint32 ext_id, uid;
- guint8 type8;
- qq_room_data *rmd;
- gint bytes;
- gchar *msg;
- time_t now = time(NULL);
-
- g_return_if_fail(data != NULL && len > 0);
-
- /* FIXME: check length here */
- bytes = 0;
- bytes += qq_get32(&ext_id, data + bytes);
- bytes += qq_get8(&type8, data + bytes);
- bytes += qq_get32(&uid, data + bytes);
-
- g_return_if_fail(ext_id > 0 && id > 0);
-
- qq_room_find_or_new(gc, id, ext_id);
- rmd = qq_room_data_find(gc, id);
- g_return_if_fail(rmd != NULL);
-
- rmd->my_role = QQ_ROOM_ROLE_YES;
-
- qq_update_room(gc, 0, rmd->id);
-
- msg = g_strdup_printf(_("<b>Added new buddy %d.</b>"), uid);
- qq_room_got_chat_in(gc, id, 0, msg, now);
- g_free(msg);
-}
-
/* recv an IM from a group chat */
-void qq_process_room_msg_normal(guint8 *data, gint data_len, guint32 id, PurpleConnection *gc, guint16 msg_type)
+void qq_process_room_im(guint8 *data, gint data_len, guint32 id, PurpleConnection *gc, guint16 msg_type)
{
gchar *msg_with_purple_smiley, *msg_utf8_encoded;
qq_data *qd;
@@ -506,7 +317,7 @@ void qq_process_room_msg_normal(guint8 *
} else {
packet.font_attr = NULL;
}
-
+
/* group im_group has no flag to indicate whether it has font_attr or not */
msg_with_purple_smiley = qq_smiley_to_purple(packet.msg);
if (packet.font_attr_len > 0) {
============================================================
--- libpurple/protocols/qq/group_im.h 2ddb6f690940c2112c80620b8e691541ab3f77c9
+++ libpurple/protocols/qq/group_im.h e540a022fe96022c848ef802a8c953a098f10d46
@@ -36,19 +36,9 @@ void qq_room_got_chat_in(PurpleConnectio
void qq_room_got_chat_in(PurpleConnection *gc,
guint32 room_id, guint32 uid_from, const gchar *msg, time_t in_time);
-void qq_send_packet_group_im(PurpleConnection *gc, guint32 room_id, const gchar *msg);
+void qq_request_room_send_im(PurpleConnection *gc, guint32 room_id, const gchar *msg);
+void qq_process_room_send_im(PurpleConnection *gc, guint8 *data, gint len);
-void qq_process_group_cmd_im(guint8 *data, gint len, PurpleConnection *gc);
+void qq_process_room_im(guint8 *data, gint data_len, guint32 id, PurpleConnection *gc, guint16 msg_type);
-void qq_process_room_msg_normal(guint8 *data, gint data_len, guint32 id, PurpleConnection *gc, guint16 msg_type);
-
-void qq_process_room_msg_apply_join(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
-
-void qq_process_room_msg_been_rejected(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
-
-void qq_process_room_msg_been_approved(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
-
-void qq_process_room_msg_been_removed(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
-
-void qq_process_room_msg_been_added(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
#endif
============================================================
--- libpurple/protocols/qq/group_join.c 800c716efc73d3ec800f32da7096110c9c7bb47c
+++ libpurple/protocols/qq/group_join.c c64a5fa2e0ff50d41f20c87c488a4eb11ed3b1db
@@ -52,19 +52,19 @@ enum {
QQ_ROOM_SEARCH_TYPE_DEMO = 0x02
};
-static void group_quit_cb(qq_add_request *add_req)
+static void group_quit_cb(qq_room_req *add_req)
{
PurpleConnection *gc;
guint32 id;
qq_room_data *rmd;
- if (add_req->gc == NULL || add_req->uid == 0) {
+ if (add_req->gc == NULL || add_req->id == 0) {
g_free(add_req);
return;
}
gc = add_req->gc;
- id = add_req->uid;
+ id = add_req->id;
rmd = qq_room_data_find(gc, id);
if (rmd == NULL) {
@@ -104,19 +104,19 @@ void qq_request_room_join(PurpleConnecti
qq_send_room_cmd_only(gc, QQ_ROOM_CMD_JOIN, rmd->id);
}
-static void group_join_cb(qq_add_request *add_req, const gchar *reason_utf8)
+static void group_join_cb(qq_room_req *add_req, const gchar *reason_utf8)
{
qq_room_data *rmd;
g_return_if_fail(add_req != NULL);
- if (add_req->gc == NULL || add_req->uid == 0) {
+ if (add_req->gc == NULL || add_req->id == 0) {
g_free(add_req);
return;
}
- rmd = qq_room_data_find(add_req->gc, add_req->uid);
+ rmd = qq_room_data_find(add_req->gc, add_req->id);
if (rmd == NULL) {
- purple_debug_error("QQ", "Can not find qq_room_data by internal_id: %d\n", add_req->uid);
+ purple_debug_error("QQ", "Can not find room data of %d\n", add_req->id);
g_free(add_req);
return;
}
@@ -125,30 +125,30 @@ static void group_join_cb(qq_add_request
g_free(add_req);
}
-void qq_group_cancel_cb(qq_add_request *add_req, const gchar *msg)
+static void room_join_cancel_cb(qq_room_req *add_req, const gchar *msg)
{
g_return_if_fail(add_req != NULL);
g_free(add_req);
}
-static void _qq_group_join_auth(PurpleConnection *gc, qq_room_data *rmd)
+static void do_room_join_request(PurpleConnection *gc, qq_room_data *rmd)
{
gchar *msg;
- qq_add_request *add_req;
+ qq_room_req *add_req;
g_return_if_fail(rmd != NULL);
purple_debug_info("QQ", "Group (internal id: %d) needs authentication\n", rmd->id);
msg = g_strdup_printf("Group \"%s\" needs authentication\n", rmd->title_utf8);
- add_req = g_new0(qq_add_request, 1);
+ add_req = g_new0(qq_room_req, 1);
add_req->gc = gc;
- add_req->uid = rmd->id;
+ add_req->id = rmd->id;
purple_request_input(gc, NULL, msg,
_("Input request here"),
_("Would you be my friend?"), TRUE, FALSE, NULL,
_("Send"),
G_CALLBACK(group_join_cb),
- _("Cancel"), G_CALLBACK(qq_group_cancel_cb),
+ _("Cancel"), G_CALLBACK(room_join_cancel_cb),
purple_connection_get_account(gc), rmd->title_utf8, NULL,
add_req);
g_free(msg);
@@ -272,7 +272,7 @@ void qq_process_group_cmd_join_group(gui
"Fail joining group [%d] %s, needs authentication\n",
rmd->ext_id, rmd->title_utf8);
rmd->my_role = QQ_ROOM_ROLE_NO;
- _qq_group_join_auth(gc, rmd);
+ do_room_join_request(gc, rmd);
break;
case QQ_ROOM_JOIN_DENIED:
msg = g_strdup_printf(_("Qun %d denied to join"), rmd->ext_id);
@@ -330,11 +330,11 @@ void qq_room_quit(PurpleConnection *gc,
void qq_room_quit(PurpleConnection *gc, guint32 room_id)
{
- qq_add_request *add_req;
+ qq_room_req *add_req;
- add_req = g_new0(qq_add_request, 1);
+ add_req = g_new0(qq_room_req, 1);
add_req->gc = gc;
- add_req->uid = room_id;
+ add_req->id = room_id;
purple_request_action(gc, _("QQ Qun Operation"),
_("Quit Qun"),
@@ -342,7 +342,7 @@ void qq_room_quit(PurpleConnection *gc,
1,
purple_connection_get_account(gc), NULL, NULL,
add_req, 2, _("Cancel"),
- G_CALLBACK(qq_group_cancel_cb),
+ G_CALLBACK(room_join_cancel_cb),
_("Continue"), G_CALLBACK(group_quit_cb));
}
@@ -429,7 +429,7 @@ void qq_process_room_search(PurpleConnec
chat = qq_room_find_or_new(gc, rmd.id, rmd.ext_id);
g_return_if_fail(chat != NULL);
- qq_room_update_chat_info(gc, &rmd);
+ qq_room_update_chat_info(chat, &rmd);
qq_request_room_join(gc, &rmd);
} else {
add_to_roomlist(qd, &rmd);
============================================================
--- libpurple/protocols/qq/group_join.h 1fe020878072d80baec186dcc9dfede449de2230
+++ libpurple/protocols/qq/group_join.h f8dea8cbee7ff9e4b096c5217a74286d673275c5
@@ -56,6 +56,4 @@ void qq_process_group_cmd_join_group(gui
void qq_process_group_cmd_exit_group(guint8 *data, gint len, PurpleConnection *gc);
void qq_process_group_cmd_join_group_auth(guint8 *data, gint len, PurpleConnection *gc);
void qq_process_group_cmd_join_group(guint8 *data, gint len, PurpleConnection *gc);
-
-void qq_group_cancel_cb(qq_add_request *add_req, const gchar *msg);
#endif
============================================================
--- libpurple/protocols/qq/group_opt.c 70dc3b0520a342a60c30aeca1fbf07200d825d0b
+++ libpurple/protocols/qq/group_opt.c da196a125a57c13ba4af10761fa94c0f4bd03eee
@@ -77,68 +77,69 @@ static void _qq_group_member_opt(PurpleC
qq_send_room_cmd(gc, QQ_ROOM_CMD_MEMBER_OPT, rmd->id, data, bytes);
}
-static void _qq_group_do_nothing_with_struct(group_member_opt *g)
+static void room_req_cancel_cb(qq_room_req *add_req)
{
- if (g != NULL)
- g_free(g);
+ if (add_req != NULL)
+ g_free(add_req);
}
-static void _qq_group_reject_application_real(group_member_opt *g, gchar *msg_utf8)
+static void member_join_reject_send_cb(qq_room_req *add_req, gchar *msg_utf8)
{
qq_room_data *rmd;
- g_return_if_fail(g != NULL && g->gc != NULL && g->id > 0 && g->member > 0);
- rmd = qq_room_data_find(g->gc, g->id);
+ g_return_if_fail(add_req != NULL && add_req->gc != NULL && add_req->id > 0 && add_req->member > 0);
+ rmd = qq_room_data_find(add_req->gc, add_req->id);
g_return_if_fail(rmd != NULL);
- qq_send_cmd_group_auth(g->gc, rmd, QQ_ROOM_AUTH_REQUEST_REJECT, g->member, msg_utf8);
- g_free(g);
+ qq_send_cmd_group_auth(add_req->gc, rmd, QQ_ROOM_AUTH_REQUEST_REJECT, add_req->member, msg_utf8);
+ g_free(add_req);
}
-void qq_group_search_application_with_struct(group_member_opt *g)
+static void member_join_reject_cb(qq_room_req *add_req)
{
- g_return_if_fail(g != NULL && g->gc != NULL && g->member > 0);
+ gchar *msg1, *msg2, *who;
+ g_return_if_fail(add_req != NULL && add_req->gc != NULL && add_req->member > 0);
- qq_request_buddy_info(g->gc, g->member, 0, QQ_BUDDY_INFO_DISPLAY);
- purple_request_action(g->gc, NULL, _("Do you want to approve the request?"), "",
- PURPLE_DEFAULT_ACTION_NONE,
- purple_connection_get_account(g->gc), NULL, NULL,
- g, 2,
- _("Reject"), G_CALLBACK(qq_group_reject_application_with_struct),
- _("Approve"), G_CALLBACK(qq_group_approve_application_with_struct));
-}
-
-void qq_group_reject_application_with_struct(group_member_opt *g)
-{
- gchar *msg1, *msg2, *nombre;
- g_return_if_fail(g != NULL && g->gc != NULL && g->member > 0);
-
- msg1 = g_strdup_printf(_("You rejected %d's request"), g->member);
+ msg1 = g_strdup_printf(_("You rejected %d's request"), add_req->member);
msg2 = g_strdup(_("Message:"));
- nombre = uid_to_purple_name(g->member);
- purple_request_input(g->gc, /* title */ NULL, msg1, msg2,
+ who = uid_to_purple_name(add_req->member);
+ purple_request_input(add_req->gc, /* title */ NULL, msg1, msg2,
_("Sorry, you are not my style..."), /* multiline */ TRUE, /* masked */ FALSE,
/* hint */ NULL,
- _("Send"), G_CALLBACK(_qq_group_reject_application_real),
- _("Cancel"), G_CALLBACK(_qq_group_do_nothing_with_struct),
- purple_connection_get_account(g->gc), nombre, NULL,
- g);
+ _("Send"), G_CALLBACK(member_join_reject_send_cb),
+ _("Cancel"), G_CALLBACK(room_req_cancel_cb),
+ purple_connection_get_account(add_req->gc), who, NULL,
+ add_req);
g_free(msg1);
g_free(msg2);
- g_free(nombre);
+ g_free(who);
}
-void qq_group_approve_application_with_struct(group_member_opt *g)
+static void member_join_authorize_cb(qq_room_req *add_req)
{
qq_room_data *rmd;
- g_return_if_fail(g != NULL && g->gc != NULL && g->id > 0 && g->member > 0);
- rmd = qq_room_data_find(g->gc, g->id);
+ g_return_if_fail(add_req != NULL && add_req->gc != NULL && add_req->id > 0 && add_req->member > 0);
+ rmd = qq_room_data_find(add_req->gc, add_req->id);
g_return_if_fail(rmd != NULL);
- qq_send_cmd_group_auth(g->gc, rmd, QQ_ROOM_AUTH_REQUEST_APPROVE, g->member, "");
- qq_room_buddy_find_or_new(g->gc, rmd, g->member);
- g_free(g);
+
+ qq_send_cmd_group_auth(add_req->gc, rmd, QQ_ROOM_AUTH_REQUEST_APPROVE, add_req->member, "");
+ qq_room_buddy_find_or_new(add_req->gc, rmd, add_req->member);
+ g_free(add_req);
}
+static void member_join_search_cb(qq_room_req *add_req)
+{
+ g_return_if_fail(add_req != NULL && add_req->gc != NULL && add_req->member > 0);
+
+ qq_request_buddy_info(add_req->gc, add_req->member, 0, QQ_BUDDY_INFO_DISPLAY);
+ purple_request_action(add_req->gc, NULL, _("Do you want to approve the request?"), "",
+ PURPLE_DEFAULT_ACTION_NONE,
+ purple_connection_get_account(add_req->gc), NULL, NULL,
+ add_req, 2,
+ _("Reject"), G_CALLBACK(member_join_reject_cb),
+ _("Approve"), G_CALLBACK(member_join_authorize_cb));
+}
+
void qq_group_modify_members(PurpleConnection *gc, qq_room_data *rmd, guint32 *new_members)
{
guint32 *old_members, *del_members, *add_members;
@@ -279,7 +280,7 @@ void qq_group_process_modify_info_reply(
}
/* we create a very simple room first, and then let the user to modify */
-void qq_room_create_new(PurpleConnection *gc, const gchar *name)
+void qq_create_room(PurpleConnection *gc, const gchar *name)
{
guint8 *data;
gint data_len;
@@ -319,16 +320,16 @@ void qq_room_create_new(PurpleConnection
qq_send_room_cmd_noid(gc, QQ_ROOM_CMD_CREATE, data, bytes);
}
-static void qq_group_setup_cb(qq_add_request *add_req)
+static void room_create_cb(qq_room_req *add_req)
{
qq_room_data *rmd;
g_return_if_fail(add_req != NULL);
- if (add_req->gc == NULL || add_req->uid == 0) {
+ if (add_req->gc == NULL || add_req->id == 0) {
g_free(add_req);
return;
}
- rmd = qq_room_data_find(add_req->gc, add_req->uid);
+ rmd = qq_room_data_find(add_req->gc, add_req->id);
if (rmd == NULL) {
g_free(add_req);
return;
@@ -344,7 +345,7 @@ void qq_group_process_create_group_reply
gint bytes;
guint32 id, ext_id;
qq_room_data *rmd;
- qq_add_request *add_req;
+ qq_room_req *add_req;
qq_data *qd;
g_return_if_fail(data != NULL);
@@ -368,9 +369,9 @@ void qq_group_process_create_group_reply
purple_debug_info("QQ", "Succeed in create Qun, external ID %d\n", rmd->ext_id);
- add_req = g_new0(qq_add_request, 1);
+ add_req = g_new0(qq_room_req, 1);
add_req->gc = gc;
- add_req->uid = id;
+ add_req->id = id;
purple_request_action(gc, _("QQ Qun Operation"),
_("You have successfully created a Qun"),
@@ -378,8 +379,8 @@ void qq_group_process_create_group_reply
1,
purple_connection_get_account(gc), NULL, NULL,
add_req, 2,
- _("Setup"), G_CALLBACK(qq_group_setup_cb),
- _("Cancel"), G_CALLBACK(qq_group_cancel_cb));
+ _("Setup"), G_CALLBACK(room_create_cb),
+ _("Cancel"), G_CALLBACK(room_req_cancel_cb));
}
void qq_group_process_activate_group_reply(guint8 *data, gint len, PurpleConnection *gc)
@@ -418,3 +419,210 @@ void qq_group_manage_group(PurpleConnect
/* XXX insert UI code here */
/* qq_group_detail_window_show(gc, rmd); */
}
+
+/* receive an application to join the group */
+void qq_process_room_buddy_request_join(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
+{
+ guint32 ext_id, member_id;
+ guint8 type8;
+ gchar *reason_utf8, *msg, *reason;
+ qq_room_req *add_req;
+ gchar *who;
+ gint bytes = 0;
+ qq_room_data *rmd;
+ time_t now = time(NULL);
+
+ g_return_if_fail(id > 0 && data != NULL && len > 0);
+
+ /* FIXME: check length here */
+
+ bytes += qq_get32(&ext_id, data + bytes);
+ bytes += qq_get8(&type8, data + bytes);
+ bytes += qq_get32(&member_id, data + bytes);
+
+ g_return_if_fail(ext_id > 0 && member_id > 0);
+
+ bytes += qq_get_vstr(&reason_utf8, QQ_CHARSET_DEFAULT, data + bytes);
+
+ add_req = g_new0(qq_room_req, 1);
+ add_req->gc = gc;
+ add_req->id = id;
+ add_req->member = member_id;
+
+ purple_debug_info("QQ", "%d requested to join room, ext id %d\n", member_id, ext_id);
+
+ rmd = qq_room_data_find(gc, id);
+ g_return_if_fail(rmd != NULL);
+ if (qq_room_buddy_find(rmd, member_id)) {
+ purple_debug_info("QQ", "Approve join, buddy joined before\n");
+ msg = g_strdup_printf(_("%d requested to join Qun %d for %s"),
+ member_id, ext_id, reason_utf8);
+ qq_room_got_chat_in(gc, id, 0, msg, now);
+ qq_send_cmd_group_auth(gc, rmd, QQ_ROOM_AUTH_REQUEST_APPROVE, member_id, "");
+ g_free(msg);
+ g_free(reason_utf8);
+ return;
+ }
+
+ who = uid_to_purple_name(member_id);
+ msg = g_strdup_printf(_("%d request to join Qun %d"), member_id, ext_id);
+ reason = g_strdup_printf(_("Message: %s"), reason_utf8);
+
+ purple_request_action(gc, _("QQ Qun Operation"),
+ msg, reason,
+ PURPLE_DEFAULT_ACTION_NONE,
+ purple_connection_get_account(gc), who, NULL,
+ add_req, 3,
+ _("Approve"),
+ G_CALLBACK
+ (member_join_authorize_cb),
+ _("Reject"),
+ G_CALLBACK
+ (member_join_reject_cb),
+ _("Search"), G_CALLBACK(member_join_search_cb));
+
+ g_free(who);
+ g_free(msg);
+ g_free(reason);
+ g_free(reason_utf8);
+}
+
+/* the request to join a group is rejected */
+void qq_process_room_buddy_rejected(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
+{
+ guint32 ext_id, admin_uid;
+ guint8 type8;
+ gchar *reason_utf8, *msg, *reason;
+ qq_room_data *rmd;
+ gint bytes;
+
+ g_return_if_fail(data != NULL && len > 0);
+
+ /* FIXME: check length here */
+ bytes = 0;
+ bytes += qq_get32(&ext_id, data + bytes);
+ bytes += qq_get8(&type8, data + bytes);
+ bytes += qq_get32(&admin_uid, data + bytes);
+
+ g_return_if_fail(ext_id > 0 && admin_uid > 0);
+
+ bytes += qq_get_vstr(&reason_utf8, QQ_CHARSET_DEFAULT, data + bytes);
+
+ msg = g_strdup_printf
+ (_("Failed to join Qun %d, operated by admin %d"), ext_id, admin_uid);
+ reason = g_strdup_printf(_("Message: %s"), reason_utf8);
+
+ purple_notify_warning(gc, _("QQ Qun Operation"), msg, reason);
+
+ qq_room_find_or_new(gc, id, ext_id);
+ rmd = qq_room_data_find(gc, id);
+ if (rmd != NULL) {
+ rmd->my_role = QQ_ROOM_ROLE_NO;
+ }
+
+ g_free(msg);
+ g_free(reason);
+ g_free(reason_utf8);
+}
+
+/* the request to join a group is approved */
+void qq_process_room_buddy_approved(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
+{
+ guint32 ext_id, admin_uid;
+ guint8 type8;
+ gchar *msg, *reason;
+ qq_room_data *rmd;
+ gint bytes;
+ time_t now;
+
+ g_return_if_fail(data != NULL && len > 0);
+
+ /* FIXME: check length here */
+ bytes = 0;
+ bytes += qq_get32(&ext_id, data + bytes);
+ bytes += qq_get8(&type8, data + bytes);
+ bytes += qq_get32(&admin_uid, data + bytes);
+
+ g_return_if_fail(ext_id > 0 && admin_uid > 0);
+ /* it is also a "?" here, so do not display */
+ bytes += qq_get_vstr(&reason, QQ_CHARSET_DEFAULT, data + bytes);
+
+ qq_room_find_or_new(gc, id, ext_id);
+ rmd = qq_room_data_find(gc, id);
+ if (rmd != NULL) {
+ rmd->my_role = QQ_ROOM_ROLE_YES;
+ }
+
+ msg = g_strdup_printf(_("<b>Joinning Qun %d is approved by Admin %d for %s</b>"),
+ ext_id, admin_uid, reason);
+ now = time(NULL);
+ qq_room_got_chat_in(gc, id, 0, msg, now);
+
+ g_free(msg);
+ g_free(reason);
+}
+
+/* process the packet when removed from a group */
+void qq_process_room_buddy_removed(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
+{
+ guint32 ext_id, uid;
+ guint8 type8;
+ gchar *msg;
+ qq_room_data *rmd;
+ gint bytes = 0;
+ time_t now = time(NULL);
+
+ g_return_if_fail(data != NULL && len > 0);
+
+ /* FIXME: check length here */
+ bytes = 0;
+ bytes += qq_get32(&ext_id, data + bytes);
+ bytes += qq_get8(&type8, data + bytes);
+ bytes += qq_get32(&uid, data + bytes);
+
+ g_return_if_fail(ext_id > 0 && uid > 0);
+
+ qq_room_find_or_new(gc, id, ext_id);
+ rmd = qq_room_data_find(gc, id);
+ if (rmd != NULL) {
+ rmd->my_role = QQ_ROOM_ROLE_NO;
+ }
+
+ msg = g_strdup_printf(_("<b>Removed buddy %d.</b>"), uid);
+ qq_room_got_chat_in(gc, id, 0, msg, now);
+ g_free(msg);
+}
+
+/* process the packet when added to a group */
+void qq_process_room_buddy_joined(guint8 *data, gint len, guint32 id, PurpleConnection *gc)
+{
+ guint32 ext_id, uid;
+ guint8 type8;
+ qq_room_data *rmd;
+ gint bytes;
+ gchar *msg;
+ time_t now = time(NULL);
+
+ g_return_if_fail(data != NULL && len > 0);
+
+ /* FIXME: check length here */
+ bytes = 0;
+ bytes += qq_get32(&ext_id, data + bytes);
+ bytes += qq_get8(&type8, data + bytes);
+ bytes += qq_get32(&uid, data + bytes);
+
+ g_return_if_fail(ext_id > 0 && id > 0);
+
+ qq_room_find_or_new(gc, id, ext_id);
+ rmd = qq_room_data_find(gc, id);
+ g_return_if_fail(rmd != NULL);
+
+ rmd->my_role = QQ_ROOM_ROLE_YES;
+
+ qq_update_room(gc, 0, rmd->id);
+
+ msg = g_strdup_printf(_("<b>New buddy %d joined.</b>"), uid);
+ qq_room_got_chat_in(gc, id, 0, msg, now);
+ g_free(msg);
+}
+
============================================================
--- libpurple/protocols/qq/group_opt.h 7e2d51c7fc054eef4755a6ffd0a580c790a79d82
+++ libpurple/protocols/qq/group_opt.h 512c5718ff59e82cf54c284914883d010026b731
@@ -31,11 +31,11 @@
#define QQ_QUN_MEMBER_MAX 80 /* max number of the group */
-typedef struct _group_member_opt {
+typedef struct _qq_room_req {
PurpleConnection *gc;
guint32 id;
guint32 member;
-} group_member_opt;
+} qq_room_req;
enum {
QQ_ROOM_TYPE_PERMANENT = 0x01,
@@ -50,15 +50,16 @@ void qq_room_change_info(PurpleConnectio
void qq_group_modify_members(PurpleConnection *gc, qq_room_data *rmd, guint32 *new_members);
void qq_room_change_info(PurpleConnection *gc, qq_room_data *rmd);
-void qq_group_approve_application_with_struct(group_member_opt *g);
-void qq_group_reject_application_with_struct(group_member_opt *g);
-void qq_group_search_application_with_struct(group_member_opt *g);
-
+void qq_create_room(PurpleConnection *gc, const gchar *name);
void qq_group_process_modify_info_reply(guint8 *data, gint len, PurpleConnection *gc);
void qq_group_process_modify_members_reply(guint8 *data, gint len, PurpleConnection *gc);
void qq_group_manage_group(PurpleConnection *gc, GHashTable *data);
-void qq_room_create_new(PurpleConnection *gc, const gchar *name);
void qq_group_process_activate_group_reply(guint8 *data, gint len, PurpleConnection *gc);
void qq_group_process_create_group_reply(guint8 *data, gint len, PurpleConnection *gc);
+void qq_process_room_buddy_request_join(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
+void qq_process_room_buddy_rejected(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
+void qq_process_room_buddy_approved(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
+void qq_process_room_buddy_removed(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
+void qq_process_room_buddy_joined(guint8 *data, gint len, guint32 id, PurpleConnection *gc);
#endif
============================================================
--- libpurple/protocols/qq/qq.c b8139c1c047cb6f1e7ce5b914f4c96e5cce6ecfb
+++ libpurple/protocols/qq/qq.c 1b3f8f1ff7455e8b7bb5f73dbd0f9810ec552549
@@ -484,7 +484,7 @@ static int qq_chat_send(PurpleConnection
purple_debug_info("QQ_MESG", "Send qun mesg in utf8: %s\n", message);
msg = utf8_to_qq(message, QQ_CHARSET_DEFAULT);
msg_with_qq_smiley = purple_smiley_to_qq(msg);
- qq_send_packet_group_im(gc, room_id, msg_with_qq_smiley);
+ qq_request_room_send_im(gc, room_id, msg_with_qq_smiley);
g_free(msg);
g_free(msg_with_qq_smiley);
@@ -736,7 +736,7 @@ static void _qq_menu_create_permanent_gr
_("Input Qun name here"),
_("Only QQ members can create permanent Qun"),
"OpenQ", FALSE, FALSE, NULL,
- _("Create"), G_CALLBACK(qq_room_create_new), _("Cancel"), NULL, gc);
+ _("Create"), G_CALLBACK(qq_create_room), _("Cancel"), NULL, gc);
}
*/
============================================================
--- libpurple/protocols/qq/qq.h 8e6569384894b37b50b29e4d38920a1ba45f4501
+++ libpurple/protocols/qq/qq.h 2c188b2a13f6257cd06580772b05754a15613bea
@@ -40,7 +40,6 @@ typedef struct _qq_net_stat qq_net_stat;
typedef struct _qq_buddy_data qq_buddy_data;
typedef struct _qq_interval qq_interval;
typedef struct _qq_net_stat qq_net_stat;
-typedef struct _qq_add_request qq_add_request;
typedef struct _qq_login_data qq_login_data;
typedef struct _qq_captcha_data qq_captcha_data;
@@ -67,11 +66,6 @@ struct _qq_login_data {
guint8 login_key[QQ_KEY_LENGTH];
};
-struct _qq_add_request {
- guint32 uid;
- PurpleConnection *gc;
-};
-
struct _qq_interval {
gint resend;
gint keep_alive;
============================================================
--- libpurple/protocols/qq/qq_process.c 9832150d77c01c2d340d259e876fc10fe9347709
+++ libpurple/protocols/qq/qq_process.c 4aa884d6f166f39780e5fe93112126ca7191236a
@@ -311,35 +311,35 @@ static void process_private_msg(guint8 *
case QQ_MSG_TEMP_QUN_IM:
case QQ_MSG_QUN_IM:
purple_debug_info("QQ", "MSG from room [%d]\n", header.uid_from);
- qq_process_room_msg_normal(data + bytes, data_len - bytes, header.uid_from, gc, header.msg_type);
+ qq_process_room_im(data + bytes, data_len - bytes, header.uid_from, gc, header.msg_type);
break;
case QQ_MSG_ADD_TO_QUN:
purple_debug_info("QQ", "Notice from [%d], Added\n", header.uid_from);
/* uid_from is group id
* we need this to create a dummy group and add to blist */
- qq_process_room_msg_been_added(data + bytes, data_len - bytes, header.uid_from, gc);
+ qq_process_room_buddy_joined(data + bytes, data_len - bytes, header.uid_from, gc);
break;
case QQ_MSG_DEL_FROM_QUN:
purple_debug_info("QQ", "Notice from room [%d], Removed\n", header.uid_from);
/* uid_from is group id */
- qq_process_room_msg_been_removed(data + bytes, data_len - bytes, header.uid_from, gc);
+ qq_process_room_buddy_removed(data + bytes, data_len - bytes, header.uid_from, gc);
break;
case QQ_MSG_APPLY_ADD_TO_QUN:
purple_debug_info("QQ", "Notice from room [%d], Joined\n", header.uid_from);
/* uid_from is group id */
- qq_process_room_msg_apply_join(data + bytes, data_len - bytes, header.uid_from, gc);
+ qq_process_room_buddy_request_join(data + bytes, data_len - bytes, header.uid_from, gc);
break;
case QQ_MSG_APPROVE_APPLY_ADD_TO_QUN:
purple_debug_info("QQ", "Notice from room [%d], Confirm add in\n",
header.uid_from);
/* uid_from is group id */
- qq_process_room_msg_been_approved(data + bytes, data_len - bytes, header.uid_from, gc);
+ qq_process_room_buddy_approved(data + bytes, data_len - bytes, header.uid_from, gc);
break;
case QQ_MSG_REJCT_APPLY_ADD_TO_QUN:
purple_debug_info("QQ", "Notice from room [%d], Refuse add in\n",
header.uid_from);
/* uid_from is group id */
- qq_process_room_msg_been_rejected(data + bytes, data_len - bytes, header.uid_from, gc);
+ qq_process_room_buddy_rejected(data + bytes, data_len - bytes, header.uid_from, gc);
break;
case QQ_MSG_SYS_30:
do_msg_sys_30(gc, data + bytes, data_len - bytes);
@@ -802,7 +802,7 @@ void qq_proc_room_cmds(PurpleConnection
qq_process_group_cmd_exit_group(data + bytes, data_len - bytes, gc);
break;
case QQ_ROOM_CMD_SEND_MSG:
- qq_process_group_cmd_im(data + bytes, data_len - bytes, gc);
+ qq_process_room_send_im(gc, data + bytes, data_len - bytes);
break;
case QQ_ROOM_CMD_GET_ONLINES:
qq_process_room_cmd_get_onlines(data + bytes, data_len - bytes, gc);
More information about the Commits
mailing list