Mercurial > pidgin.yaz
annotate libpurple/protocols/qq/group_im.c @ 31047:809dac0c47ce
Add missing headers to fix distcheck
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 18 Oct 2010 23:47:32 +0000 |
parents | 351d07aefb09 |
children | 4deef745de87 |
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 group_im.c |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15823 | 4 * purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
15823 | 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:
18807
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 |
18210
b8572b937c09
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents:
18141
diff
changeset
|
25 #include "internal.h" |
b8572b937c09
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents:
18141
diff
changeset
|
26 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "conversation.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 "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "char_conv.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "group_internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "group_info.h" |
24090
9be95f0b9472
2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24089
diff
changeset
|
37 #include "group_join.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "group_im.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "group_opt.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 #include "im.h" |
24065
bdfcfd71449c
patch 20080922 from ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24046
diff
changeset
|
41 #include "qq_define.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include "packet_parse.h" |
23753
5f454b975a99
2008.08.10 - csyfek <csyfek(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
23683
diff
changeset
|
43 #include "qq_network.h" |
24046
bcfc98c7a55f
merge of '546bf87105ac5b97c3962c083dfab015d37d9b05'
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24045
diff
changeset
|
44 #include "qq_process.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "utils.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
47 /* show group conversation window */ |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
48 PurpleConversation *qq_room_conv_open(PurpleConnection *gc, qq_room_data *rmd) |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
49 { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
50 PurpleConversation *conv; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
51 gchar *topic_utf8; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
52 |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
53 g_return_val_if_fail(rmd != NULL, NULL); |
27613
32d2caa6a777
Commit the QQ null chat room name crash on the *right* branch.
Paul Aurich <paul@darkrain42.org>
parents:
24842
diff
changeset
|
54 g_return_val_if_fail(rmd->title_utf8, NULL); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
55 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
56 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
57 rmd->title_utf8, purple_connection_get_account(gc)); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
58 if (conv != NULL) { |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
59 /* show only one conversation per room */ |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
60 return conv; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
61 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
62 |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
63 serv_got_joined_chat(gc, rmd->id, rmd->title_utf8); |
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
64 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, rmd->title_utf8, purple_connection_get_account(gc)); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
65 if (conv != NULL) { |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
66 if (rmd->notice_utf8 != NULL) { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
67 topic_utf8 = g_strdup_printf("%u %s", rmd->ext_id, rmd->notice_utf8); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
68 } else { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
69 topic_utf8 = g_strdup_printf("%u", rmd->ext_id); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
70 } |
24581 | 71 purple_debug_info("QQ", "Chat topic = %s\n", topic_utf8); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
72 purple_conv_chat_set_topic(PURPLE_CONV_CHAT(conv), NULL, topic_utf8); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
73 g_free(topic_utf8); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
74 |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
75 if (rmd->is_got_buddies) |
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
76 qq_send_room_cmd_only(gc, QQ_ROOM_CMD_GET_ONLINES, rmd->id); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
77 else |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
78 qq_update_room(gc, 0, rmd->id); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
79 return conv; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
80 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
81 return NULL; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
82 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
83 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
84 /* refresh online member in group conversation window */ |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
85 void qq_room_conv_set_onlines(PurpleConnection *gc, qq_room_data *rmd) |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
86 { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
87 GList *names, *list, *flags; |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
88 qq_buddy_data *bd; |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
89 gchar *member_name, *member_uid; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
90 PurpleConversation *conv; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
91 gint flag; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
92 gboolean is_find; |
24085
237e5a94e11c
2008.10.08 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24080
diff
changeset
|
93 |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
94 g_return_if_fail(rmd != NULL); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
95 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
96 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
97 rmd->title_utf8, purple_connection_get_account(gc)); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
98 if (conv == NULL) { |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
99 purple_debug_warning("QQ", "Conversation \"%s\" is not opened\n", rmd->title_utf8); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
100 return; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
101 } |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
102 g_return_if_fail(rmd->members != NULL); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
103 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
104 names = NULL; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
105 flags = NULL; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
106 |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
107 list = rmd->members; |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
108 while (list != NULL) { |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
109 bd = (qq_buddy_data *) list->data; |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
110 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
111 /* we need unique identifiers for everyone in the chat or else we'll |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
112 * run into problems with functions like get_cb_real_name from qq.c */ |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
113 member_name = (bd->nickname != NULL && *(bd->nickname) != '\0') ? |
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
114 g_strdup_printf("%s (%u)", bd->nickname, bd->uid) : |
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
115 g_strdup_printf("(%u)", bd->uid); |
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
116 member_uid = g_strdup_printf("(%u)", bd->uid); |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
117 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
118 flag = 0; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
119 /* TYPING to put online above OP and FOUNDER */ |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
120 if (is_online(bd->status)) flag |= (PURPLE_CBFLAGS_TYPING | PURPLE_CBFLAGS_VOICE); |
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
121 if(1 == (bd->role & 1)) flag |= PURPLE_CBFLAGS_OP; |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
122 if(bd->uid == rmd->creator_uid) flag |= PURPLE_CBFLAGS_FOUNDER; |
24079
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
123 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
124 is_find = TRUE; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
125 if (purple_conv_chat_find_user(PURPLE_CONV_CHAT(conv), member_name)) |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
126 { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
127 purple_conv_chat_user_set_flags(PURPLE_CONV_CHAT(conv), |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
128 member_name, |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
129 flag); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
130 } else if (purple_conv_chat_find_user(PURPLE_CONV_CHAT(conv), member_uid)) |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
131 { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
132 purple_conv_chat_user_set_flags(PURPLE_CONV_CHAT(conv), |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
133 member_uid, |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
134 flag); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
135 purple_conv_chat_rename_user(PURPLE_CONV_CHAT(conv), member_uid, member_name); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
136 } else { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
137 is_find = FALSE; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
138 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
139 if (!is_find) { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
140 /* always put it even offline */ |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
141 names = g_list_append(names, member_name); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
142 flags = g_list_append(flags, GINT_TO_POINTER(flag)); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
143 } else { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
144 g_free(member_name); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
145 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
146 g_free(member_uid); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
147 list = list->next; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
148 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
149 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
150 if (names != NULL && flags != NULL) { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
151 purple_conv_chat_add_users(PURPLE_CONV_CHAT(conv), names, NULL, flags, FALSE); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
152 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
153 |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
154 /* clean up names */ |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
155 while (names != NULL) { |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
156 member_name = (gchar *) names->data; |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
157 names = g_list_remove(names, member_name); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
158 g_free(member_name); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
159 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
160 g_list_free(flags); |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
161 } |
1bdf7b602684
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24077
diff
changeset
|
162 |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
163 void qq_room_got_chat_in(PurpleConnection *gc, |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
164 guint32 room_id, guint32 uid_from, const gchar *msg, time_t in_time) |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
165 { |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
166 PurpleConversation *conv; |
24842
effbf24b39b1
2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24670
diff
changeset
|
167 qq_data *qd; |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
168 qq_buddy_data *bd; |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
169 qq_room_data *rmd; |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
170 gchar *from; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
171 |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
172 g_return_if_fail(gc != NULL && room_id != 0); |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
173 g_return_if_fail(msg != NULL); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
174 |
24842
effbf24b39b1
2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24670
diff
changeset
|
175 qd = (qq_data *)gc->proto_data; |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
176 conv = purple_find_chat(gc, room_id); |
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
177 rmd = qq_room_data_find(gc, room_id); |
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
178 g_return_if_fail(rmd != NULL); |
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
179 |
24842
effbf24b39b1
2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24670
diff
changeset
|
180 purple_debug_info("QQ", "is_show_chat:%d\n", qd->is_show_chat); |
effbf24b39b1
2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24670
diff
changeset
|
181 if (NULL == conv && qd->is_show_chat) { |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
182 conv = qq_room_conv_open(gc, rmd); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
183 } |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
184 |
24842
effbf24b39b1
2009.02.08 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24670
diff
changeset
|
185 if (NULL == conv) { |
28571
73a30365c293
Add newline at end of debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27613
diff
changeset
|
186 purple_debug_info("QQ", "Conversion of %u is not open, missing from %d:/n%s/v\n", |
24551 | 187 room_id, uid_from, msg); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
188 return; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
189 } |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
190 |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
191 if (uid_from != 0) { |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
192 |
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
193 bd = qq_room_buddy_find(rmd, uid_from); |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
194 if (bd == NULL || bd->nickname == NULL) |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
195 from = g_strdup_printf("%u", uid_from); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
196 else |
24080
818ab62006f5
2008.10.07 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24079
diff
changeset
|
197 from = g_strdup(bd->nickname); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
198 } else { |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
199 from = g_strdup(""); |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
200 } |
24088
1ee91ff0d5fe
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24086
diff
changeset
|
201 serv_got_chat_in(gc, room_id, from, 0, msg, in_time); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
202 g_free(from); |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
203 } |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
204 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 /* recv an IM from a group chat */ |
24090
9be95f0b9472
2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24089
diff
changeset
|
206 void qq_process_room_im(guint8 *data, gint data_len, guint32 id, PurpleConnection *gc, guint16 msg_type) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 { |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
208 gchar *msg_smiley, *msg_fmt, *msg_utf8; |
24588 | 209 gint bytes, tail_len; |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
210 struct { |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
211 guint32 ext_id; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
212 guint8 type8; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
213 guint32 member_uid; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
214 guint16 unknown; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
215 guint16 msg_seq; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
216 time_t send_time; |
24588 | 217 guint32 version; |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
218 guint16 msg_len; |
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
219 gchar *msg; |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
220 } im_text; |
24588 | 221 guint32 temp_id; |
222 guint16 content_type; | |
223 guint8 frag_count, frag_index; | |
224 guint16 msg_id; | |
225 qq_im_format *fmt = NULL; | |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
226 |
24588 | 227 /* at least include im_text.msg_len */ |
228 g_return_if_fail(data != NULL && data_len > 23); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 |
24089
b6f09c1c79ce
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24088
diff
changeset
|
230 /* qq_show_packet("ROOM_IM", data, data_len); */ |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
231 memset(&im_text, 0, sizeof(im_text)); |
24066
dbc7a9742f8d
2008.09.26 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24065
diff
changeset
|
232 bytes = 0; |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
233 bytes += qq_get32(&(im_text.ext_id), data + bytes); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
234 bytes += qq_get8(&(im_text.type8), data + bytes); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 |
24077
ce94189f15ad
Flos Lonicerae <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24076
diff
changeset
|
236 if(QQ_MSG_TEMP_QUN_IM == msg_type) { |
24588 | 237 bytes += qq_get32(&temp_id, data + bytes); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
240 bytes += qq_get32(&(im_text.member_uid), bytes + data); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
241 bytes += qq_get16(&im_text.unknown, data + bytes); /* 0x0001? */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
242 bytes += qq_get16(&(im_text.msg_seq), data + bytes); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
243 bytes += qq_getime(&im_text.send_time, data + bytes); |
24588 | 244 bytes += qq_get32(&im_text.version, data + bytes); |
245 bytes += qq_get16(&(im_text.msg_len), data + bytes); | |
246 purple_debug_info("QQ", "Room IM, ext id %u, seq %u, version 0x%04X, len %u\n", | |
247 im_text.ext_id, im_text.msg_seq, im_text.version, im_text.msg_len); | |
248 | |
249 if (im_text.msg_len != data_len - bytes) { | |
250 purple_debug_warning("QQ", "Room IM length %d should be %d\n", | |
251 im_text.msg_len, data_len - bytes); | |
252 im_text.msg_len = data_len - bytes; | |
253 } | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 |
24588 | 255 g_return_if_fail(im_text.msg_len > 0 && bytes + im_text.msg_len <= data_len); |
256 if(msg_type != QQ_MSG_QUN_IM_UNKNOWN) { | |
257 g_return_if_fail(im_text.msg_len >= 10); | |
258 | |
259 bytes += qq_get16(&content_type, data + bytes); | |
260 bytes += qq_get8(&frag_count, data + bytes); | |
261 bytes += qq_get8(&frag_index, data + bytes); | |
262 bytes += qq_get16(&msg_id, data + bytes); | |
263 bytes += 4; /* skip 0x(00 00 00 00) */ | |
264 purple_debug_info("QQ", "Room IM, content %d, frag %d-%d, msg id %u\n", | |
265 content_type, frag_count, frag_index, msg_id); | |
266 im_text.msg_len -= 10; | |
267 } | |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
268 g_return_if_fail(im_text.msg_len > 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 |
24089
b6f09c1c79ce
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24088
diff
changeset
|
270 /* qq_show_packet("Message", data + bytes, data_len - bytes); */ |
24588 | 271 if (frag_count <= 1 || frag_count == frag_index + 1) { |
272 fmt = qq_im_fmt_new(); | |
273 tail_len = qq_get_im_tail(fmt, data + bytes, data_len - bytes); | |
274 im_text.msg = g_strndup((gchar *)(data + bytes), data_len - tail_len); | |
24089
b6f09c1c79ce
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24088
diff
changeset
|
275 } else { |
24588 | 276 im_text.msg = g_strndup((gchar *)(data + bytes), data_len - bytes); |
24089
b6f09c1c79ce
2008.10.09 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24088
diff
changeset
|
277 } |
24090
9be95f0b9472
2008.10.10 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24089
diff
changeset
|
278 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 /* group im_group has no flag to indicate whether it has font_attr or not */ |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
280 msg_smiley = qq_emoticon_to_purple(im_text.msg); |
24588 | 281 if (fmt != NULL) { |
282 msg_fmt = qq_im_fmt_to_purple(fmt, msg_smiley); | |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
283 msg_utf8 = qq_to_utf8(msg_fmt, QQ_CHARSET_DEFAULT); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
284 g_free(msg_fmt); |
24588 | 285 qq_im_fmt_free(fmt); |
24071
619ac2303c46
2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24066
diff
changeset
|
286 } else { |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
287 msg_utf8 = qq_to_utf8(msg_smiley, QQ_CHARSET_DEFAULT); |
24071
619ac2303c46
2009.10.02 - ccpaging <ccpaging(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
24066
diff
changeset
|
288 } |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
289 g_free(msg_smiley); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
290 |
24588 | 291 purple_debug_info("QQ", "Room (%u) IM from %u: %s\n", |
292 im_text.ext_id, im_text.member_uid, msg_utf8); | |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
293 qq_room_got_chat_in(gc, id, im_text.member_uid, msg_utf8, im_text.send_time); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
294 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
295 g_free(msg_utf8); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
296 g_free(im_text.msg); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
297 } |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
298 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
299 /* send IM to a group */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
300 static void request_room_send_im(PurpleConnection *gc, guint32 room_id, qq_im_format *fmt, const gchar *msg) |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
301 { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
302 guint8 raw_data[MAX_PACKET_SIZE - 16]; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
303 gint bytes; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
304 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
305 g_return_if_fail(room_id != 0 && msg != NULL); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
306 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
307 bytes = 0; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
308 bytes += qq_put16(raw_data + bytes, 0); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
309 bytes += qq_putdata(raw_data + bytes, (guint8 *)msg, strlen(msg)); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
310 bytes += qq_put_im_tail(raw_data + bytes, fmt); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
311 /* reset first two bytes */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
312 qq_put16(raw_data, bytes - 2); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
313 |
24588 | 314 qq_send_room_cmd(gc, QQ_ROOM_CMD_SEND_IM, room_id, raw_data, bytes); |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
315 } |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
316 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
317 /* this is the ACK */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
318 void qq_process_room_send_im(PurpleConnection *gc, guint8 *data, gint len) |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
319 { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
320 /* return should be the internal group id |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
321 * but we have nothing to do with it */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
322 return; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
323 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 |
24588 | 325 void qq_process_room_send_im_ex(PurpleConnection *gc, guint8 *data, gint len) |
326 { | |
327 /* return should be the internal group id | |
328 * but we have nothing to do with it */ | |
329 return; | |
330 } | |
331 | |
24605
59aae7636111
#if 0 out an unused function to suppress a compiler warning.
Richard Laager <rlaager@wiktel.com>
parents:
24599
diff
changeset
|
332 #if 0 |
24588 | 333 static void request_room_send_im_ex(PurpleConnection *gc, guint32 room_id, |
334 qq_im_format *fmt, gchar *msg, guint16 msg_id, guint8 frag_count, guint8 frag_index) | |
335 { | |
336 guint8 raw_data[MAX_PACKET_SIZE - 16]; | |
337 gint bytes; | |
338 | |
339 | |
340 g_return_if_fail(room_id != 0 && msg != NULL); | |
341 | |
342 bytes = 0; | |
343 bytes += qq_put16(raw_data + bytes, 0); /* packet len */ | |
344 /* type 0x0001, text only; 0x0002, with custom emoticon */ | |
345 bytes += qq_put16(raw_data + bytes, 0x0001); | |
346 bytes += qq_put8(raw_data + bytes, frag_count); | |
347 bytes += qq_put8(raw_data + bytes, frag_index); | |
348 bytes += qq_put16(raw_data + bytes, msg_id); | |
349 bytes += qq_put32(raw_data + bytes, 0); /* unknow 4 bytes */ | |
350 bytes += qq_putdata(raw_data + bytes, (guint8 *)msg, strlen(msg)); | |
351 if (frag_count == frag_index + 1) { | |
352 bytes += qq_put8(raw_data + bytes, 0x20); /* add extra SPACE */ | |
353 bytes += qq_put_im_tail(raw_data + bytes, fmt); | |
354 } | |
355 | |
356 /* reset first two bytes as length */ | |
357 qq_put16(raw_data, bytes - 2); | |
24599 | 358 |
24588 | 359 /*qq_show_packet("QQ_ROOM_CMD_SEND_IM_EX", raw_data, bytes); */ |
360 qq_send_room_cmd(gc, QQ_ROOM_CMD_SEND_IM_EX, room_id, raw_data, bytes); | |
361 } | |
24605
59aae7636111
#if 0 out an unused function to suppress a compiler warning.
Richard Laager <rlaager@wiktel.com>
parents:
24599
diff
changeset
|
362 #endif |
24588 | 363 |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
364 /* send a chat msg to a QQ Qun |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
365 * called by purple */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
366 int qq_chat_send(PurpleConnection *gc, int id, const char *what, PurpleMessageFlags flags) |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
367 { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
368 qq_data *qd; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
369 qq_im_format *fmt; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
370 gchar *msg_stripped, *tmp; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
371 GSList *segments, *it; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
372 gint msg_len; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
373 const gchar *start_invalid; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
374 gboolean is_smiley_none; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
375 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
376 g_return_val_if_fail(NULL != gc && NULL != gc->proto_data, -1); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
377 g_return_val_if_fail(id != 0 && what != NULL, -1); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
378 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
379 qd = (qq_data *) gc->proto_data; |
24670
5ec72dbdd28e
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <paul@darkrain42.org>
parents:
24605
diff
changeset
|
380 purple_debug_info("QQ", "Send chat IM to %u, len %" G_GSIZE_FORMAT ":\n%s\n", id, strlen(what), what); |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
381 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
382 /* qq_show_packet("chat IM UTF8", (guint8 *)what, strlen(what)); */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
383 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
384 msg_stripped = purple_markup_strip_html(what); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
385 g_return_val_if_fail(msg_stripped != NULL, -1); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
386 /* qq_show_packet("IM Stripped", (guint8 *)what, strlen(what)); */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
387 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
388 /* Check and valid utf8 string */ |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
389 msg_len = strlen(msg_stripped); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
390 if (!g_utf8_validate(msg_stripped, msg_len, &start_invalid)) { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
391 if (start_invalid > msg_stripped) { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
392 tmp = g_strndup(msg_stripped, start_invalid - msg_stripped); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
393 g_free(msg_stripped); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
394 msg_stripped = g_strconcat(tmp, _("(Invalid UTF-8 string)"), NULL); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
395 g_free(tmp); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
396 } else { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
397 g_free(msg_stripped); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
398 msg_stripped = g_strdup(_("(Invalid UTF-8 string)")); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
399 } |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
400 } |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
401 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
402 is_smiley_none = qq_im_smiley_none(what); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
403 segments = qq_im_get_segments(msg_stripped, is_smiley_none); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
404 g_free(msg_stripped); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
405 |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
406 if (segments == NULL) { |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
407 return -1; |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
408 } |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
409 |
24588 | 410 qd->send_im_id++; |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
411 fmt = qq_im_fmt_new_by_purple(what); |
30863
351d07aefb09
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28571
diff
changeset
|
412 for (it = segments; it; it = g_slist_delete_link(it, it)) { |
351d07aefb09
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28571
diff
changeset
|
413 request_room_send_im(gc, id, fmt, (gchar *)it->data); |
351d07aefb09
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28571
diff
changeset
|
414 g_free(it->data); |
24561
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
415 } |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
416 qq_im_fmt_free(fmt); |
6607ebd41053
Change Qun number to unsigned long
Hu Yong <ccpaging@gmail.com>
parents:
24551
diff
changeset
|
417 return 1; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 } |