comparison pidgin/gtkblist.c @ 32804:b6276b10cb10

Use the PurpleBuddy accessor functions.
author andrew.victor@mxit.com
date Sun, 30 Oct 2011 21:46:51 +0000
parents 2ec94166be43
children 2fdc668362f0
comparison
equal deleted inserted replaced
32800:46177ee4af40 32804:b6276b10cb10
1519 1519
1520 #endif 1520 #endif
1521 1521
1522 if (prpl_info && prpl_info->send_file) { 1522 if (prpl_info && prpl_info->send_file) {
1523 if (!prpl_info->can_receive_file || 1523 if (!prpl_info->can_receive_file ||
1524 prpl_info->can_receive_file(purple_account_get_connection(buddy->account), buddy->name)) 1524 prpl_info->can_receive_file(purple_account_get_connection(purple_buddy_get_account(buddy)), purple_buddy_get_name(buddy)))
1525 { 1525 {
1526 pidgin_new_item_from_stock(menu, _("_Send File..."), 1526 pidgin_new_item_from_stock(menu, _("_Send File..."),
1527 PIDGIN_STOCK_TOOLBAR_SEND_FILE, 1527 PIDGIN_STOCK_TOOLBAR_SEND_FILE,
1528 G_CALLBACK(gtk_blist_menu_send_file_cb), 1528 G_CALLBACK(gtk_blist_menu_send_file_cb),
1529 buddy, 0, 0, NULL); 1529 buddy, 0, 0, NULL);
1547 gboolean show_offline = purple_blist_node_get_bool(node, "show_offline"); 1547 gboolean show_offline = purple_blist_node_get_bool(node, "show_offline");
1548 pidgin_new_item_from_stock(menu, show_offline ? _("Hide When Offline") : _("Show When Offline"), 1548 pidgin_new_item_from_stock(menu, show_offline ? _("Hide When Offline") : _("Show When Offline"),
1549 NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node, 0, 0, NULL); 1549 NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node, 0, 0, NULL);
1550 } 1550 }
1551 1551
1552 pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(buddy->account), node); 1552 pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(purple_buddy_get_account(buddy)), node);
1553 pidgin_append_blist_node_extended_menu(menu, node); 1553 pidgin_append_blist_node_extended_menu(menu, node);
1554 1554
1555 if (!contact_expanded && contact != NULL) 1555 if (!contact_expanded && contact != NULL)
1556 pidgin_append_blist_node_move_to_menu(menu, (PurpleBlistNode *)contact); 1556 pidgin_append_blist_node_move_to_menu(menu, (PurpleBlistNode *)contact);
1557 1557
1600 buddy = (PurpleBuddy*)node; 1600 buddy = (PurpleBuddy*)node;
1601 } else { 1601 } else {
1602 return FALSE; 1602 return FALSE;
1603 } 1603 }
1604 if(buddy) 1604 if(buddy)
1605 pidgin_retrieve_user_info(purple_account_get_connection(buddy->account), buddy->name); 1605 pidgin_retrieve_user_info(purple_account_get_connection(purple_buddy_get_account(buddy)), purple_buddy_get_name(buddy));
1606 } else { 1606 } else {
1607 switch (event->keyval) { 1607 switch (event->keyval) {
1608 case GDK_F2: 1608 case GDK_F2:
1609 gtk_blist_menu_alias_cb(tv, node); 1609 gtk_blist_menu_alias_cb(tv, node);
1610 break; 1610 break;
1838 GtkWidget *submenu; 1838 GtkWidget *submenu;
1839 GtkWidget *image; 1839 GtkWidget *image;
1840 1840
1841 if(buddy == b) 1841 if(buddy == b)
1842 continue; 1842 continue;
1843 if(!purple_account_get_connection(buddy->account)) 1843 if(!purple_account_get_connection(purple_buddy_get_account(buddy)))
1844 continue; 1844 continue;
1845 if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy)) 1845 if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy))
1846 continue; 1846 continue;
1847 1847
1848 menuitem = gtk_image_menu_item_new_with_label(buddy->name); 1848 menuitem = gtk_image_menu_item_new_with_label(purple_buddy_get_name(buddy));
1849 buf = pidgin_create_prpl_icon(buddy->account,PIDGIN_PRPL_ICON_SMALL); 1849 buf = pidgin_create_prpl_icon(purple_buddy_get_account(buddy), PIDGIN_PRPL_ICON_SMALL);
1850 image = gtk_image_new_from_pixbuf(buf); 1850 image = gtk_image_new_from_pixbuf(buf);
1851 g_object_unref(G_OBJECT(buf)); 1851 g_object_unref(G_OBJECT(buf));
1852 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), 1852 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem),
1853 image); 1853 image);
1854 gtk_widget_show(image); 1854 gtk_widget_show(image);
1962 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) 1962 if(PURPLE_BLIST_NODE_IS_CONTACT(node))
1963 b = purple_contact_get_priority_buddy((PurpleContact*)node); 1963 b = purple_contact_get_priority_buddy((PurpleContact*)node);
1964 else 1964 else
1965 b = (PurpleBuddy *)node; 1965 b = (PurpleBuddy *)node;
1966 1966
1967 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account)); 1967 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(b)));
1968 if (prpl != NULL) 1968 if (prpl != NULL)
1969 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); 1969 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
1970 1970
1971 if (prpl && prpl_info->get_info) 1971 if (prpl && prpl_info->get_info)
1972 pidgin_retrieve_user_info(purple_account_get_connection(b->account), b->name); 1972 pidgin_retrieve_user_info(purple_account_get_connection(purple_buddy_get_account(b)), purple_buddy_get_name(b));
1973 handled = TRUE; 1973 handled = TRUE;
1974 } 1974 }
1975 1975
1976 #if (1) 1976 #if (1)
1977 /* 1977 /*
2292 else 2292 else
2293 { 2293 {
2294 buddy = (PurpleBuddy *)node; 2294 buddy = (PurpleBuddy *)node;
2295 } 2295 }
2296 2296
2297 gc = purple_account_get_connection(buddy->account); 2297 gc = purple_account_get_connection(purple_buddy_get_account(buddy));
2298 2298
2299 if (gc == NULL) 2299 if (gc == NULL)
2300 { 2300 {
2301 gtk_tree_path_free(sourcerow); 2301 gtk_tree_path_free(sourcerow);
2302 return; 2302 return;
2303 } 2303 }
2304 2304
2305 protocol = 2305 protocol =
2306 PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->list_icon(buddy->account, 2306 PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->list_icon(purple_buddy_get_account(buddy),
2307 buddy); 2307 buddy);
2308 2308
2309 str = g_string_new(NULL); 2309 str = g_string_new(NULL);
2310 g_string_printf(str, 2310 g_string_printf(str,
2311 "MIME-Version: 1.0\r\n" 2311 "MIME-Version: 1.0\r\n"
2312 "Content-Type: application/x-im-contact\r\n" 2312 "Content-Type: application/x-im-contact\r\n"
2313 "X-IM-Protocol: %s\r\n" 2313 "X-IM-Protocol: %s\r\n"
2314 "X-IM-Username: %s\r\n", 2314 "X-IM-Username: %s\r\n",
2315 protocol, 2315 protocol,
2316 buddy->name); 2316 purple_buddy_get_name(buddy));
2317 2317
2318 if (buddy->alias != NULL) 2318 if (purple_buddy_get_local_buddy_alias(buddy) != NULL)
2319 { 2319 {
2320 g_string_append_printf(str, 2320 g_string_append_printf(str,
2321 "X-IM-Alias: %s\r\n", 2321 "X-IM-Alias: %s\r\n",
2322 buddy->alias); 2322 purple_buddy_get_local_buddy_alias(buddy));
2323 } 2323 }
2324 2324
2325 g_string_append(str, "\r\n"); 2325 g_string_append(str, "\r\n");
2326 2326
2327 gtk_selection_data_set(data, 2327 gtk_selection_data_set(data,
2600 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), 2600 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel),
2601 &iter, NODE_COLUMN, &node, -1); 2601 &iter, NODE_COLUMN, &node, -1);
2602 2602
2603 if (PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CONTACT(node)) { 2603 if (PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CONTACT(node)) {
2604 PurpleBuddy *b = PURPLE_BLIST_NODE_IS_BUDDY(node) ? PURPLE_BUDDY(node) : purple_contact_get_priority_buddy(PURPLE_CONTACT(node)); 2604 PurpleBuddy *b = PURPLE_BLIST_NODE_IS_BUDDY(node) ? PURPLE_BUDDY(node) : purple_contact_get_priority_buddy(PURPLE_CONTACT(node));
2605 pidgin_dnd_file_manage(sd, b->account, b->name); 2605 pidgin_dnd_file_manage(sd, purple_buddy_get_account(b), purple_buddy_get_name(b));
2606 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); 2606 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
2607 } else { 2607 } else {
2608 gtk_drag_finish(dc, FALSE, FALSE, t); 2608 gtk_drag_finish(dc, FALSE, FALSE, t);
2609 } 2609 }
2610 } 2610 }
2700 } 2700 }
2701 2701
2702 if (data == NULL) { 2702 if (data == NULL) {
2703 if (buddy) { 2703 if (buddy) {
2704 /* Not sure I like this...*/ 2704 /* Not sure I like this...*/
2705 if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name))) 2705 if (!(icon = purple_buddy_icons_find(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy))))
2706 return NULL; 2706 return NULL;
2707 data = purple_buddy_icon_get_data(icon, &len); 2707 data = purple_buddy_icon_get_data(icon, &len);
2708 } 2708 }
2709 2709
2710 if(data == NULL) 2710 if(data == NULL)
2870 struct tooltip_data *td = g_new0(struct tooltip_data, 1); 2870 struct tooltip_data *td = g_new0(struct tooltip_data, 1);
2871 PurpleAccount *account = NULL; 2871 PurpleAccount *account = NULL;
2872 char *tmp = NULL, *node_name = NULL, *tooltip_text = NULL; 2872 char *tmp = NULL, *node_name = NULL, *tooltip_text = NULL;
2873 2873
2874 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { 2874 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
2875 account = ((PurpleBuddy*)(node))->account; 2875 account = purple_buddy_get_account((PurpleBuddy*)(node));
2876 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { 2876 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
2877 account = ((PurpleChat*)(node))->account; 2877 account = ((PurpleChat*)(node))->account;
2878 } 2878 }
2879 2879
2880 td->padding = TOOLTIP_BORDER; 2880 td->padding = TOOLTIP_BORDER;
3203 if(!buddy) 3203 if(!buddy)
3204 return FALSE; 3204 return FALSE;
3205 3205
3206 gtknode = ((PurpleBlistNode*)buddy)->ui_data; 3206 gtknode = ((PurpleBlistNode*)buddy)->ui_data;
3207 3207
3208 return (purple_account_is_connected(buddy->account) && 3208 return (purple_account_is_connected(purple_buddy_get_account(buddy)) &&
3209 (purple_presence_is_online(buddy->presence) || 3209 (purple_presence_is_online(purple_buddy_get_presence(buddy)) ||
3210 (gtknode && gtknode->recent_signonoff) || 3210 (gtknode && gtknode->recent_signonoff) ||
3211 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") || 3211 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") ||
3212 purple_blist_node_get_bool((PurpleBlistNode*)buddy, "show_offline"))); 3212 purple_blist_node_get_bool((PurpleBlistNode*)buddy, "show_offline")));
3213 } 3213 }
3214 3214
3764 { 3764 {
3765 b = (PurpleBuddy *)node; 3765 b = (PurpleBuddy *)node;
3766 c = purple_buddy_get_contact(b); 3766 c = purple_buddy_get_contact(b);
3767 } 3767 }
3768 3768
3769 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account)); 3769 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(b)));
3770 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); 3770 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
3771 3771
3772 presence = purple_buddy_get_presence(b); 3772 presence = purple_buddy_get_presence(b);
3773 user_info = purple_notify_user_info_new(); 3773 user_info = purple_notify_user_info_new();
3774 3774
3781 } 3781 }
3782 3782
3783 /* Alias */ 3783 /* Alias */
3784 /* If there's not a contact alias, the node is being displayed with 3784 /* If there's not a contact alias, the node is being displayed with
3785 * this alias, so there's no point in showing it in the tooltip. */ 3785 * this alias, so there's no point in showing it in the tooltip. */
3786 if (full && c && b->alias != NULL && b->alias[0] != '\0' && 3786 if (full && c && purple_buddy_get_local_buddy_alias(b) != NULL && purple_buddy_get_local_buddy_alias(b)[0] != '\0' &&
3787 (c->alias != NULL && c->alias[0] != '\0') && 3787 (c->alias != NULL && c->alias[0] != '\0') &&
3788 strcmp(c->alias, b->alias) != 0) 3788 strcmp(c->alias, purple_buddy_get_local_buddy_alias(b)) != 0)
3789 { 3789 {
3790 purple_notify_user_info_add_pair_plaintext(user_info, 3790 purple_notify_user_info_add_pair_plaintext(user_info,
3791 _("Buddy Alias"), b->alias); 3791 _("Buddy Alias"), purple_buddy_get_local_buddy_alias(b));
3792 } 3792 }
3793 3793
3794 /* Nickname/Server Alias */ 3794 /* Nickname/Server Alias */
3795 /* I'd like to only show this if there's a contact or buddy 3795 /* I'd like to only show this if there's a contact or buddy
3796 * alias, but many people on MSN set long nicknames, which 3796 * alias, but many people on MSN set long nicknames, which
3797 * get ellipsized, so the only way to see the whole thing is 3797 * get ellipsized, so the only way to see the whole thing is
3798 * to look at the tooltip. */ 3798 * to look at the tooltip. */
3799 if (full && b->server_alias != NULL && b->server_alias[0] != '\0') 3799 if (full && purple_buddy_get_server_alias(b))
3800 { 3800 {
3801 purple_notify_user_info_add_pair_plaintext(user_info, 3801 purple_notify_user_info_add_pair_plaintext(user_info,
3802 _("Nickname"), b->server_alias); 3802 _("Nickname"), purple_buddy_get_server_alias(b));
3803 } 3803 }
3804 3804
3805 /* Logged In */ 3805 /* Logged In */
3806 signon = purple_presence_get_login_time(presence); 3806 signon = purple_presence_get_login_time(presence);
3807 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0) 3807 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0)
3872 * FIXME: Alternatively, why not have the core do all of them? --rlaager */ 3872 * FIXME: Alternatively, why not have the core do all of them? --rlaager */
3873 if (!PURPLE_BUDDY_IS_ONLINE(b)) { 3873 if (!PURPLE_BUDDY_IS_ONLINE(b)) {
3874 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Offline")); 3874 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Offline"));
3875 } 3875 }
3876 3876
3877 if (purple_account_is_connected(b->account) && 3877 if (purple_account_is_connected(purple_buddy_get_account(b)) &&
3878 prpl_info && prpl_info->tooltip_text) 3878 prpl_info && prpl_info->tooltip_text)
3879 { 3879 {
3880 /* Additional text from the PRPL */ 3880 /* Additional text from the PRPL */
3881 prpl_info->tooltip_text(b, user_info, full); 3881 prpl_info->tooltip_text(b, user_info, full);
3882 } 3882 }
3883 3883
3884 /* These are Easter Eggs. Patches to remove them will be rejected. */ 3884 /* These are Easter Eggs. Patches to remove them will be rejected. */
3885 if (!g_ascii_strcasecmp(b->name, "robflynn")) 3885 if (!g_ascii_strcasecmp(purple_buddy_get_name(b), "robflynn"))
3886 purple_notify_user_info_add_pair_plaintext(user_info, _("Description"), _("Spooky")); 3886 purple_notify_user_info_add_pair_plaintext(user_info, _("Description"), _("Spooky"));
3887 if (!g_ascii_strcasecmp(b->name, "seanegn")) 3887 if (!g_ascii_strcasecmp(purple_buddy_get_name(b), "seanegn"))
3888 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Awesome")); 3888 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Awesome"));
3889 if (!g_ascii_strcasecmp(b->name, "chipx86")) 3889 if (!g_ascii_strcasecmp(purple_buddy_get_name(b), "chipx86"))
3890 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Rockin'")); 3890 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Rockin'"));
3891 3891
3892 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n"); 3892 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n");
3893 g_string_append(str, tmp); 3893 g_string_append(str, tmp);
3894 g_free(tmp); 3894 g_free(tmp);
3987 } 3987 }
3988 3988
3989 if (((struct _pidgin_blist_node*)(node->parent->ui_data))->contact_expanded) { 3989 if (((struct _pidgin_blist_node*)(node->parent->ui_data))->contact_expanded) {
3990 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")) 3990 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"))
3991 return NULL; 3991 return NULL;
3992 return pidgin_create_prpl_icon(((PurpleBuddy*)node)->account, PIDGIN_PRPL_ICON_SMALL); 3992 return pidgin_create_prpl_icon(purple_buddy_get_account((PurpleBuddy*)node), PIDGIN_PRPL_ICON_SMALL);
3993 } 3993 }
3994 } else { 3994 } else {
3995 return NULL; 3995 return NULL;
3996 } 3996 }
3997 3997
3998 g_return_val_if_fail(buddy != NULL, NULL); 3998 g_return_val_if_fail(buddy != NULL, NULL);
3999 3999
4000 if (!purple_privacy_check(buddy->account, purple_buddy_get_name(buddy))) { 4000 if (!purple_privacy_check(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy))) {
4001 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "blocked.png", NULL); 4001 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "blocked.png", NULL);
4002 return _pidgin_blist_get_cached_emblem(path); 4002 return _pidgin_blist_get_cached_emblem(path);
4003 } 4003 }
4004 4004
4005 /* If we came through the contact code flow above, we didn't need 4005 /* If we came through the contact code flow above, we didn't need
4031 /* This emblem comes from the small emoticon set now, to reduce duplication. */ 4031 /* This emblem comes from the small emoticon set now, to reduce duplication. */
4032 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "music.png", NULL); 4032 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "music.png", NULL);
4033 return _pidgin_blist_get_cached_emblem(path); 4033 return _pidgin_blist_get_cached_emblem(path);
4034 } 4034 }
4035 4035
4036 prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account)); 4036 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(buddy)));
4037 if (!prpl) 4037 if (!prpl)
4038 return NULL; 4038 return NULL;
4039 4039
4040 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); 4040 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
4041 if (prpl_info && prpl_info->list_emblem) 4041 if (prpl_info && prpl_info->list_emblem)
4095 if(buddy || chat) { 4095 if(buddy || chat) {
4096 PurpleAccount *account; 4096 PurpleAccount *account;
4097 PurplePlugin *prpl; 4097 PurplePlugin *prpl;
4098 4098
4099 if(buddy) 4099 if(buddy)
4100 account = buddy->account; 4100 account = purple_buddy_get_account(buddy);
4101 else 4101 else
4102 account = chat->account; 4102 account = chat->account;
4103 4103
4104 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); 4104 prpl = purple_find_prpl(purple_account_get_protocol_id(account));
4105 if(!prpl) 4105 if(!prpl)
4230 4230
4231 /* Name is all that is needed */ 4231 /* Name is all that is needed */
4232 if (!aliased || biglist) { 4232 if (!aliased || biglist) {
4233 4233
4234 /* Status Info */ 4234 /* Status Info */
4235 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account)); 4235 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(b)));
4236 4236
4237 if (prpl != NULL) 4237 if (prpl != NULL)
4238 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); 4238 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
4239 4239
4240 if (prpl_info && prpl_info->status_text && purple_account_get_connection(b->account)) { 4240 if (prpl_info && prpl_info->status_text && purple_account_get_connection(purple_buddy_get_account(b))) {
4241 char *tmp = prpl_info->status_text(b); 4241 char *tmp = prpl_info->status_text(b);
4242 const char *end; 4242 const char *end;
4243 4243
4244 if(tmp && !g_utf8_validate(tmp, -1, &end)) { 4244 if(tmp && !g_utf8_validate(tmp, -1, &end)) {
4245 char *new = g_strndup(tmp, 4245 char *new = g_strndup(tmp,
6293 gnode = (PurpleBlistNode *)group; 6293 gnode = (PurpleBlistNode *)group;
6294 for(cnode = gnode->child; cnode; cnode = cnode->next) { 6294 for(cnode = gnode->child; cnode; cnode = cnode->next) {
6295 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { 6295 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) {
6296 for(bnode = cnode->child; bnode; bnode = bnode->next) { 6296 for(bnode = cnode->child; bnode; bnode = bnode->next) {
6297 PurpleBuddy *buddy = (PurpleBuddy *)bnode; 6297 PurpleBuddy *buddy = (PurpleBuddy *)bnode;
6298 if (purple_account_is_connected(buddy->account) && 6298 if (purple_account_is_connected(purple_buddy_get_account(buddy)) &&
6299 purple_blist_node_get_bool(bnode, "show_offline")) 6299 purple_blist_node_get_bool(bnode, "show_offline"))
6300 return TRUE; 6300 return TRUE;
6301 } 6301 }
6302 } 6302 }
6303 } 6303 }
6525 ihrs, imin); 6525 ihrs, imin);
6526 } 6526 }
6527 } 6527 }
6528 } 6528 }
6529 6529
6530 prpl_icon = pidgin_create_prpl_icon(buddy->account, PIDGIN_PRPL_ICON_SMALL); 6530 prpl_icon = pidgin_create_prpl_icon(purple_buddy_get_account(buddy), PIDGIN_PRPL_ICON_SMALL);
6531 6531
6532 if (theme != NULL) 6532 if (theme != NULL)
6533 color = pidgin_blist_theme_get_contact_color(theme); 6533 color = pidgin_blist_theme_get_contact_color(theme);
6534 6534
6535 gtk_tree_store_set(gtkblist->treemodel, iter, 6535 gtk_tree_store_set(gtkblist->treemodel, iter,
7826 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { 7826 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
7827 PurpleBlistNode *n; 7827 PurpleBlistNode *n;
7828 PurpleBuddy *buddy; 7828 PurpleBuddy *buddy;
7829 for (n = node->child; n; n = n->next) { 7829 for (n = node->child; n; n = n->next) {
7830 buddy = (PurpleBuddy*)n; 7830 buddy = (PurpleBuddy*)n;
7831 activity_score += purple_log_get_activity_score(PURPLE_LOG_IM, buddy->name, buddy->account); 7831 activity_score += purple_log_get_activity_score(PURPLE_LOG_IM, purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
7832 } 7832 }
7833 buddy_name = purple_contact_get_alias((PurpleContact*)node); 7833 buddy_name = purple_contact_get_alias((PurpleContact*)node);
7834 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { 7834 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
7835 /* we don't have a reliable way of getting the log filename 7835 /* we don't have a reliable way of getting the log filename
7836 * from the chat info in the blist, yet */ 7836 * from the chat info in the blist, yet */
7862 this_log_activity_score = 0; 7862 this_log_activity_score = 0;
7863 7863
7864 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { 7864 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) {
7865 for (n2 = n->child; n2; n2 = n2->next) { 7865 for (n2 = n->child; n2; n2 = n2->next) {
7866 buddy = (PurpleBuddy*)n2; 7866 buddy = (PurpleBuddy*)n2;
7867 this_log_activity_score += purple_log_get_activity_score(PURPLE_LOG_IM, buddy->name, buddy->account); 7867 this_log_activity_score += purple_log_get_activity_score(PURPLE_LOG_IM, purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
7868 } 7868 }
7869 this_buddy_name = purple_contact_get_alias((PurpleContact*)n); 7869 this_buddy_name = purple_contact_get_alias((PurpleContact*)n);
7870 } else { 7870 } else {
7871 this_buddy_name = NULL; 7871 this_buddy_name = NULL;
7872 } 7872 }