00001
00023
00024
00025 #include <glib.h>
00026 #include "debug.h"
00027 #include "conversation.h"
00028
00029 #include "utils.h"
00030 #include "buddy_status.h"
00031 #include "group_conv.h"
00032 #include "qq.h"
00033
00034
00035
00036 void qq_group_conv_show_window(GaimConnection * gc, qq_group * group)
00037 {
00038 GaimConversation *conv;
00039 qq_data *qd;
00040
00041 g_return_if_fail(gc != NULL && gc->proto_data != NULL && group != NULL);
00042 qd = (qq_data *) gc->proto_data;
00043
00044 conv = gaim_find_conversation_with_account(group->group_name_utf8, gaim_connection_get_account(gc));
00045 if (conv == NULL)
00046 serv_got_joined_chat(gc, qd->channel++, group->group_name_utf8);
00047 }
00048
00049
00050
00051 void qq_group_conv_refresh_online_member(GaimConnection * gc, qq_group * group)
00052 {
00053 gaim_debug(GAIM_DEBUG_ERROR, "QQ", "gnap: conv_refresh called: %d\n");
00054 GList *names, *list, *flags;
00055 qq_buddy *member;
00056 gchar *member_name;
00057 GaimConversation *conv;
00058 gint flag;
00059 g_return_if_fail(gc != NULL && group != NULL);
00060
00061 names = NULL;
00062 flags = NULL;
00063 conv = gaim_find_conversation_with_account(group->group_name_utf8, gaim_connection_get_account(gc));
00064 if (conv != NULL && group->members != NULL) {
00065 list = group->members;
00066 while (list != NULL) {
00067 member = (qq_buddy *) list->data;
00068 if (is_online(member->status)) {
00069 names = g_list_append(names,
00070 member->nickname !=
00071 NULL ?
00072 g_strdup(member->nickname) : uid_to_gaim_name(member->uid));
00073 flags = g_list_append(flags, GINT_TO_POINTER(GAIM_CBFLAGS_NONE));
00074 }
00075 list = list->next;
00076 }
00077 gaim_conv_chat_clear_users(GAIM_CONV_CHAT(conv));
00078 gaim_conv_chat_add_users(GAIM_CONV_CHAT(conv), names, flags);
00079 }
00080
00081
00082 while (names != NULL) {
00083 member_name = (gchar *) names->data;
00084 names = g_list_remove(names, member_name);
00085 g_free(member_name);
00086 }
00087
00088 while (flags != NULL) {
00089 member_name = (gchar *) flags->data;
00090 flags = g_list_remove(flags, member_name);
00091 g_free(member_name);
00092 }
00093 if (flags)
00094 g_list_free(flags);
00095 }
00096
00097
00098