# HG changeset patch # User Richard Nelson # Date 1204197949 0 # Node ID 5617298709290819c8d57d74e85e1c26dc6c262c # Parent d36ffc472585ed4290de64137ab2eb0ee925230b Fix showing a contact's log, and don't access struct internals diff -r d36ffc472585 -r 561729870929 finch/gntblist.c --- a/finch/gntblist.c Thu Feb 28 11:18:43 2008 +0000 +++ b/finch/gntblist.c Thu Feb 28 11:25:49 2008 +0000 @@ -1308,7 +1308,7 @@ } -static void showlog_cb(PurpleBlistNode *node) +static void showlog_cb(PurpleBlistNode *sel, PurpleBlistNode *node) { PurpleLogType type; PurpleAccount *account; diff -r d36ffc472585 -r 561729870929 finch/gntlog.c --- a/finch/gntlog.c Thu Feb 28 11:18:43 2008 +0000 +++ b/finch/gntlog.c Thu Feb 28 11:25:49 2008 +0000 @@ -419,7 +419,8 @@ return; } - for (child = contact->node.child ; child ; child = child->next) { + for (child = purple_blist_node_get_first_child((PurpleBlistNode*)contact); child; + child = purple_blist_node_get_sibling_next(child)) { if (!PURPLE_BLIST_NODE_IS_BUDDY(child)) continue; @@ -429,17 +430,17 @@ } logs = g_list_sort(logs, purple_log_compare); - if (contact->alias != NULL) - name = contact->alias; - else if (contact->priority != NULL) - name = purple_buddy_get_contact_alias(contact->priority); + name = purple_contact_get_alias(contact); + if (!name) + name = purple_buddy_get_contact_alias(purple_contact_get_priority_buddy(contact)); /* This will happen if the contact doesn't have an alias, * and none of the contact's buddies are online. * There is probably a better way to deal with this. */ if (name == NULL) { - if (contact->node.child != NULL && PURPLE_BLIST_NODE_IS_BUDDY(contact->node.child)) - name = purple_buddy_get_contact_alias((PurpleBuddy *) contact->node.child); + child = purple_blist_node_get_first_child((PurpleBlistNode*)contact); + if (child != NULL && PURPLE_BLIST_NODE_IS_BUDDY(child)) + name = purple_buddy_get_contact_alias((PurpleBuddy *)child); if (name == NULL) name = ""; }