comparison finch/gntconv.c @ 32236:c39583aad67c

Hide struct _PurpleConvChatBuddy. Add accessor methods: * purple_conv_chat_cb_get_alias * purple_conv_chat_cb_get_flags * purple_conv_chat_cb_is_buddy * purple_conv_chat_cb_get_ui_data * purple_conv_chat_cb_set_ui_data
author andrew.victor@mxit.com
date Sat, 01 Oct 2011 13:03:38 +0000
parents 49a33bd1baf1
children 3e2191125ad7
comparison
equal deleted inserted replaced
32235:fe20ff3d4e7a 32236:c39583aad67c
1082 g_string_printf(string, 1082 g_string_printf(string,
1083 ngettext("List of %d user:\n", "List of %d users:\n", count), count); 1083 ngettext("List of %d user:\n", "List of %d users:\n", count), count);
1084 for (iter = users; iter; iter = iter->next) 1084 for (iter = users; iter; iter = iter->next)
1085 { 1085 {
1086 PurpleConvChatBuddy *cbuddy = iter->data; 1086 PurpleConvChatBuddy *cbuddy = iter->data;
1087 char *str; 1087 const char *str;
1088 1088
1089 if ((str = cbuddy->alias) == NULL) 1089 if ((str = purple_conv_chat_cb_get_alias(cbuddy)) == NULL)
1090 str = cbuddy->name; 1090 str = purple_conv_chat_cb_get_name(cbuddy);
1091 g_string_append_printf(string, "[ %s ]", str); 1091 g_string_append_printf(string, "[ %s ]", str);
1092 } 1092 }
1093 1093
1094 purple_conversation_write(conv, NULL, string->str, 1094 purple_conversation_write(conv, NULL, string->str,
1095 PURPLE_MESSAGE_SYSTEM, time(NULL)); 1095 PURPLE_MESSAGE_SYSTEM, time(NULL));
1098 1098
1099 for (; users; users = users->next) 1099 for (; users; users = users->next)
1100 { 1100 {
1101 PurpleConvChatBuddy *cbuddy = users->data; 1101 PurpleConvChatBuddy *cbuddy = users->data;
1102 GntTree *tree = GNT_TREE(ggc->u.chat->userlist); 1102 GntTree *tree = GNT_TREE(ggc->u.chat->userlist);
1103 gnt_entry_add_suggest(entry, cbuddy->name); 1103 gnt_entry_add_suggest(entry, purple_conv_chat_cb_get_name(cbuddy));
1104 gnt_entry_add_suggest(entry, cbuddy->alias); 1104 gnt_entry_add_suggest(entry, purple_conv_chat_cb_get_alias(cbuddy));
1105 gnt_tree_add_row_after(tree, g_strdup(cbuddy->name), 1105 gnt_tree_add_row_after(tree, g_strdup(purple_conv_chat_cb_get_name(cbuddy)),
1106 gnt_tree_create_row(tree, chat_flag_text(cbuddy->flags), cbuddy->alias), NULL, NULL); 1106 gnt_tree_create_row(tree, chat_flag_text(purple_conv_chat_cb_get_flags(cbuddy)), purple_conv_chat_cb_get_alias(cbuddy)), NULL, NULL);
1107 } 1107 }
1108 } 1108 }
1109 1109
1110 static void 1110 static void
1111 finch_chat_rename_user(PurpleConversation *conv, const char *old, const char *new_n, const char *new_a) 1111 finch_chat_rename_user(PurpleConversation *conv, const char *old, const char *new_n, const char *new_a)
1120 gnt_tree_remove(tree, (gpointer)old); 1120 gnt_tree_remove(tree, (gpointer)old);
1121 1121
1122 gnt_entry_add_suggest(entry, new_n); 1122 gnt_entry_add_suggest(entry, new_n);
1123 gnt_entry_add_suggest(entry, new_a); 1123 gnt_entry_add_suggest(entry, new_a);
1124 gnt_tree_add_row_after(tree, g_strdup(new_n), 1124 gnt_tree_add_row_after(tree, g_strdup(new_n),
1125 gnt_tree_create_row(tree, chat_flag_text(cb->flags), new_a), NULL, NULL); 1125 gnt_tree_create_row(tree, chat_flag_text(purple_conv_chat_cb_get_flags(cb)), new_a), NULL, NULL);
1126 } 1126 }
1127 1127
1128 static void 1128 static void
1129 finch_chat_remove_users(PurpleConversation *conv, GList *list) 1129 finch_chat_remove_users(PurpleConversation *conv, GList *list)
1130 { 1130 {
1141 static void 1141 static void
1142 finch_chat_update_user(PurpleConversation *conv, const char *user) 1142 finch_chat_update_user(PurpleConversation *conv, const char *user)
1143 { 1143 {
1144 PurpleConvChatBuddy *cb = purple_conv_chat_cb_find(PURPLE_CONV_CHAT(conv), user); 1144 PurpleConvChatBuddy *cb = purple_conv_chat_cb_find(PURPLE_CONV_CHAT(conv), user);
1145 FinchConv *ggc = FINCH_CONV(conv); 1145 FinchConv *ggc = FINCH_CONV(conv);
1146 gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(cb->flags)); 1146 gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(purple_conv_chat_cb_get_flags(cb)));
1147 } 1147 }
1148 1148
1149 static void 1149 static void
1150 finch_conv_present(PurpleConversation *conv) 1150 finch_conv_present(PurpleConversation *conv)
1151 { 1151 {