im.pidgin.pidgin: 7bbbd3b5812df69c6884596a4343b688d73c3124

wabz at pidgin.im wabz at pidgin.im
Thu Feb 28 06:32:11 EST 2008


-----------------------------------------------------------------
Revision: 7bbbd3b5812df69c6884596a4343b688d73c3124
Ancestor: a70f462be5ed9e227df5131f048854a4089abd2b
Author: wabz at pidgin.im
Date: 2008-02-28T11:25:49
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7bbbd3b5812df69c6884596a4343b688d73c3124

Modified files:
        finch/gntblist.c finch/gntlog.c

ChangeLog: 

Fix showing a contact's log, and don't access struct internals

-------------- next part --------------
============================================================
--- finch/gntblist.c	7c84bf7c3d3eb5b4fc06e22f63af8720d3c5e277
+++ finch/gntblist.c	3fa06a30410a73d35042a178684ce1f59239719e
@@ -1308,7 +1308,7 @@ finch_blist_rename_node_cb(PurpleBlistNo
 }
 
 
-static void showlog_cb(PurpleBlistNode *node)
+static void showlog_cb(PurpleBlistNode *sel, PurpleBlistNode *node)
 {
 	PurpleLogType type;
 	PurpleAccount *account;
============================================================
--- finch/gntlog.c	208a96bb627b879fcec3779c15e15862c4352e3c
+++ finch/gntlog.c	967f30db1b35ebd395fa860b02aea11577ad5b67
@@ -419,7 +419,8 @@ void finch_log_show_contact(PurpleContac
 		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 @@ void finch_log_show_contact(PurpleContac
 	}
 	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 = "";
 	}


More information about the Commits mailing list