comparison libpurple/protocols/qq/group.c @ 24088:1ee91ff0d5fe

2008.10.09 - ccpaging <ccpaging(at)gmail.com> * Update 'group' protocol * Functions of group_find, group_free, group_search merged into group_join and group_internal * Removed group_find.c/h, group_free.c/h, group_search.c/h
author SHiNE CsyFeK <csyfek@gmail.com>
date Tue, 28 Oct 2008 16:38:16 +0000
parents 3c52353b83ae
children 5ace6c024230 45772d1c579a
comparison
equal deleted inserted replaced
24087:147f1b17b6ce 24088:1ee91ff0d5fe
28 #include "prpl.h" 28 #include "prpl.h"
29 #include "request.h" 29 #include "request.h"
30 30
31 #include "group_internal.h" 31 #include "group_internal.h"
32 #include "group_info.h" 32 #include "group_info.h"
33 #include "group_search.h" 33 #include "group_join.h"
34 #include "utils.h" 34 #include "utils.h"
35 #include "qq_network.h" 35 #include "qq_network.h"
36 #include "qq_define.h" 36 #include "qq_define.h"
37 #include "group_free.h"
38 37
39 static void _qq_group_search_callback(PurpleConnection *gc, const gchar *input) 38 static void _qq_group_search_callback(PurpleConnection *gc, const gchar *input)
40 { 39 {
41 guint32 ext_id; 40 guint32 ext_id;
42 41
128 127
129 qd = (qq_data *) gc->proto_data; 128 qd = (qq_data *) gc->proto_data;
130 purple_roomlist_set_in_progress(list, FALSE); 129 purple_roomlist_set_in_progress(list, FALSE);
131 purple_roomlist_unref(list); 130 purple_roomlist_unref(list);
132 } 131 }
133
134 /* this should be called upon signin, even when we did not open group chat window */
135 void qq_group_init(PurpleConnection *gc)
136 {
137 PurpleAccount *account;
138 PurpleChat *chat;
139 PurpleGroup *purple_group;
140 PurpleBlistNode *node;
141 qq_group *group;
142 gint count;
143
144 account = purple_connection_get_account(gc);
145
146 purple_debug_info("QQ", "Initial QQ Qun configurations\n");
147 purple_group = purple_find_group(PURPLE_GROUP_QQ_QUN);
148 if (purple_group == NULL) {
149 purple_debug_info("QQ", "We have no QQ Qun\n");
150 return;
151 }
152
153 count = 0;
154 for (node = ((PurpleBlistNode *) purple_group)->child; node != NULL; node = node->next) {
155 if ( !PURPLE_BLIST_NODE_IS_CHAT(node)) {
156 continue;
157 }
158 /* got one */
159 chat = (PurpleChat *) node;
160 if (account != chat->account) /* not qq account*/
161 continue;
162 group = qq_room_data_new_by_hashtable(gc, chat->components);
163 if (group == NULL)
164 continue;
165
166 if (group->id <= 0)
167 continue;
168
169 count++;
170 }
171
172 purple_debug_info("QQ", "Load %d QQ Qun configurations\n", count);
173 }