annotate libpurple/protocols/qq/qq.c @ 24077:ce94189f15ad

Flos Lonicerae <lonicerae(at)gmail.com> * Merge lonicerae and ccpaging into trunk
author SHiNE CsyFeK <csyfek@gmail.com>
date Wed, 22 Oct 2008 14:52:26 +0000
parents ec3f7d3e0445
children 0a92aa673a33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file qq.c
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
4 * purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18808
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 #include "internal.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "accountopt.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "notify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "prefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "prpl.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "request.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "roomlist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "server.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 #include "buddy_info.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 #include "buddy_opt.h"
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
39 #include "buddy_list.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #include "char_conv.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 #include "group.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 #include "group_find.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #include "group_im.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #include "group_info.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #include "group_join.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #include "group_opt.h"
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
47 #include "group_internal.h"
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
48 #include "qq_define.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 #include "im.h"
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
50 #include "qq_process.h"
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
51 #include "qq_base.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 #include "packet_parse.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 #include "qq.h"
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
54 #include "qq_network.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 #include "send_file.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 #include "utils.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 #include "version.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 #define OPENQ_AUTHOR "Puzzlebird"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 #define OPENQ_WEBSITE "http://openq.sourceforge.net"
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
61
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
62 static GList *server_list_build(gchar select)
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
63 {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
64 GList *list = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
66 if ( select == 'T' || select == 'A') {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
67 list = g_list_append(list, "tcpconn.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
68 list = g_list_append(list, "tcpconn2.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
69 list = g_list_append(list, "tcpconn3.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
70 list = g_list_append(list, "tcpconn4.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
71 list = g_list_append(list, "tcpconn5.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
72 list = g_list_append(list, "tcpconn6.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
73 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
74 if ( select == 'U' || select == 'A') {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
75 list = g_list_append(list, "sz.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
76 list = g_list_append(list, "sz2.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
77 list = g_list_append(list, "sz3.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
78 list = g_list_append(list, "sz4.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
79 list = g_list_append(list, "sz5.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
80 list = g_list_append(list, "sz6.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
81 list = g_list_append(list, "sz7.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
82 list = g_list_append(list, "sz8.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
83 list = g_list_append(list, "sz9.tencent.com:8000");
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
84 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
85 return list;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
86 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
87
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
88 static void server_list_create(PurpleAccount *account)
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
89 {
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
90 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 qq_data *qd;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
92 PurpleProxyInfo *gpi;
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
93 const gchar *user_server;
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
94
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
95 gc = purple_account_get_connection(account);
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
96 g_return_if_fail(gc != NULL && gc->proto_data != NULL);
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
97 qd = gc->proto_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
99 gpi = purple_proxy_get_setup(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
101 qd->use_tcp = purple_account_get_bool(account, "use_tcp", TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102
24019
147ada94a1d8 2008.08.16 - ccpaging <ecc_hy(at)hotmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23758
diff changeset
103 user_server = purple_account_get_string(account, "server", NULL);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
104 purple_debug_info("QQ", "Select server '%s'\n", user_server);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
105 if ( (user_server != NULL && strlen(user_server) > 0) && strcasecmp(user_server, "auto") != 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
106 qd->servers = g_list_append(qd->servers, g_strdup(user_server));
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
107 return;
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
108 }
24019
147ada94a1d8 2008.08.16 - ccpaging <ecc_hy(at)hotmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23758
diff changeset
109
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
110 if (qd->use_tcp) {
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
111 qd->servers = server_list_build('T');
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
112 return;
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
113 }
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
114
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
115 qd->servers = server_list_build('U');
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
116 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
118 static void server_list_remove_all(qq_data *qd)
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
119 {
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
120 g_return_if_fail(qd != NULL);
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
121
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
122 purple_debug_info("QQ", "free server list\n");
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
123 g_list_free(qd->servers);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
124 qd->curr_server = NULL;
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
125 }
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
126
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
127 static void qq_login(PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 {
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
129 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 qq_data *qd;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
131 PurplePresence *presence;
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
132 const gchar *version_str;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
136 gc = purple_account_get_connection(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137 g_return_if_fail(gc != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
139 gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_AUTO_RESP;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 qd = g_new0(qq_data, 1);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
142 memset(qd, 0, sizeof(qq_data));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 qd->gc = gc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 gc->proto_data = qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
146 presence = purple_account_get_presence(account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
147 if(purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_INVISIBLE)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 qd->login_mode = QQ_LOGIN_MODE_HIDDEN;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
149 } else if(purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_AWAY)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
150 || purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_EXTENDED_AWAY)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 qd->login_mode = QQ_LOGIN_MODE_AWAY;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 qd->login_mode = QQ_LOGIN_MODE_NORMAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
156 server_list_create(account);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
157 purple_debug_info("QQ", "Server list has %d\n", g_list_length(qd->servers));
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
158
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
159 version_str = purple_account_get_string(account, "client_version", NULL);
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
160 qd->client_tag = QQ_CLIENT_0D55; /* set default as QQ2005 */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
161 qd->client_version = 2005;
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
162 if (version_str != NULL && strlen(version_str) != 0) {
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
163 if (strcmp(version_str, "qq2007") == 0) {
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
164 qd->client_tag = QQ_CLIENT_111D;
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
165 qd->client_version = 2007;
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
166 } else if (strcmp(version_str, "qq2008") == 0) {
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
167 qd->client_tag = QQ_CLIENT_115B;
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
168 qd->client_version = 2008;
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
169 }
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
170 }
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
171
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
172 qd->is_show_notice = purple_account_get_bool(account, "show_notice", TRUE);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
173 qd->is_show_news = purple_account_get_bool(account, "show_news", TRUE);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
174
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
175 qd->resend_times = purple_prefs_get_int("/plugins/prpl/qq/resend_times");
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
176 if (qd->resend_times <= 1) qd->itv_config.resend = 4;
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
177
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
178 qd->itv_config.resend = purple_prefs_get_int("/plugins/prpl/qq/resend_interval");
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
179 if (qd->itv_config.resend <= 0) qd->itv_config.resend = 3;
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
180 purple_debug_info("QQ", "Resend interval %d, retries %d\n",
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
181 qd->itv_config.resend, qd->resend_times);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
183 qd->itv_config.keep_alive = purple_account_get_int(account, "keep_alive_interval", 60);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
184 if (qd->itv_config.keep_alive < 30) qd->itv_config.keep_alive = 30;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
185 qd->itv_config.keep_alive /= qd->itv_config.resend;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
186 qd->itv_count.keep_alive = qd->itv_config.keep_alive;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
188 qd->itv_config.update = purple_account_get_int(account, "update_interval", 300);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
189 if (qd->itv_config.update > 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
190 if (qd->itv_config.update < qd->itv_config.keep_alive) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
191 qd->itv_config.update = qd->itv_config.keep_alive;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
192 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
193 qd->itv_config.update /= qd->itv_config.resend;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
194 qd->itv_count.update = qd->itv_config.update;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
195 } else {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
196 qd->itv_config.update = 0;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
197 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
198
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
199 qd->connect_watcher = purple_timeout_add_seconds(0, qq_connect_later, gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
202 /* clean up the given QQ connection and free all resources */
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
203 static void qq_close(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 {
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
205 qq_data *qd;
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
206
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
207 g_return_if_fail(gc != NULL && gc->proto_data);
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
208 qd = gc->proto_data;
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
209
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
210 if (qd->check_watcher > 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
211 purple_timeout_remove(qd->check_watcher);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
212 qd->check_watcher = 0;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
213 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
214
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
215 if (qd->connect_watcher > 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
216 purple_timeout_remove(qd->connect_watcher);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
217 qd->connect_watcher = 0;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
218 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
219
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
220 qq_disconnect(gc);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
221
24070
832178d951ca 2008.09.30 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24068
diff changeset
222 if (qd->redirect) g_free(qd->redirect);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
223 if (qd->ld.token) g_free(qd->ld.token);
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
224 if (qd->ld.token_ex) g_free(qd->ld.token_ex);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
225 if (qd->captcha.token) g_free(qd->captcha.token);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
226 if (qd->captcha.data) g_free(qd->captcha.data);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
227
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
228 server_list_remove_all(qd);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
229
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
230 g_free(qd);
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
231 gc->proto_data = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 /* returns the icon name for a buddy or protocol */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
235 static const gchar *qq_list_icon(PurpleAccount *a, PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 return "qq";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 /* a short status text beside buddy icon*/
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
242 static gchar *qq_status_text(PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 qq_buddy *q_bud;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245 GString *status;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 q_bud = (qq_buddy *) b->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 if (q_bud == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 status = g_string_new("");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 switch(q_bud->status) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254 case QQ_BUDDY_OFFLINE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 g_string_append(status, _("Offline"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 case QQ_BUDDY_ONLINE_NORMAL:
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
258 g_string_append(status, _("Online"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 /* TODO What does this status mean? Labelling it as offline... */
23756
1a0caf9983fa applied changes from 92d52eef2994d2697999177804e3665989cfa352
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23755
diff changeset
261 case QQ_BUDDY_CHANGE_TO_OFFLINE:
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 g_string_append(status, _("Offline"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 case QQ_BUDDY_ONLINE_AWAY:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 g_string_append(status, _("Away"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 case QQ_BUDDY_ONLINE_INVISIBLE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 g_string_append(status, _("Invisible"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 break;
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
270 case QQ_BUDDY_ONLINE_BUSY:
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
271 g_string_append(status, _("Busy"));
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
272 break;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 default:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 g_string_printf(status, _("Unknown-%d"), q_bud->status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 return g_string_free(status, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 /* a floating text when mouse is on the icon, show connection status here */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
282 static void qq_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284 qq_buddy *q_bud;
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
285 gchar *tmp;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
286 GString *str;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 g_return_if_fail(b != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 q_bud = (qq_buddy *) b->proto_data;
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
291 if (q_bud == NULL)
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
292 return;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
293
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
294 /* if (PURPLE_BUDDY_IS_ONLINE(b) && q_bud != NULL) */
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
295 if (q_bud->ip.s_addr != 0) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
296 str = g_string_new(NULL);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
297 g_string_printf(str, "%s:%d", inet_ntoa(q_bud->ip), q_bud->port);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
298 if (q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
299 g_string_append(str, " TCP");
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
300 } else {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
301 g_string_append(str, " UDP");
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
302 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
303 g_string_free(str, TRUE);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
304 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
306 tmp = g_strdup_printf("%d", q_bud->age);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
307 purple_notify_user_info_add_pair(user_info, _("Age"), tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
308 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
310 switch (q_bud->gender) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
311 case QQ_BUDDY_GENDER_GG:
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
312 purple_notify_user_info_add_pair(user_info, _("Gender"), _("Male"));
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
313 break;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
314 case QQ_BUDDY_GENDER_MM:
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
315 purple_notify_user_info_add_pair(user_info, _("Gender"), _("Female"));
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
316 break;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
317 case QQ_BUDDY_GENDER_UNKNOWN:
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
318 purple_notify_user_info_add_pair(user_info, _("Gender"), _("Unknown"));
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
319 break;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
320 default:
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
321 tmp = g_strdup_printf("Error (%d)", q_bud->gender);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
322 purple_notify_user_info_add_pair(user_info, _("Gender"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323 g_free(tmp);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
324 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
326 if (q_bud->level) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
327 tmp = g_strdup_printf("%d", q_bud->level);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
328 purple_notify_user_info_add_pair(user_info, _("Level"), tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
329 g_free(tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
330 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
331
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
332 str = g_string_new(NULL);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
333 if (q_bud->comm_flag & QQ_COMM_FLAG_QQ_MEMBER) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
334 g_string_append( str, _("Member") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
335 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
336 if (q_bud->comm_flag & QQ_COMM_FLAG_QQ_VIP) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
337 g_string_append( str, _(" VIP") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
338 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
339 if (q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
340 g_string_append( str, _(" TCP") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
341 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
342 if (q_bud->comm_flag & QQ_COMM_FLAG_MOBILE) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
343 g_string_append( str, _(" FromMobile") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
344 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
345 if (q_bud->comm_flag & QQ_COMM_FLAG_BIND_MOBILE) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
346 g_string_append( str, _(" BindMobile") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
347 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
348 if (q_bud->comm_flag & QQ_COMM_FLAG_VIDEO) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
349 g_string_append( str, _(" Video") );
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
350 }
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
351
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
352 if (q_bud->ext_flag & QQ_EXT_FLAG_ZONE) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
353 g_string_append( str, _(" Zone") );
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
354 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
355 purple_notify_user_info_add_pair(user_info, _("Flag"), str->str);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
356
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
357 g_string_free(str, TRUE);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
358
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
359 #ifdef DEBUG
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
360 tmp = g_strdup_printf( "%s (%04X)",
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
361 qq_get_ver_desc(q_bud->client_tag),
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
362 q_bud->client_tag );
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
363 purple_notify_user_info_add_pair(user_info, _("Ver"), tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
364 g_free(tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
365
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
366 tmp = g_strdup_printf( "Ext 0x%X, Comm 0x%X",
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
367 q_bud->ext_flag, q_bud->comm_flag );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
368 purple_notify_user_info_add_pair(user_info, _("Flag"), tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
369 g_free(tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
370 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373 /* we can show tiny icons on the four corners of buddy icon, */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
374 static const char *qq_list_emblem(PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
376 /* each char** are refering to a filename in pixmaps/purple/status/default/ */
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
377 qq_buddy *q_bud;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
378
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
379 if (!b || !(q_bud = b->proto_data)) {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
380 return NULL;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
381 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
383 if (q_bud->comm_flag & QQ_COMM_FLAG_MOBILE)
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
384 return "mobile";
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
385 if (q_bud->comm_flag & QQ_COMM_FLAG_VIDEO)
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
386 return "video";
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
387 if (q_bud->comm_flag & QQ_COMM_FLAG_QQ_MEMBER)
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
388 return "qq_member";
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
390 return NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
392
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
393 /* QQ away status (used to initiate QQ away packet) */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
394 static GList *qq_status_types(PurpleAccount *ga)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
396 PurpleStatusType *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
397 GList *types = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
399 status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE,
18807
b9a0b1bd321b Improve a bunch of strings in QQ
Mark Doliner <mark@kingant.net>
parents: 18740
diff changeset
400 "available", _("Available"), FALSE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
401 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
402
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
403 status = purple_status_type_new_full(PURPLE_STATUS_AWAY,
18807
b9a0b1bd321b Improve a bunch of strings in QQ
Mark Doliner <mark@kingant.net>
parents: 18740
diff changeset
404 "away", _("Away"), FALSE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
405 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
407 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE,
18807
b9a0b1bd321b Improve a bunch of strings in QQ
Mark Doliner <mark@kingant.net>
parents: 18740
diff changeset
408 "invisible", _("Invisible"), FALSE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
411 status = purple_status_type_new_full(PURPLE_STATUS_UNAVAILABLE,
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
412 "busy", _("Busy"), TRUE, TRUE, FALSE);
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
413 types = g_list_append(types, status);
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
414
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
415 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE,
18807
b9a0b1bd321b Improve a bunch of strings in QQ
Mark Doliner <mark@kingant.net>
parents: 18740
diff changeset
416 "offline", _("Offline"), FALSE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
417 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
419 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE,
15528
b258250b72c9 I think this is proper mobile support for QQ. Mark, do you want to check that out?
Sean Egan <seanegan@gmail.com>
parents: 15463
diff changeset
420 "mobile", NULL, FALSE, FALSE, TRUE);
b258250b72c9 I think this is proper mobile support for QQ. Mark, do you want to check that out?
Sean Egan <seanegan@gmail.com>
parents: 15463
diff changeset
421 types = g_list_append(types, status);
b258250b72c9 I think this is proper mobile support for QQ. Mark, do you want to check that out?
Sean Egan <seanegan@gmail.com>
parents: 15463
diff changeset
422
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423 return types;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
426 /* initiate QQ away with proper change_status packet */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
427 static void qq_change_status(PurpleAccount *account, PurpleStatus *status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
428 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
429 PurpleConnection *gc = purple_account_get_connection(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
431 qq_request_change_status(gc, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
434 /* IMPORTANT: PurpleConvImFlags -> PurpleMessageFlags */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435 /* send an instant msg to a buddy */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
436 static gint qq_send_im(PurpleConnection *gc, const gchar *who, const gchar *message, PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 {
24077
ce94189f15ad Flos Lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24076
diff changeset
438 gint type, uid_to;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 gchar *msg, *msg_with_qq_smiley;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 g_return_val_if_fail(who != NULL, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 qd = (qq_data *) gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 g_return_val_if_fail(strlen(message) <= QQ_MSG_IM_MAX, -E2BIG);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
448 type = (flags == PURPLE_MESSAGE_AUTO_RESP ? QQ_IM_AUTO_REPLY : QQ_IM_TEXT);
24077
ce94189f15ad Flos Lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24076
diff changeset
449 uid_to = purple_name_to_uid(who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451 /* if msg is to myself, bypass the network */
24077
ce94189f15ad Flos Lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24076
diff changeset
452 if (uid_to == qd->uid) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 serv_got_im(gc, who, message, flags, time(NULL));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 msg = utf8_to_qq(message, QQ_CHARSET_DEFAULT);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
456 msg_with_qq_smiley = purple_smiley_to_qq(msg);
24077
ce94189f15ad Flos Lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24076
diff changeset
457 qq_request_send_im(gc, uid_to, msg_with_qq_smiley, type);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
458 g_free(msg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 g_free(msg_with_qq_smiley);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 return 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 /* send a chat msg to a QQ Qun */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
466 static int qq_chat_send(PurpleConnection *gc, int channel, const char *message, PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468 gchar *msg, *msg_with_qq_smiley;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 qq_group *group;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
470
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 g_return_val_if_fail(message != NULL, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472 g_return_val_if_fail(strlen(message) <= QQ_MSG_IM_MAX, -E2BIG);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
473
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 group = qq_group_find_by_channel(gc, channel);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 g_return_val_if_fail(group != NULL, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
477 purple_debug_info("QQ_MESG", "Send qun mesg in utf8: %s\n", message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 msg = utf8_to_qq(message, QQ_CHARSET_DEFAULT);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
479 msg_with_qq_smiley = purple_smiley_to_qq(msg);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
480 qq_send_packet_group_im(gc, group, msg_with_qq_smiley);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 g_free(msg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482 g_free(msg_with_qq_smiley);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 return 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
487 /* send packet to get who's detailed information */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
488 static void qq_show_buddy_info(PurpleConnection *gc, const gchar *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 guint32 uid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 qd = gc->proto_data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
494 uid = purple_name_to_uid(who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 if (uid <= 0) {
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
497 purple_debug_error("QQ", "Not valid QQid: %s\n", who);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
498 purple_notify_error(gc, NULL, _("Invalid name"), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501
24073
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
502 if (qd->client_version >= 2007) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
503 qq_request_get_level_2007(gc, uid);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
504 } else {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
505 qq_request_get_level(gc, uid);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
506 }
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
507 qq_request_buddy_info(gc, uid, 0, QQ_BUDDY_INFO_DISPLAY);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
510 static void action_update_all_rooms(PurplePluginAction *action)
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
511 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
512 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
513 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
514 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
515
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
516 if ( !qd->is_login ) {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
517 return;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
518 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
519
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
520 qq_update_all_rooms(gc, 0, 0);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
521 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
522
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
523 static void action_modify_info_base(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
525 PurpleConnection *gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 qd = (qq_data *) gc->proto_data;
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
529 qq_request_buddy_info(gc, qd->uid, 0, QQ_BUDDY_INFO_MODIFY_BASE);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
530 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
531
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
532 static void action_modify_info_ext(PurplePluginAction *action)
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
533 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
534 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
535 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
536
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
537 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
538 qq_request_buddy_info(gc, qd->uid, 0, QQ_BUDDY_INFO_MODIFY_EXT);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
539 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
541 static void action_modify_info_addr(PurplePluginAction *action)
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
542 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
543 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
544 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
545
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
546 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
547 qq_request_buddy_info(gc, qd->uid, 0, QQ_BUDDY_INFO_MODIFY_ADDR);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
548 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
549
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
550 static void action_modify_info_contact(PurplePluginAction *action)
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
551 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
552 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
553 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
554
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
555 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
556 qq_request_buddy_info(gc, qd->uid, 0, QQ_BUDDY_INFO_MODIFY_CONTACT);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
557 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
558
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
559 static void action_change_password(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
561 purple_notify_uri(NULL, "https://password.qq.com");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
562 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564 /* show a brief summary of what we get from login packet */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
565 static void action_show_account_info(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
567 PurpleConnection *gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569 GString *info;
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
570 struct tm *tm_local;
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
571 int index;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
572
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573 qd = (qq_data *) gc->proto_data;
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
574 info = g_string_new("<html><body>");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
576 tm_local = localtime(&qd->login_time);
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
577 g_string_append_printf(info, _("<b>Login time</b>: %d-%d-%d, %d:%d:%d<br>\n"),
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
578 (1900 +tm_local->tm_year), (1 + tm_local->tm_mon), tm_local->tm_mday,
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
579 tm_local->tm_hour, tm_local->tm_min, tm_local->tm_sec);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
580 g_string_append_printf(info, _("<b>Online Buddies</b>: %d<br>\n"), qd->online_total);
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
581 tm_local = localtime(&qd->online_last_update);
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
582 g_string_append_printf(info, _("<b>Last Refresh</b>: %d-%d-%d, %d:%d:%d<br>\n"),
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
583 (1900 +tm_local->tm_year), (1 + tm_local->tm_mon), tm_local->tm_mday,
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
584 tm_local->tm_hour, tm_local->tm_min, tm_local->tm_sec);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
586 g_string_append(info, "<hr>");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
587
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
588 g_string_append_printf(info, _("<b>Server</b>: %s<br>\n"), qd->curr_server);
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
589 g_string_append_printf(info, _("<b>Client Tag</b>: %s<br>\n"), qq_get_ver_desc(qd->client_tag));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
590 g_string_append_printf(info, _("<b>Connection Mode</b>: %s<br>\n"), qd->use_tcp ? "TCP" : "UDP");
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
591 g_string_append_printf(info, _("<b>My Internet IP</b>: %s<br>\n"), inet_ntoa(qd->my_ip));
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
592
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
593 g_string_append(info, "<hr>");
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
594 g_string_append(info, "<i>Network Status</i><br>\n");
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
595 g_string_append_printf(info, _("<b>Sent</b>: %lu<br>\n"), qd->net_stat.sent);
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
596 g_string_append_printf(info, _("<b>Resend</b>: %lu<br>\n"), qd->net_stat.resend);
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
597 g_string_append_printf(info, _("<b>Lost</b>: %lu<br>\n"), qd->net_stat.lost);
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
598 g_string_append_printf(info, _("<b>Received</b>: %lu<br>\n"), qd->net_stat.rcved);
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
599 g_string_append_printf(info, _("<b>Received Duplicate</b>: %lu<br>\n"), qd->net_stat.rcved_dup);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
600
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
601 g_string_append(info, "<hr>");
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
602 g_string_append(info, "<i>Last Login Information</i><br>\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
603
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
604 for (index = 0; index < sizeof(qd->last_login_time) / sizeof(time_t); index++) {
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
605 tm_local = localtime(&qd->last_login_time[index]);
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
606 g_string_append_printf(info, _("<b>Time</b>: %d-%d-%d, %d:%d:%d<br>\n"),
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
607 (1900 +tm_local->tm_year), (1 + tm_local->tm_mon), tm_local->tm_mday,
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
608 tm_local->tm_hour, tm_local->tm_min, tm_local->tm_sec);
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
609 }
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
610 if (qd->last_login_ip.s_addr != 0) {
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
611 g_string_append_printf(info, _("<b>IP</b>: %s<br>\n"), inet_ntoa(qd->last_login_ip));
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
612 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
613
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
614 g_string_append(info, "</body></html>");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
616 purple_notify_formatted(gc, NULL, _("Login Information"), NULL, info->str, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
617
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 g_string_free(info, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
619 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
622 static void _qq_menu_search_or_add_permanent_group(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
623 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
624 purple_roomlist_show_with_account(NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
627
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
629 static void _qq_menu_create_permanent_group(PurplePluginAction * action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
630 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
631 PurpleConnection *gc = (PurpleConnection *) action->context;
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
632 purple_request_input(gc, _("Create QQ Qun"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 _("Input Qun name here"),
18807
b9a0b1bd321b Improve a bunch of strings in QQ
Mark Doliner <mark@kingant.net>
parents: 18740
diff changeset
634 _("Only QQ members can create permanent Qun"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
635 "OpenQ", FALSE, FALSE, NULL,
23753
5f454b975a99 2008.08.10 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23688
diff changeset
636 _("Create"), G_CALLBACK(qq_room_create_new), _("Cancel"), NULL, gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
640 static void action_chat_quit(PurpleBlistNode * node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
642 PurpleChat *chat = (PurpleChat *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
643 PurpleConnection *gc = purple_account_get_connection(chat->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
644 GHashTable *components = chat -> components;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
645
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
646 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
647
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648 g_return_if_fail(components != NULL);
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
649 qq_room_quit(gc, components);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
650 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
651
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
652 static void action_chat_get_info(PurpleBlistNode * node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
653 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
654 PurpleChat *chat = (PurpleChat *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
655 PurpleConnection *gc = purple_account_get_connection(chat->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656 GHashTable *components = chat -> components;
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
657 gchar *uid_str;
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
658 guint32 uid;
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
659 qq_group *group;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
660
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
661 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
662
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
663 g_return_if_fail(components != NULL);
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
664
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
665 uid_str = g_hash_table_lookup(components, QQ_ROOM_KEY_INTERNAL_ID);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
666 uid = strtol(uid_str, NULL, 10);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
667
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
668 group = qq_room_search_id(gc, uid);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
669 if (group == NULL) {
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
670 return;
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
671 }
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
672 g_return_if_fail(group->id > 0);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
673
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
674 qq_send_room_cmd_mess(gc, QQ_ROOM_CMD_GET_INFO, group->id, NULL, 0,
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
675 QQ_CMD_CLASS_UPDATE_ROOM, QQ_ROOM_INFO_DISPLAY);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
676 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
677
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
678 #if 0
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
679 /* TODO: re-enable this */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
680 static void _qq_menu_send_file(PurpleBlistNode * node, gpointer ignored)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
681 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
682 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
683 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
684 qq_buddy *q_bud;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
686 g_return_if_fail (PURPLE_BLIST_NODE_IS_BUDDY (node));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
687 buddy = (PurpleBuddy *) node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
688 q_bud = (qq_buddy *) buddy->proto_data;
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
689 /* if (is_online (q_bud->status)) { */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
690 gc = purple_account_get_connection (buddy->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
691 g_return_if_fail (gc != NULL && gc->proto_data != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692 qq_send_file(gc, buddy->name, NULL);
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
693 /* } */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
694 }
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
695 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
696
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
697 /* protocol related menus */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
698 static GList *qq_actions(PurplePlugin *plugin, gpointer context)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
699 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
700 GList *m;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
701 PurplePluginAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703 m = NULL;
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
704 act = purple_plugin_action_new(_("Modify Information"), action_modify_info_base);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
705 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
706
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
707 act = purple_plugin_action_new(_("Modify Extend Information"), action_modify_info_ext);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
708 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
709
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
710 act = purple_plugin_action_new(_("Modify Address"), action_modify_info_addr);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
711 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
712
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
713 act = purple_plugin_action_new(_("Modify Contact"), action_modify_info_contact);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
716 act = purple_plugin_action_new(_("Change Password"), action_change_password);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
717 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
718
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
719 act = purple_plugin_action_new(_("Account Information"), action_show_account_info);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
720 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
721
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
722 act = purple_plugin_action_new(_("Update all QQ Quns"), action_update_all_rooms);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
724
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
725 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
726 act = purple_plugin_action_new(_("Qun: Search a permanent Qun"), _qq_menu_search_or_add_permanent_group);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
728
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
729 act = purple_plugin_action_new(_("Qun: Create a permanent Qun"), _qq_menu_create_permanent_group);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
731 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
733 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
734 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
736 /* chat-related (QQ Qun) menu shown up with right-click */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
737 static GList *qq_chat_menu(PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
738 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739 GList *m;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
740 PurpleMenuAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
741
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
742 m = NULL;
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
743 act = purple_menu_action_new(_("Get Info"), PURPLE_CALLBACK(action_chat_get_info), NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
744 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
745
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
746 act = purple_menu_action_new(_("Quit Qun"), PURPLE_CALLBACK(action_chat_quit), NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
747 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
748 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
749 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 /* buddy-related menu shown up with right-click */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
752 static GList *qq_buddy_menu(PurpleBlistNode * node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
754 GList *m;
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
755 PurpleMenuAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
756
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
757 if(PURPLE_BLIST_NODE_IS_CHAT(node))
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
758 return qq_chat_menu(node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
759
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
760 m = NULL;
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
761
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
762 act = purple_menu_action_new(_("Remove both side"), PURPLE_CALLBACK(qq_remove_buddy_and_me), NULL, NULL); /* add NULL by gfhuang */
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
763 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
764
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
765 /* TODO : not working, temp commented out by gfhuang */
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
766 #if 0
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
767 /* if (q_bud && is_online(q_bud->status)) { */
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
768 act = purple_menu_action_new(_("Send File"), PURPLE_CALLBACK(_qq_menu_send_file), NULL, NULL); /* add NULL by gfhuang */
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
769 m = g_list_append(m, act);
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
770 /* } */
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
771 #endif
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
772
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
774 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
776 /* convert chat nickname to uid to get this buddy info */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
777 /* who is the nickname of buddy in QQ chat-room (Qun) */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
778 static void qq_get_chat_buddy_info(PurpleConnection *gc, gint channel, const gchar *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779 {
24073
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
780 qq_data *qd;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
781 gchar *uid_str;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
782 guint32 uid;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
783
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
784 g_return_if_fail(who != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
785
24073
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
786 uid_str = chat_name_to_purple_name(who);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
787 if (uid_str == NULL) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
788 return;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
789 }
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
790
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
791 qd = gc->proto_data;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
792 uid = purple_name_to_uid(uid_str);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
793 g_free(uid_str);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
794
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
795 if (uid <= 0) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
796 purple_debug_error("QQ", "Not valid chat name: %s\n", who);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
797 purple_notify_error(gc, NULL, _("Invalid name"), NULL);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
798 return;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
799 }
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
800
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
801 if (qd->client_version < 2007) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
802 qq_request_get_level(gc, uid);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
803 }
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
804 qq_request_buddy_info(gc, uid, 0, QQ_BUDDY_INFO_DISPLAY);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
805 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
806
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
807 /* convert chat nickname to uid to invite individual IM to buddy */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
808 /* who is the nickname of buddy in QQ chat-room (Qun) */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
809 static gchar *qq_get_chat_buddy_real_name(PurpleConnection *gc, gint channel, const gchar *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
810 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
811 g_return_val_if_fail(who != NULL, NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
812 return chat_name_to_purple_name(who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
813 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
814
23758
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
815 static PurplePluginProtocolInfo prpl_info =
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
816 {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
817 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_USE_POINTSIZE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
818 NULL, /* user_splits */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
819 NULL, /* protocol_options */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
820 {"png", 96, 96, 96, 96, 0, PURPLE_ICON_SCALE_SEND}, /* icon_spec */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
821 qq_list_icon, /* list_icon */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
822 qq_list_emblem, /* list_emblems */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
823 qq_status_text, /* status_text */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
824 qq_tooltip_text, /* tooltip_text */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
825 qq_status_types, /* away_states */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
826 qq_buddy_menu, /* blist_node_menu */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
827 qq_chat_info, /* chat_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
828 qq_chat_info_defaults, /* chat_info_defaults */
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
829 qq_login, /* open */
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
830 qq_close, /* close */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
831 qq_send_im, /* send_im */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
832 NULL, /* set_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
833 NULL, /* send_typing */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
834 qq_show_buddy_info, /* get_info */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
835 qq_change_status, /* change status */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
836 NULL, /* set_idle */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
837 NULL, /* change_passwd */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
838 qq_add_buddy, /* add_buddy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
839 NULL, /* add_buddies */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
840 qq_remove_buddy, /* remove_buddy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
841 NULL, /* remove_buddies */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
842 NULL, /* add_permit */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
843 NULL, /* add_deny */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
844 NULL, /* rem_permit */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
845 NULL, /* rem_deny */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
846 NULL, /* set_permit_deny */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
847 qq_group_join, /* join_chat */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
848 NULL, /* reject chat invite */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
849 NULL, /* get_chat_name */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
850 NULL, /* chat_invite */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
851 NULL, /* chat_leave */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
852 NULL, /* chat_whisper */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
853 qq_chat_send, /* chat_send */
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
854 NULL, /* keepalive */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
855 NULL, /* register_user */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
856 qq_get_chat_buddy_info, /* get_cb_info */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
857 NULL, /* get_cb_away */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
858 NULL, /* alias_buddy */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
859 qq_change_buddys_group, /* group_buddy */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
860 NULL, /* rename_group */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
861 NULL, /* buddy_free */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
862 NULL, /* convo_closed */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
863 NULL, /* normalize */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
864 qq_set_buddy_icon, /* set_buddy_icon */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
865 NULL, /* remove_group */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
866 qq_get_chat_buddy_real_name, /* get_cb_real_name */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
867 NULL, /* set_chat_topic */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
868 NULL, /* find_blist_chat */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
869 qq_roomlist_get_list, /* roomlist_get_list */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
870 qq_roomlist_cancel, /* roomlist_cancel */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
871 NULL, /* roomlist_expand_category */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
872 NULL, /* can_receive_file */
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
873 NULL, /* qq_send_file send_file */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
874 NULL, /* new xfer */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
875 NULL, /* offline_message */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
876 NULL, /* PurpleWhiteboardPrplOps */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
877 NULL, /* send_raw */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
878 NULL, /* roomlist_room_serialize */
23758
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
879 NULL, /* unregister_user */
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
880 NULL, /* send_attention */
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
881 NULL, /* get attention_types */
16675
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
882
23758
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
883 sizeof(PurplePluginProtocolInfo), /* struct_size */
23112
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
884 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
885 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
886
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
887 static PurplePluginInfo info = {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
888 PURPLE_PLUGIN_MAGIC,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
889 PURPLE_MAJOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
890 PURPLE_MINOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
891 PURPLE_PLUGIN_PROTOCOL, /**< type */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892 NULL, /**< ui_requirement */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
893 0, /**< flags */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
894 NULL, /**< dependencies */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
895 PURPLE_PRIORITY_DEFAULT, /**< priority */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
896
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
897 "prpl-qq", /**< id */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
898 "QQ", /**< name */
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 19680
diff changeset
899 DISPLAY_VERSION, /**< version */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
900 /** summary */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
901 N_("QQ Protocol Plugin"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
902 /** description */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
903 N_("QQ Protocol Plugin"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
904 OPENQ_AUTHOR, /**< author */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
905 OPENQ_WEBSITE, /**< homepage */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
906
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
907 NULL, /**< load */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
908 NULL, /**< unload */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
909 NULL, /**< destroy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
910
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
911 NULL, /**< ui_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
912 &prpl_info, /**< extra_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
913 NULL, /**< prefs_info */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
914 qq_actions,
16675
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
915
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
916 /* padding */
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
917 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
918 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
919 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
920 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
921 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
922
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
923
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
924 static void init_plugin(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
925 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
926 PurpleAccountOption *option;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
927 PurpleKeyValuePair *kvp;
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
928 GList *server_list = NULL;
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
929 GList *server_kv_list = NULL;
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
930 GList *it;
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
931 //#ifdef DEBUG
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
932 GList *version_kv_list = NULL;
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
933 //#endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
934
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
935 server_list = server_list_build('A');
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
936
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
937 purple_prefs_add_string_list("/plugins/prpl/qq/serverlist", server_list);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
938 server_list = purple_prefs_get_string_list("/plugins/prpl/qq/serverlist");
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
939
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
940 server_kv_list = NULL;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
941 kvp = g_new0(PurpleKeyValuePair, 1);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
942 kvp->key = g_strdup(_("Auto"));
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
943 kvp->value = g_strdup("auto");
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
944 server_kv_list = g_list_append(server_kv_list, kvp);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
945
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
946 it = server_list;
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
947 while(it) {
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
948 if (it->data != NULL && strlen(it->data) > 0) {
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
949 kvp = g_new0(PurpleKeyValuePair, 1);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
950 kvp->key = g_strdup(it->data);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
951 kvp->value = g_strdup(it->data);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
952 server_kv_list = g_list_append(server_kv_list, kvp);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
953 }
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
954 it = it->next;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
955 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
956
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
957 g_list_free(server_list);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
958
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
959 option = purple_account_option_list_new(_("Select Server"), "server", server_kv_list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
960 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
961
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
962 //#ifdef DEBUG
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
963 kvp = g_new0(PurpleKeyValuePair, 1);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
964 kvp->key = g_strdup(_("QQ2005"));
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
965 kvp->value = g_strdup("qq2005");
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
966 version_kv_list = g_list_append(version_kv_list, kvp);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
967
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
968 kvp = g_new0(PurpleKeyValuePair, 1);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
969 kvp->key = g_strdup(_("QQ2007"));
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
970 kvp->value = g_strdup("qq2007");
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
971 version_kv_list = g_list_append(version_kv_list, kvp);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
972
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
973 kvp = g_new0(PurpleKeyValuePair, 1);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
974 kvp->key = g_strdup(_("QQ2008"));
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
975 kvp->value = g_strdup("qq2008");
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
976 version_kv_list = g_list_append(version_kv_list, kvp);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
977
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
978 option = purple_account_option_list_new(_("Client Version"), "client_version", version_kv_list);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
979 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
980 //#endif
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
981
23755
23cec4360d4a applied changes from 8cebefbc6cd5d84acb69c74e69e8821f11dd225d
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23754
diff changeset
982 option = purple_account_option_bool_new(_("Connect by TCP"), "use_tcp", TRUE);
24021
6408be948d56 disapproval of revision '92d52eef2994d2697999177804e3665989cfa352'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24020
diff changeset
983 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
984
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
985 option = purple_account_option_bool_new(_("Show server notice"), "show_notice", TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
986 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
987
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
988 option = purple_account_option_bool_new(_("Show server news"), "show_news", TRUE);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
989 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
990
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
991 option = purple_account_option_int_new(_("Keep alive interval(s)"), "keep_alive_interval", 60);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
992 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
993
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
994 option = purple_account_option_int_new(_("Update interval(s)"), "update_interval", 300);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
995 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
996
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
997 purple_prefs_add_none("/plugins/prpl/qq");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
998 purple_prefs_add_bool("/plugins/prpl/qq/show_status_by_icon", TRUE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
999 purple_prefs_add_bool("/plugins/prpl/qq/show_fake_video", FALSE);
23756
1a0caf9983fa applied changes from 92d52eef2994d2697999177804e3665989cfa352
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23755
diff changeset
1000 purple_prefs_add_bool("/plugins/prpl/qq/show_room_when_newin", TRUE);
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
1001 purple_prefs_add_int("/plugins/prpl/qq/resend_interval", 3);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
1002 purple_prefs_add_int("/plugins/prpl/qq/resend_times", 10);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1003 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1004
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1005 PURPLE_INIT_PLUGIN(qq, init_plugin, info);