comparison libgaim/protocols/qq/group_conv.c @ 14404:8ff8f1c897b5

[gaim-migrate @ 17112] Fixed chat support. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Fri, 01 Sep 2006 11:03:18 +0000
parents 60b1bc8dbf37
children 6b8bc59414f0
comparison
equal deleted inserted replaced
14403:646dcf11b4eb 14404:8ff8f1c897b5
35 qq_data *qd; 35 qq_data *qd;
36 36
37 g_return_if_fail(gc != NULL && gc->proto_data != NULL && group != NULL); 37 g_return_if_fail(gc != NULL && gc->proto_data != NULL && group != NULL);
38 qd = (qq_data *) gc->proto_data; 38 qd = (qq_data *) gc->proto_data;
39 39
40 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, group->group_name_utf8, gaim_connection_get_account(gc)); 40 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT,
41 group->group_name_utf8, gaim_connection_get_account(gc));
41 if (conv == NULL) /* show only one window per group */ 42 if (conv == NULL) /* show only one window per group */
42 serv_got_joined_chat(gc, qd->channel++, group->group_name_utf8); 43 serv_got_joined_chat(gc, qd->channel++, group->group_name_utf8);
43 } 44 }
44 45
45 /* refresh online member in group conversation window */ 46 /* refresh online member in group conversation window */
52 gint flag; 53 gint flag;
53 g_return_if_fail(gc != NULL && group != NULL); 54 g_return_if_fail(gc != NULL && group != NULL);
54 55
55 names = NULL; 56 names = NULL;
56 flags = NULL; 57 flags = NULL;
57 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, group->group_name_utf8, gaim_connection_get_account(gc)); 58 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT,
59 group->group_name_utf8, gaim_connection_get_account(gc));
58 if (conv != NULL && group->members != NULL) { 60 if (conv != NULL && group->members != NULL) {
59 list = group->members; 61 list = group->members;
60 while (list != NULL) { 62 while (list != NULL) {
61 member = (qq_buddy *) list->data; 63 member = (qq_buddy *) list->data;
62 /* always put it even offline */ 64 /* always put it even offline */
63 names = g_list_append(names, 65 names = g_list_append(names,
64 (member->nickname != 66 /* we need unique identifiers for everyone in the chat or else we'll
65 NULL) ? 67 * run into problems with functions like get_cb_real_name from qq.c */
66 g_strdup(member->nickname) : uid_to_gaim_name(member->uid)); 68 (member->nickname != NULL && *(member->nickname) != '\0') ?
67 69 g_strdup_printf("%s (qq-%u)", member->nickname, member->uid) :
70 g_strdup_printf("(qq-%u)", member->uid));
68 flag = 0; 71 flag = 0;
69 /* TYPING to put online above OP and FOUNDER */ 72 /* TYPING to put online above OP and FOUNDER */
70 if (is_online(member->status)) flag |= (GAIM_CBFLAGS_TYPING | GAIM_CBFLAGS_VOICE); 73 if (is_online(member->status)) flag |= (GAIM_CBFLAGS_TYPING | GAIM_CBFLAGS_VOICE);
71 if(1 == (member->role & 1)) flag |= GAIM_CBFLAGS_OP; 74 if(1 == (member->role & 1)) flag |= GAIM_CBFLAGS_OP;
72 if(member->uid == group->creator_uid) flag |= GAIM_CBFLAGS_FOUNDER; 75 if(member->uid == group->creator_uid) flag |= GAIM_CBFLAGS_FOUNDER;