/soc/2013/ankitkv/gobjectification: 4676b30130c9: Refactored fin...

Ankit Vani a at nevitus.org
Sat Jul 20 16:45:46 EDT 2013


Changeset: 4676b30130c921a505cd77a5516cc940fdf8a377
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-21 02:15 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/4676b30130c9

Description:

Refactored finch to use the GObject PurplePresence API

diffstat:

 finch/gntblist.c |  10 ++++++----
 finch/gntconv.c  |   2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (39 lines):

diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -2352,8 +2352,9 @@ blist_node_compare_text(PurpleBListNode 
 		s1 = purple_chat_get_name((PurpleChat*)n1);
 		s2 = purple_chat_get_name((PurpleChat*)n2);
 	} else if (PURPLE_IS_BUDDY(n1)) {
-		return purple_presence_compare(purple_buddy_get_presence((PurpleBuddy*)n1),
-				purple_buddy_get_presence((PurpleBuddy*)n2));
+		return purple_buddy_presence_compare(
+			PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n1))),
+			PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n2))));
 	} else if (PURPLE_IS_CONTACT(n1)) {
 		s1 = purple_contact_get_alias((PurpleContact*)n1);
 		s2 = purple_contact_get_alias((PurpleContact*)n2);
@@ -2384,8 +2385,9 @@ blist_node_compare_status(PurpleBListNod
 	}
 
 	if (PURPLE_IS_BUDDY(n1)) {
-		ret = purple_presence_compare(purple_buddy_get_presence((PurpleBuddy*)n1),
-				purple_buddy_get_presence((PurpleBuddy*)n2));
+		ret = purple_buddy_presence_compare(
+			PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n1))),
+			PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n2))));
 		if (ret != 0)
 			return ret;
 	} else {
diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -581,7 +581,7 @@ generate_send_to_menu(FinchConv *ggc)
 	}
 	for (list = g_list_reverse(list); list != NULL; list = g_list_delete_link(list, list)) {
 		PurplePresence *pre = list->data;
-		PurpleBuddy *buddy = purple_buddy_presence_get_buddy(pre);
+		PurpleBuddy *buddy = purple_buddy_presence_get_buddy(PURPLE_BUDDY_PRESENCE(pre));
 		PurpleAccount *account = purple_buddy_get_account(buddy);
 		gchar *name = g_strdup(purple_buddy_get_name(buddy));
 		gchar *text = g_strdup_printf("%s (%s)", purple_buddy_get_name(buddy), purple_account_get_username(account));



More information about the Commits mailing list