annotate libpurple/protocols/qq/qq.c @ 30863:351d07aefb09

Kill off many dead assignments and any useless remaining variables. I think some of those QQ ones were actual logic errors, too. Let me know if there were any side-effects that were cut.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 23 Aug 2010 00:52:24 +0000
parents c60c9c95bb00
children 3a94faf350c7
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"
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
32 #include "privacy.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "request.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "roomlist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #include "server.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 #include "buddy_info.h"
25146
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25070
diff changeset
39 #include "buddy_memo.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #include "buddy_opt.h"
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
41 #include "buddy_list.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 #include "char_conv.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #include "group.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #include "group_im.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #include "group_info.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #include "group_join.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 #include "group_opt.h"
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
48 #include "group_internal.h"
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
49 #include "qq_define.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 #include "im.h"
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
51 #include "qq_process.h"
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
52 #include "qq_base.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 #include "packet_parse.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 #include "qq.h"
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
55 #include "qq_network.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 #include "send_file.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 #include "utils.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 #include "version.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59
25150
d673ccc44a6e 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25149
diff changeset
60 #define OPENQ_VERSION "0.3.2-p20"
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;
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
92 const gchar *custom_server;
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
93
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
94 gc = purple_account_get_connection(account);
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
95 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
96 qd = gc->proto_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
98 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
99
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
100 custom_server = purple_account_get_string(account, "server", NULL);
24610
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
101
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
102 if (custom_server != NULL) {
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
103 purple_debug_info("QQ", "Select server '%s'\n", custom_server);
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
104 if (*custom_server != '\0' && g_ascii_strcasecmp(custom_server, "auto") != 0) {
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
105 qd->servers = g_list_append(qd->servers, g_strdup(custom_server));
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
106 return;
9ffd54bf622a fixes a printf crash on Windows, reported by InstantBird developer fqueze
Ka-Hing Cheung <khc@hxbc.us>
parents: 24603
diff changeset
107 }
23053
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;
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
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 {
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
120 g_return_if_fail(qd != NULL);
23053
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");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
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)
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
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);
24842
effbf24b39b1 2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24839
diff changeset
174 qd->is_show_chat = purple_account_get_bool(account, "show_chat", TRUE);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
175
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
176 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
177 if (qd->resend_times <= 1) qd->itv_config.resend = 4;
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
178
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
179 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
180 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
181 purple_debug_info("QQ", "Resend interval %d, retries %d\n",
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
182 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
183
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
184 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
185 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
186 qd->itv_config.keep_alive /= qd->itv_config.resend;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
187 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
188
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
189 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
190 if (qd->itv_config.update > 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
191 if (qd->itv_config.update < qd->itv_config.keep_alive) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
192 qd->itv_config.update = qd->itv_config.keep_alive;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
193 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
194 qd->itv_config.update /= qd->itv_config.resend;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
195 qd->itv_count.update = qd->itv_config.update;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
196 } else {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
197 qd->itv_config.update = 0;
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
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
200 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
201 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
203 /* clean up the given QQ connection and free all resources */
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
204 static void qq_close(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 {
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
206 qq_data *qd;
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
207
23053
55f986ccbb6a patch-05-reconnect-and-code-cleanup
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23052
diff changeset
208 g_return_if_fail(gc != NULL && gc->proto_data);
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
209 qd = gc->proto_data;
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
210
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
211 if (qd->check_watcher > 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
212 purple_timeout_remove(qd->check_watcher);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
213 qd->check_watcher = 0;
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
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
216 if (qd->connect_watcher > 0) {
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
217 purple_timeout_remove(qd->connect_watcher);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
218 qd->connect_watcher = 0;
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
219 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
220
30052
99c9595e14a2 Fix two related on-disconnect double frees.
Paul Aurich <paul@darkrain42.org>
parents: 29874
diff changeset
221 /* This is cancelled by _purple_connection_destroy */
99c9595e14a2 Fix two related on-disconnect double frees.
Paul Aurich <paul@darkrain42.org>
parents: 29874
diff changeset
222 qd->conn_data = NULL;
99c9595e14a2 Fix two related on-disconnect double frees.
Paul Aurich <paul@darkrain42.org>
parents: 29874
diff changeset
223
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
224 qq_disconnect(gc);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
225
24070
832178d951ca 2008.09.30 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24068
diff changeset
226 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
227 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
228 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
229 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
230 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
231
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
232 server_list_remove_all(qd);
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
233
24026
25f62d21b3f8 disapproval of revision '8cebefbc6cd5d84acb69c74e69e8821f11dd225d'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 24019
diff changeset
234 g_free(qd);
23052
51dbe83ebbd3 patch-04-tcp-pending
SHiNE CsyFeK <csyfek@gmail.com>
parents: 21560
diff changeset
235 gc->proto_data = NULL;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 /* 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
239 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
240 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 return "qq";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245 /* 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
246 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
247 {
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
248 qq_buddy_data *bd;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 GString *status;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
251 bd = purple_buddy_get_protocol_data(b);
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
252 if (bd == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 status = g_string_new("");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
257 switch(bd->status) {
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
258 case QQ_BUDDY_OFFLINE:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
259 g_string_append(status, _("Offline"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
260 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
261 case QQ_BUDDY_ONLINE_NORMAL:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
262 g_string_append(status, _("Online"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
263 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
264 /* TODO What does this status mean? Labelling it as offline... */
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
265 case QQ_BUDDY_CHANGE_TO_OFFLINE:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
266 g_string_append(status, _("Offline"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
267 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
268 case QQ_BUDDY_ONLINE_AWAY:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
269 g_string_append(status, _("Away"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
270 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
271 case QQ_BUDDY_ONLINE_INVISIBLE:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
272 g_string_append(status, _("Invisible"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
273 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
274 case QQ_BUDDY_ONLINE_BUSY:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
275 g_string_append(status, _("Busy"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
276 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
277 default:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
278 g_string_printf(status, _("Unknown-%d"), bd->status);
15374
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 return g_string_free(status, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 /* 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
286 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
287 {
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
288 qq_buddy_data *bd;
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
289 gchar *tmp;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
290 GString *str;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 g_return_if_fail(b != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
294 bd = purple_buddy_get_protocol_data(b);
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
295 if (bd == NULL)
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
296 return;
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
297
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
298 /* if (PURPLE_BUDDY_IS_ONLINE(b) && bd != NULL) */
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
299 if (bd->ip.s_addr != 0) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
300 str = g_string_new(NULL);
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
301 g_string_printf(str, "%s:%d", inet_ntoa(bd->ip), bd->port);
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
302 if (bd->comm_flag & QQ_COMM_FLAG_TCP_MODE) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
303 g_string_append(str, " TCP");
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
304 } else {
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
305 g_string_append(str, " UDP");
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
306 }
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
307 g_string_free(str, TRUE);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
308 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
310 tmp = g_strdup_printf("%d", bd->age);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
311 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
312 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
314 switch (bd->gender) {
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
315 case QQ_BUDDY_GENDER_GG:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
316 purple_notify_user_info_add_pair(user_info, _("Gender"), _("Male"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
317 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
318 case QQ_BUDDY_GENDER_MM:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
319 purple_notify_user_info_add_pair(user_info, _("Gender"), _("Female"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
320 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
321 case QQ_BUDDY_GENDER_UNKNOWN:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
322 purple_notify_user_info_add_pair(user_info, _("Gender"), _("Unknown"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
323 break;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
324 default:
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
325 tmp = g_strdup_printf("Error (%d)", bd->gender);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
326 purple_notify_user_info_add_pair(user_info, _("Gender"), tmp);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
327 g_free(tmp);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
328 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
330 if (bd->level) {
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
331 tmp = g_strdup_printf("%d", bd->level);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
332 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
333 g_free(tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
334 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
336 str = g_string_new(NULL);
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
337 if (bd->comm_flag & QQ_COMM_FLAG_QQ_MEMBER) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
338 g_string_append( str, _("Member") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
339 }
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
340 if (bd->comm_flag & QQ_COMM_FLAG_QQ_VIP) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
341 g_string_append( str, _(" VIP") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
342 }
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
343 if (bd->comm_flag & QQ_COMM_FLAG_TCP_MODE) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
344 g_string_append( str, _(" TCP") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
345 }
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
346 if (bd->comm_flag & QQ_COMM_FLAG_MOBILE) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
347 g_string_append( str, _(" FromMobile") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
348 }
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
349 if (bd->comm_flag & QQ_COMM_FLAG_BIND_MOBILE) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
350 g_string_append( str, _(" BindMobile") );
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
351 }
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
352 if (bd->comm_flag & QQ_COMM_FLAG_VIDEO) {
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
353 g_string_append( str, _(" Video") );
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354 }
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
355
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
356 if (bd->ext_flag & QQ_EXT_FLAG_ZONE) {
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
357 g_string_append( str, _(" Zone") );
23683
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 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
360
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
361 g_string_free(str, TRUE);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
362
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
363 #ifdef DEBUG
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
364 tmp = g_strdup_printf( "%s (%04X)",
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
365 qq_get_ver_desc(bd->client_tag),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
366 bd->client_tag );
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
367 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
368 g_free(tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
369
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
370 tmp = g_strdup_printf( "Ext 0x%X, Comm 0x%X",
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
371 bd->ext_flag, bd->comm_flag );
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
372 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
373 g_free(tmp);
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
374 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
376
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377 /* 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
378 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
379 {
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
380 PurpleAccount *account;
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
381 qq_buddy_data *buddy;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
382
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
383 if (!b || !(account = purple_buddy_get_account(b)) ||
30859
c60c9c95bb00 These are dead increments.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30846
diff changeset
384 !purple_account_get_connection(account))
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
385 return NULL;
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
386
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
387 buddy = purple_buddy_get_protocol_data(b);
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
388 if (!buddy) {
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
389 return "not-authorized";
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
390 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
392 if (buddy->comm_flag & QQ_COMM_FLAG_MOBILE)
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
393 return "mobile";
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
394 if (buddy->comm_flag & QQ_COMM_FLAG_VIDEO)
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
395 return "video";
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
396 if (buddy->comm_flag & QQ_COMM_FLAG_QQ_MEMBER)
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
397 return "qq_member";
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
399 return NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
401
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
402 /* 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
403 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
404 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
405 PurpleStatusType *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406 GList *types = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
408 status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE,
25050
b5c82724598c For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24839
diff changeset
409 "available", _("Available"), TRUE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
411
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
412 status = purple_status_type_new_full(PURPLE_STATUS_AWAY,
25050
b5c82724598c For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24839
diff changeset
413 "away", _("Away"), TRUE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
414 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
416 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE,
25050
b5c82724598c For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24839
diff changeset
417 "invisible", _("Invisible"), TRUE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419
24601
fecedf6d9ee1 propagate from branch 'im.pidgin.pidgin' (head 97d295a04f3a9852a3b29cf0df43d56d1ddcc672)
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24378 24584
diff changeset
420 status = purple_status_type_new_full(PURPLE_STATUS_UNAVAILABLE,
fecedf6d9ee1 propagate from branch 'im.pidgin.pidgin' (head 97d295a04f3a9852a3b29cf0df43d56d1ddcc672)
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24378 24584
diff changeset
421 "busy", _("Busy"), TRUE, TRUE, FALSE);
fecedf6d9ee1 propagate from branch 'im.pidgin.pidgin' (head 97d295a04f3a9852a3b29cf0df43d56d1ddcc672)
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24378 24584
diff changeset
422 types = g_list_append(types, status);
24071
619ac2303c46 2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24070
diff changeset
423
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
424 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE,
25050
b5c82724598c For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24839
diff changeset
425 "offline", _("Offline"), TRUE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
426 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
427
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
428 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
429 "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
430 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
431
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 return types;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435 /* 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
436 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
437 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
438 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
439
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
440 qq_request_change_status(gc, 0);
15374
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443 /* 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
444 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
445 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 guint32 uid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 qd = gc->proto_data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
450 uid = purple_name_to_uid(who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 if (uid <= 0) {
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
453 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
454 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
455 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
457
24073
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
458 if (qd->client_version >= 2007) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
459 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
460 } else {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
461 qq_request_get_level(gc, uid);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
462 }
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
463 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
464 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
466 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
467 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
468 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
469 qq_data *qd;
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
470
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
471 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
472 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
473
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
474 if ( !qd->is_login ) {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
475 return;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
476 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
477
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
478 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
479 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
480
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
481 static void action_change_icon(PurplePluginAction *action)
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
482 {
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
483 PurpleConnection *gc = (PurpleConnection *) action->context;
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
484 qq_data *qd;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
485 gchar *icon_name;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
486 gchar *icon_path;
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
487
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
488 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
489 qd = (qq_data *) gc->proto_data;
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
490
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
491 if ( !qd->is_login ) {
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
492 return;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
493 }
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
494
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
495 icon_name = qq_get_icon_name(qd->my_icon);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
496 icon_path = qq_get_icon_path(icon_name);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
497 g_free(icon_name);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
498
24630
8f757b2139d2 String changes (a few of which I had already made, grumble grumble).
Mark Doliner <mark@kingant.net>
parents: 24610
diff changeset
499 purple_debug_info("QQ", "Change prev icon %s to...\n", icon_path);
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
500 purple_request_file(action, _("Select icon..."), icon_path,
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
501 FALSE,
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
502 G_CALLBACK(qq_change_icon_cb), NULL,
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
503 purple_connection_get_account(gc), NULL, NULL,
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
504 gc);
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
505 g_free(icon_path);
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
506 }
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
507
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
508 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
509 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
510 PurpleConnection *gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
512
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
513 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514 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
515 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
516 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
517
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
518 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
519 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
520 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
521 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
522
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
523 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
524 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
525 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
526 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
528 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
529 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
530 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
531 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
532
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
533 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
534 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
535 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
536 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
537
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
538 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
539 {
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
540 PurpleConnection *gc = (PurpleConnection *) action->context;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
541 qq_data *qd;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
542
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
543 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
544 qd = (qq_data *) gc->proto_data;
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
545 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
546 }
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
547
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
548 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
549 {
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
550 PurpleConnection *gc = (PurpleConnection *) action->context;
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
551
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
552 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
553 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
554 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556 /* 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
557 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
558 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
559 PurpleConnection *gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 qq_data *qd;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
561 GString *info;
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
562 struct tm *tm_local;
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
563 int index;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564
24079
1bdf7b602684 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24078
diff changeset
565 g_return_if_fail(NULL != gc && NULL != gc->proto_data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566 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
567 info = g_string_new("<html><body>");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
569 tm_local = localtime(&qd->login_time);
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
570 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
571 (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
572 tm_local->tm_hour, tm_local->tm_min, tm_local->tm_sec);
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
573 g_string_append_printf(info, _("<b>Total 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
574 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
575 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
576 (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
577 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
578
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
579 g_string_append(info, "<hr>");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
580
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
581 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
582 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
583 g_string_append_printf(info, _("<b>Connection Mode</b>: %s<br>\n"), qd->use_tcp ? "TCP" : "UDP");
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
584 g_string_append_printf(info, _("<b>My Internet IP</b>: %s:%d<br>\n"), inet_ntoa(qd->my_ip), qd->my_port);
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
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>");
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
587 g_string_append(info, "<i>Network Status</i><br>\n");
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
588 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
589 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
590 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
591 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
592 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
593
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
594 g_string_append(info, "<hr>");
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
595 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
596
24068
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
597 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
598 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
599 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
600 (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
601 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
602 }
87e61a85f5dd 2008.09.28 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24066
diff changeset
603 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
604 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
605 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
606
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
607 g_string_append(info, "</body></html>");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
609 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
610
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611 g_string_free(info, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
612 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
613
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
614 static void action_about_openq(PurplePluginAction *action)
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
615 {
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
616 PurpleConnection *gc = (PurpleConnection *) action->context;
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
617 GString *info;
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
618 gchar *title;
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
619
30863
351d07aefb09 Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30859
diff changeset
620 g_return_if_fail(NULL != gc);
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
621
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
622 info = g_string_new("<html><body>");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
623 g_string_append(info, _("<p><b>Original Author</b>:<br>\n"));
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
624 g_string_append(info, "puzzlebird<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
625 g_string_append(info, "<br>\n");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
626
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
627 g_string_append(info, _("<p><b>Code Contributors</b>:<br>\n"));
24839
b74fa0d31c74 2008.12.25 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24630
diff changeset
628 g_string_append(info, "gfhuang(poppyer) : patches for libpurple 2.0.0beta2, maintainer<br>\n");
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
629 g_string_append(info, "Yuan Qingyun : patches for libpurple 1.5.0, maintainer<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
630 g_string_append(info, "henryouly : file transfer, udp sock5 proxy and qq_show, maintainer<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
631 g_string_append(info, "hzhr : maintainer<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
632 g_string_append(info, "joymarquis : maintainer<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
633 g_string_append(info, "arfankai : fixed bugs in char_conv.c<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
634 g_string_append(info, "rakescar : provided filter for HTML tag<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
635 g_string_append(info, "yyw : improved performance on PPC linux<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
636 g_string_append(info, "lvxiang : provided ip to location original code<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
637 g_string_append(info, "markhuetsch : OpenQ merge into libpurple, maintainer 2006-2007<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
638 g_string_append(info, "ccpaging : maintainer since 2007<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
639 g_string_append(info, "icesky : maintainer since 2007<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
640 g_string_append(info, "csyfek : faces, maintainer since 2007<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
641 g_string_append(info, "<br>\n");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
642
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
643 g_string_append(info, _("<p><b>Lovely Patch Writers</b>:<br>\n"));
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
644 g_string_append(info, "gnap : message displaying, documentation<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
645 g_string_append(info, "manphiz : qun processing<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
646 g_string_append(info, "moo : qun processing<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
647 g_string_append(info, "Coly Li : qun processing<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
648 g_string_append(info, "Emil Alexiev : captcha verification on login based on LumaQQ for MAC (2007), login, add buddy, remove buddy, message exchange and logout<br>\n");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
649 g_string_append(info, "Chengming Wang : buddy memo<br>\n");
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
650 g_string_append(info, "lonicerae : chat room window bugfix, server list bugfix, buddy memo<br>\n");
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
651 g_string_append(info, "<br>\n");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
652
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
653 g_string_append(info, _("<p><b>Acknowledgement</b>:<br>\n"));
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
654 g_string_append(info, "Shufeng Tan : http://sf.net/projects/perl-oicq<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
655 g_string_append(info, "Jeff Ye : http://www.sinomac.com<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
656 g_string_append(info, "Hu Zheng : http://forlinux.yeah.net<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
657 g_string_append(info, "yunfan : http://www.myswear.net<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
658 g_string_append(info, "OpenQ Team : http://openq.linuxsir.org<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
659 g_string_append(info, "LumaQQ Team : http://lumaqq.linuxsir.org<br>\n");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
660 g_string_append(info, "Pidgin Team : http://www.pidgin.im<br>\n");
24264
d971d5369b43 2008.10.30 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24092
diff changeset
661 g_string_append(info, "Huang Guan : http://home.xxsyzx.com<br>\n");
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
662 g_string_append(info, "OpenQ Google Group : http://groups.google.com/group/openq<br>\n");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
663 g_string_append(info, "<br>\n");
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
664
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
665 g_string_append(info, _("<p><b>Scrupulous Testers</b>:<br>\n"));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
666 g_string_append(info, "yegle<br>\n");
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
667 g_string_append(info, "cnzhangbx<br>\n");
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
668 g_string_append(info, "casparant<br>\n");
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
669 g_string_append(info, "wd<br>\n");
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
670 g_string_append(info, "x6719620<br>\n");
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
671 g_string_append(info, "netelk<br>\n");
26797
e0d739a002b4 correctly use some text marked by N_(), and mark one more string as
Ka-Hing Cheung <khc@hxbc.us>
parents: 26213
diff changeset
672 g_string_append(info, _("and more, please let me know... thank you!))"));
e0d739a002b4 correctly use some text marked by N_(), and mark one more string as
Ka-Hing Cheung <khc@hxbc.us>
parents: 26213
diff changeset
673 g_string_append(info, "<br>\n<br>\n");
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
674 g_string_append(info, _("<p><i>And, all the boys in the backroom...</i><br>\n"));
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
675 g_string_append(info, _("<i>Feel free to join us!</i> :)"));
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
676 g_string_append(info, "</body></html>");
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
677
24603
e8c5688afdcd 2008.12.06 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24601
diff changeset
678 title = g_strdup_printf(_("About OpenQ %s"), OPENQ_VERSION);
24378
565df7f3ed49 This dialog should have a title
Mark Doliner <mark@kingant.net>
parents: 24374
diff changeset
679 purple_notify_formatted(gc, title, title, NULL, info->str, NULL, NULL);
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
680
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
681 g_free(title);
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
682 g_string_free(info, TRUE);
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
683 }
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
684
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685 /*
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
686 static void _qq_menu_search_or_add_permanent_group(PurplePluginAction *action)
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
687 {
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
688 purple_roomlist_show_with_account(NULL);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
689 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
690 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
691
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692 /*
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
693 static void _qq_menu_create_permanent_group(PurplePluginAction * action)
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
694 {
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
695 PurpleConnection *gc = (PurpleConnection *) action->context;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
696 purple_request_input(gc, _("Create QQ Qun"),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
697 _("Input Qun name here"),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
698 _("Only QQ members can create permanent Qun"),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
699 "OpenQ", FALSE, FALSE, NULL,
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
700 _("Create"), G_CALLBACK(qq_create_room), _("Cancel"), NULL, gc);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
701 }
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
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
704 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
705 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
706 PurpleChat *chat = (PurpleChat *)node;
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
707 PurpleAccount *account = purple_chat_get_account(chat);
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
708 PurpleConnection *gc = purple_account_get_connection(account);
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
709 GHashTable *components = purple_chat_get_components(chat);
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
710 gchar *num_str;
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
711 guint32 room_id;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
712
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
713 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
714
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 g_return_if_fail(components != NULL);
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
716
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
717 num_str = g_hash_table_lookup(components, QQ_ROOM_KEY_INTERNAL_ID);
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
718 room_id = strtoul(num_str, NULL, 10);
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
719 g_return_if_fail(room_id != 0);
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
720
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
721 qq_room_quit(gc, room_id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
722 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
724 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
725 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
726 PurpleChat *chat = (PurpleChat *)node;
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
727 PurpleAccount *account = purple_chat_get_account(chat);
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
728 PurpleConnection *gc = purple_account_get_connection(account);
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
729 GHashTable *components = purple_chat_get_components(chat);
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
730 gchar *num_str;
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
731 guint32 room_id;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
733 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
734
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735 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
736
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
737 num_str = g_hash_table_lookup(components, QQ_ROOM_KEY_INTERNAL_ID);
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
738 room_id = strtoul(num_str, NULL, 10);
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
739 g_return_if_fail(room_id != 0);
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
740
24086
3c52353b83ae 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24085
diff changeset
741 qq_send_room_cmd_mess(gc, QQ_ROOM_CMD_GET_INFO, room_id, NULL, 0,
24088
1ee91ff0d5fe 2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24086
diff changeset
742 0, QQ_ROOM_INFO_DISPLAY);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
744
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
745 #if 0
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
746 /* TODO: re-enable this */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
747 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
748 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
749 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
750 PurpleConnection *gc;
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
751 qq_buddy_data *bd;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
753 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
754 buddy = (PurpleBuddy *) node;
24080
818ab62006f5 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24079
diff changeset
755 bd = (qq_buddy_data *) buddy->proto_data;
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
756 /* if (is_online (bd->status)) { */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
757 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
758 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
759 qq_send_file(gc, buddy->name, NULL);
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
760 /* } */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
761 }
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
762 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
763
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764 /* protocol related menus */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
765 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
766 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767 GList *m;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
768 PurplePluginAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 m = NULL;
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
771 act = purple_plugin_action_new(_("Change Icon"), action_change_icon);
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
772 m = g_list_append(m, act);
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
773
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
774 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
775 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
776
24374
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
777 act = purple_plugin_action_new(_("Modify Extended Information"), action_modify_info_ext);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
778 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
779
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
780 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
781 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
783 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
784 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
785
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
786 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
787 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
788
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
789 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
790 m = g_list_append(m, act);
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
791
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
792 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
793 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
794
24078
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
795 act = purple_plugin_action_new(_("About OpenQ"), action_about_openq);
0a92aa673a33 2008.10.05 - lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24077
diff changeset
796 m = g_list_append(m, act);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
797 /*
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
798 act = purple_plugin_action_new(_("Qun: Search a permanent Qun"), _qq_menu_search_or_add_permanent_group);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
799 m = g_list_append(m, act);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
800
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
801 act = purple_plugin_action_new(_("Qun: Create a permanent Qun"), _qq_menu_create_permanent_group);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
802 m = g_list_append(m, act);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
803 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
804
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
805 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
806 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
807
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
808 static void qq_add_buddy_from_menu_cb(PurpleBlistNode *node, gpointer data)
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
809 {
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
810 PurpleBuddy *buddy;
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
811 PurpleConnection *gc;
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
812
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
813 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
814
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
815 buddy = (PurpleBuddy *) node;
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
816 gc = purple_account_get_connection(purple_buddy_get_account(buddy));
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
817
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
818 qq_add_buddy(gc, buddy, NULL);
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
819 }
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
820
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
821 static void qq_modify_buddy_memo_from_menu_cb(PurpleBlistNode *node, gpointer data)
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
822 {
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
823 PurpleBuddy *buddy;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
824 qq_buddy_data *bd;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
825 PurpleConnection *gc;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
826 guint32 bd_uid;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
827
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
828 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
829
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
830 buddy = (PurpleBuddy *)node;
25438
4b8c4870b13a propagate from branch 'im.pidgin.pidgin.next.minor' (head 7305b29db7bd00d3261f348c71674c93aa31b327)
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25381 25150
diff changeset
831 g_return_if_fail(NULL != buddy);
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
832
25438
4b8c4870b13a propagate from branch 'im.pidgin.pidgin.next.minor' (head 7305b29db7bd00d3261f348c71674c93aa31b327)
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25381 25150
diff changeset
833 gc = purple_account_get_connection(purple_buddy_get_account(buddy));
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
834 g_return_if_fail(NULL != gc);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
835
25438
4b8c4870b13a propagate from branch 'im.pidgin.pidgin.next.minor' (head 7305b29db7bd00d3261f348c71674c93aa31b327)
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25381 25150
diff changeset
836 bd = (qq_buddy_data *)purple_buddy_get_protocol_data(buddy);
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
837 g_return_if_fail(NULL != bd);
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
838 bd_uid = bd->uid;
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
839
25150
d673ccc44a6e 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25149
diff changeset
840 /* param: gc, uid, update_class, action
d673ccc44a6e 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25149
diff changeset
841 * here, update_class is set to bd_uid. because some memo packages returned
d673ccc44a6e 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25149
diff changeset
842 * without uid, which will make us confused */
d673ccc44a6e 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25149
diff changeset
843 qq_request_buddy_memo(gc, bd_uid, bd_uid, QQ_BUDDY_MEMO_MODIFY);
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
844 }
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
845
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
846 static GList *qq_buddy_menu(PurpleBuddy *buddy)
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
847 {
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
848 GList *m = NULL;
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
849 PurpleMenuAction *act;
25298
e35115192593 Finished struct hiding in bonjour and qq
Gary Kramlich <grim@reaperworld.com>
parents: 24294
diff changeset
850 qq_buddy_data *bd = purple_buddy_get_protocol_data(buddy);
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
851
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
852 if (bd == NULL) {
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
853 act = purple_menu_action_new(_("Add Buddy"),
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
854 PURPLE_CALLBACK(qq_add_buddy_from_menu_cb),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
855 NULL, NULL);
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
856 m = g_list_append(m, act);
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
857 return m;
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
858 }
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
859
25146
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25070
diff changeset
860
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
861 act = purple_menu_action_new(_("Modify Buddy Memo"),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
862 PURPLE_CALLBACK(qq_modify_buddy_memo_from_menu_cb),
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
863 NULL, NULL);
25146
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25070
diff changeset
864 m = g_list_append(m, act);
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25070
diff changeset
865
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
866
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
867 /* TODO : not working, temp commented out by gfhuang */
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
868 #if 0
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
869 if (bd && is_online(bd->status)) {
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
870 act = purple_menu_action_new(_("Send File"), PURPLE_CALLBACK(_qq_menu_send_file), NULL, NULL); /* add NULL by gfhuang */
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
871 m = g_list_append(m, act);
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
872 }
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
873 #endif
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
874 return m;
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
875 }
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
876
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
877 /* 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
878 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
879 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
880 GList *m;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
881 PurpleMenuAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
882
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
883 m = NULL;
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
884 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
885 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
886
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
887 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
888 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
889 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
890 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
891
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892 /* buddy-related menu shown up with right-click */
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
893 static GList *qq_blist_node_menu(PurpleBlistNode * node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
894 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
895 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
896 return qq_chat_menu(node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
897
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
898 if(PURPLE_BLIST_NODE_IS_BUDDY(node))
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
899 return qq_buddy_menu((PurpleBuddy *) node);
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
900
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
901 return NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
902 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
903
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
904 /* convert name displayed in a chat channel to original QQ UID */
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
905 static gchar *chat_name_to_purple_name(const gchar *const name)
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
906 {
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
907 const char *start;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
908 const char *end;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
909 gchar *ret;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
910
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
911 g_return_val_if_fail(name != NULL, NULL);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
912
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
913 /* Sample: (1234567)*/
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
914 start = strchr(name, '(');
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
915 g_return_val_if_fail(start != NULL, NULL);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
916 end = strchr(start, ')');
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
917 g_return_val_if_fail(end != NULL && (end - start) > 1, NULL);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
918
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
919 ret = g_strndup(start + 1, end - start - 1);
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
920
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
921 return ret;
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
922 }
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
923
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
924 /* 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
925 /* 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
926 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
927 {
24073
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
928 qq_data *qd;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
929 gchar *uid_str;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
930 guint32 uid;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
931
24085
237e5a94e11c 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24083
diff changeset
932 purple_debug_info("QQ", "Get chat buddy info of %s\n", who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
933 g_return_if_fail(who != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
934
24073
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
935 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
936 if (uid_str == NULL) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
937 return;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
938 }
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
939
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
940 qd = gc->proto_data;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
941 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
942 g_free(uid_str);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
943
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
944 if (uid <= 0) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
945 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
946 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
947 return;
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
948 }
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
949
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
950 if (qd->client_version < 2007) {
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
951 qq_request_get_level(gc, uid);
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
952 }
df699d739b8f 2008.10.03 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24071
diff changeset
953 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
954 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
955
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
956 /* 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
957 /* 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
958 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
959 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
960 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
961 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
962 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
963
23758
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
964 static PurplePluginProtocolInfo prpl_info =
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
965 {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
966 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
967 NULL, /* user_splits */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
968 NULL, /* protocol_options */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
969 {"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
970 qq_list_icon, /* list_icon */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
971 qq_list_emblem, /* list_emblems */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
972 qq_status_text, /* status_text */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
973 qq_tooltip_text, /* tooltip_text */
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
974 qq_status_types, /* away_states */
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
975 qq_blist_node_menu, /* blist_node_menu */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
976 qq_chat_info, /* chat_info */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
977 qq_chat_info_defaults, /* chat_info_defaults */
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
978 qq_login, /* open */
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
979 qq_close, /* close */
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
980 qq_send_im, /* send_im */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
981 NULL, /* set_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
982 NULL, /* send_typing */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
983 qq_show_buddy_info, /* get_info */
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
984 qq_change_status, /* change status */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
985 NULL, /* set_idle */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
986 NULL, /* change_passwd */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
987 qq_add_buddy, /* add_buddy */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
988 NULL, /* add_buddies */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
989 qq_remove_buddy, /* remove_buddy */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
990 NULL, /* remove_buddies */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
991 NULL, /* add_permit */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
992 NULL, /* add_deny */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
993 NULL, /* rem_permit */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
994 NULL, /* rem_deny */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
995 NULL, /* set_permit_deny */
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
996 qq_group_join, /* join_chat */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
997 NULL, /* reject chat invite */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
998 NULL, /* get_chat_name */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
999 NULL, /* chat_invite */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1000 NULL, /* chat_leave */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1001 NULL, /* chat_whisper */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
1002 qq_chat_send, /* chat_send */
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
1003 NULL, /* keepalive */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1004 NULL, /* register_user */
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
1005 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
1006 NULL, /* get_cb_away */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1007 NULL, /* alias_buddy */
24091
d35672443baa 2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24090
diff changeset
1008 NULL, /* change buddy's group */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1009 NULL, /* rename_group */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1010 NULL, /* buddy_free */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1011 NULL, /* convo_closed */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1012 NULL, /* normalize */
24081
119d85c40d75 2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24080
diff changeset
1013 qq_set_custom_icon,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1014 NULL, /* remove_group */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
1015 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
1016 NULL, /* set_chat_topic */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1017 NULL, /* find_blist_chat */
24568
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
1018 qq_roomlist_get_list, /* roomlist_get_list */
af645355ea20 Code clean
Hu Yong <ccpaging@gmail.com>
parents: 24264
diff changeset
1019 qq_roomlist_cancel, /* roomlist_cancel */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1020 NULL, /* roomlist_expand_category */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1021 NULL, /* can_receive_file */
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
1022 NULL, /* qq_send_file send_file */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1023 NULL, /* new xfer */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1024 NULL, /* offline_message */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1025 NULL, /* PurpleWhiteboardPrplOps */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1026 NULL, /* send_raw */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1027 NULL, /* roomlist_room_serialize */
23758
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
1028 NULL, /* unregister_user */
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
1029 NULL, /* send_attention */
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
1030 NULL, /* get attention_types */
16675
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1031
23758
e16982ad923f Reapplied changes that were overwritten by 6b89b377381e35b459936fd2f730f45b5558ae69.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23753
diff changeset
1032 sizeof(PurplePluginProtocolInfo), /* struct_size */
25657
ff29208e03ef propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23112 25637
diff changeset
1033 NULL, /* get_account_text_table */
25637
92e71f6e10d4 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25560
diff changeset
1034 NULL, /* initiate_media */
29874
2cb6ea4420a0 Add a NULL for PurplePluginProtocolInfo::get_moods to all the plugins I build
Paul Aurich <paul@darkrain42.org>
parents: 26797
diff changeset
1035 NULL, /* get_media_caps */
30262
2a436e0ce977 Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents: 30052
diff changeset
1036 NULL, /* get_moods */
2a436e0ce977 Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents: 30052
diff changeset
1037 NULL, /* set_public_alias */
2a436e0ce977 Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents: 30052
diff changeset
1038 NULL /* get_public_alias */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1039 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1040
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1041 static PurplePluginInfo info = {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1042 PURPLE_PLUGIN_MAGIC,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1043 PURPLE_MAJOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1044 PURPLE_MINOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1045 PURPLE_PLUGIN_PROTOCOL, /**< type */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1046 NULL, /**< ui_requirement */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1047 0, /**< flags */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1048 NULL, /**< dependencies */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1049 PURPLE_PRIORITY_DEFAULT, /**< priority */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1050
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1051 "prpl-qq", /**< id */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1052 "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
1053 DISPLAY_VERSION, /**< version */
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
1054 /** summary */
24374
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
1055 N_("QQ Protocol Plugin"),
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
1056 /** description */
24374
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
1057 N_("QQ Protocol Plugin"),
24373
ad685dadbaca Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents: 24372
diff changeset
1058 NULL, /**< author */
ad685dadbaca Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents: 24372
diff changeset
1059 PURPLE_WEBSITE, /**< homepage */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1060
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1061 NULL, /**< load */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1062 NULL, /**< unload */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1063 NULL, /**< destroy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1064
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1065 NULL, /**< ui_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1066 &prpl_info, /**< extra_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1067 NULL, /**< prefs_info */
24048
d57928c9dd8f 2008.09.19 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24046
diff changeset
1068 qq_actions,
16675
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1069
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1070 /* padding */
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1071 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1072 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1073 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16345
diff changeset
1074 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1075 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1076
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1077
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1078 static void init_plugin(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1079 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1080 PurpleAccountOption *option;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1081 PurpleKeyValuePair *kvp;
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1082 GList *server_list = NULL;
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1083 GList *server_kv_list = NULL;
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1084 GList *it;
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
1085 /* #ifdef DEBUG */
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1086 GList *version_kv_list = NULL;
25148
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25146
diff changeset
1087 /* #endif */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1088
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1089 server_list = server_list_build('A');
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1090
24372
97eddfe30726 This preferences isn't used anywhere, and when we call get_string_list
Mark Doliner <mark@kingant.net>
parents: 24092
diff changeset
1091 purple_prefs_remove("/plugins/prpl/qq/serverlist");
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1092
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1093 server_kv_list = NULL;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1094 kvp = g_new0(PurpleKeyValuePair, 1);
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1095 kvp->key = g_strdup(_("Auto"));
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1096 kvp->value = g_strdup("auto");
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1097 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
1098
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1099 it = server_list;
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1100 while(it) {
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1101 if (it->data != NULL && strlen(it->data) > 0) {
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1102 kvp = g_new0(PurpleKeyValuePair, 1);
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1103 kvp->key = g_strdup(it->data);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1104 kvp->value = g_strdup(it->data);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1105 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
1106 }
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1107 it = it->next;
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1108 }
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1109
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1110 g_list_free(server_list);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1111
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1112 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
1113 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
1114
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1115 kvp = g_new0(PurpleKeyValuePair, 1);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1116 kvp->key = g_strdup(_("QQ2005"));
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1117 kvp->value = g_strdup("qq2005");
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1118 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
1119
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1120 kvp = g_new0(PurpleKeyValuePair, 1);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1121 kvp->key = g_strdup(_("QQ2007"));
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1122 kvp->value = g_strdup("qq2007");
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1123 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
1124
24066
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
1125 kvp = g_new0(PurpleKeyValuePair, 1);
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
1126 kvp->key = g_strdup(_("QQ2008"));
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
1127 kvp->value = g_strdup("qq2008");
dbc7a9742f8d 2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24065
diff changeset
1128 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
1129
24065
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1130 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
1131 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
bdfcfd71449c patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24048
diff changeset
1132
23755
23cec4360d4a applied changes from 8cebefbc6cd5d84acb69c74e69e8821f11dd225d
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23754
diff changeset
1133 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
1134 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
1135
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1136 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
1137 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
1138
23754
967344bc404d applied changes from f12c8903079425d7850fa183df0b3f937b2952be
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23753
diff changeset
1139 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
1140 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
1141
24842
effbf24b39b1 2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24839
diff changeset
1142 option = purple_account_option_bool_new(_("Show chat room when msg comes"), "show_chat", TRUE);
effbf24b39b1 2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24839
diff changeset
1143 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
effbf24b39b1 2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24839
diff changeset
1144
24374
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
1145 option = purple_account_option_int_new(_("Keep alive interval (seconds)"), "keep_alive_interval", 60);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
1146 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
1147
24374
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
1148 option = purple_account_option_int_new(_("Update interval (seconds)"), "update_interval", 300);
23683
1c50f12b1c52 2008.08.02 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23606
diff changeset
1149 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
1150
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1151 purple_prefs_add_none("/plugins/prpl/qq");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1152 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
1153 purple_prefs_add_bool("/plugins/prpl/qq/show_fake_video", FALSE);
24092
7c0a56c5fea0 2008.10.14 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 24091
diff changeset
1154 purple_prefs_add_bool("/plugins/prpl/qq/auto_get_authorize_info", TRUE);
23757
69c218fd5d54 applied changes from 5688199e261449d33b5803dafff50d860896ebcb
SHiNE CsyFeK <csyfek@gmail.com>
parents: 23756
diff changeset
1155 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
1156 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
1157 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1158
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15528
diff changeset
1159 PURPLE_INIT_PLUGIN(qq, init_plugin, info);