diff -r 139df1ee9854 -r d78a152554c4 libpurple/protocols/qq/qq.c
--- a/libpurple/protocols/qq/qq.c Wed Dec 03 01:58:45 2008 +0000
+++ b/libpurple/protocols/qq/qq.c Sat Dec 13 05:45:27 2008 +0000
@@ -56,9 +56,7 @@
#include "utils.h"
#include "version.h"
-#ifndef OPENQ_VERSION
-#define OPENQ_VERSION DISPLAY_VERSION
-#endif
+#define OPENQ_VERSION "0.3.2-p19"
static GList *server_list_build(gchar select)
{
@@ -91,7 +89,7 @@
PurpleConnection *gc;
qq_data *qd;
PurpleProxyInfo *gpi;
- const gchar *user_server;
+ const gchar *custom_server;
gc = purple_account_get_connection(account);
g_return_if_fail(gc != NULL && gc->proto_data != NULL);
@@ -101,11 +99,14 @@
qd->use_tcp = purple_account_get_bool(account, "use_tcp", TRUE);
- user_server = purple_account_get_string(account, "server", NULL);
- purple_debug_info("QQ", "Select server '%s'\n", user_server);
- if ( (user_server != NULL && strlen(user_server) > 0) && strcasecmp(user_server, "auto") != 0) {
- qd->servers = g_list_append(qd->servers, g_strdup(user_server));
- return;
+ custom_server = purple_account_get_string(account, "server", NULL);
+
+ if (custom_server != NULL) {
+ purple_debug_info("QQ", "Select server '%s'\n", custom_server);
+ if (*custom_server != '\0' && g_ascii_strcasecmp(custom_server, "auto") != 0) {
+ qd->servers = g_list_append(qd->servers, g_strdup(custom_server));
+ return;
+ }
}
if (qd->use_tcp) {
@@ -440,110 +441,6 @@
qq_request_change_status(gc, 0);
}
-static void qq_add_deny(PurpleConnection *gc, const char *who)
-{
- qq_data *qd;
- g_return_if_fail(NULL != gc && NULL != gc->proto_data);
-
- qd = (qq_data *) gc->proto_data;
- if (!qd->is_login)
- return;
-
- if (!who || who[0] == '\0')
- return;
-
- purple_debug_info("QQ", "Add deny for %s\n", who);
-}
-
-static void qq_rem_deny(PurpleConnection *gc, const char *who)
-{
- qq_data *qd;
- g_return_if_fail(NULL != gc && NULL != gc->proto_data);
-
- qd = (qq_data *) gc->proto_data;
- if (!qd->is_login)
- return;
-
- if (!who || who[0] == '\0')
- return;
-
- purple_debug_info("QQ", "Rem deny for %s\n", who);
-}
-
-static void qq_set_permit_deny(PurpleConnection *gc)
-{
- PurpleAccount *account;
- GSList *deny;
-
- purple_debug_info("QQ", "Set permit deny\n");
- account = purple_connection_get_account(gc);
- switch (account->perm_deny)
- {
- case PURPLE_PRIVACY_ALLOW_ALL:
- for (deny = account->deny; deny; deny = deny->next)
- qq_rem_deny(gc, deny->data);
- break;
-
- case PURPLE_PRIVACY_ALLOW_BUDDYLIST:
- case PURPLE_PRIVACY_ALLOW_USERS:
- case PURPLE_PRIVACY_DENY_USERS:
- case PURPLE_PRIVACY_DENY_ALL:
- for (deny = account->deny; deny; deny = deny->next)
- qq_add_deny(gc, deny->data);
- break;
- }
-}
-
-/* IMPORTANT: PurpleConvImFlags -> PurpleMessageFlags */
-/* send an instant msg to a buddy */
-static gint qq_send_im(PurpleConnection *gc, const gchar *who, const gchar *message, PurpleMessageFlags flags)
-{
- gint type, uid_to;
- gchar *msg, *msg_with_qq_smiley;
- qq_data *qd;
-
- g_return_val_if_fail(who != NULL, -1);
-
- qd = (qq_data *) gc->proto_data;
-
- g_return_val_if_fail(strlen(message) <= QQ_MSG_IM_MAX, -E2BIG);
-
- type = (flags == PURPLE_MESSAGE_AUTO_RESP ? QQ_IM_AUTO_REPLY : QQ_IM_TEXT);
- uid_to = purple_name_to_uid(who);
-
- /* if msg is to myself, bypass the network */
- if (uid_to == qd->uid) {
- serv_got_im(gc, who, message, flags, time(NULL));
- } else {
- msg = utf8_to_qq(message, QQ_CHARSET_DEFAULT);
- msg_with_qq_smiley = purple_smiley_to_qq(msg);
- qq_request_send_im(gc, uid_to, msg_with_qq_smiley, type);
- g_free(msg);
- g_free(msg_with_qq_smiley);
- }
-
- return 1;
-}
-
-/* send a chat msg to a QQ Qun */
-static int qq_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags)
-{
- gchar *msg, *msg_with_qq_smiley;
- guint32 room_id = id;
-
- g_return_val_if_fail(message != NULL, -1);
- g_return_val_if_fail(strlen(message) <= QQ_MSG_IM_MAX, -E2BIG);
-
- 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_request_room_send_im(gc, room_id, msg_with_qq_smiley);
- g_free(msg);
- g_free(msg_with_qq_smiley);
-
- return 1;
-}
-
/* send packet to get who's detailed information */
static void qq_show_buddy_info(PurpleConnection *gc, const gchar *who)
{
@@ -600,7 +497,7 @@
icon_path = qq_get_icon_path(icon_name);
g_free(icon_name);
- purple_debug_info("QQ", "Change prev icon %s to ...\n", icon_path);
+ purple_debug_info("QQ", "Change prev icon %s to...\n", icon_path);
purple_request_file(action, _("Select icon..."), icon_path,
FALSE,
G_CALLBACK(qq_change_icon_cb), NULL,
@@ -761,13 +658,14 @@
g_string_append(info, "khc(at)pidgin.im
\n");
g_string_append(info, "qulogic(at)pidgin.im
\n");
g_string_append(info, "rlaager(at)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, "
\n");
g_string_append(info, _("
And, all the boys in the backroom...
\n"));
g_string_append(info, _("Feel free to join us! :)"));
g_string_append(info, "