diff libpurple/pounce.c @ 31457:d7be95afe03a

Tweak kartikmohta's patch a bit to use accessors instead of directly accessing struct members, add the @since tag to the doxygen comment in the API addition, and add the API addition to !ChangeLog.API. Refs #1131.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Fri, 08 Apr 2011 01:21:15 +0000
parents 4076f53cdd84
children 609e3855f36d
line wrap: on
line diff
--- a/libpurple/pounce.c	Fri Apr 08 01:12:37 2011 +0000
+++ b/libpurple/pounce.c	Fri Apr 08 01:21:15 2011 +0000
@@ -697,13 +697,16 @@
 void
 purple_pounce_destroy_all_by_buddy(PurpleBuddy *buddy)
 {
-	const char *pouncee;
-	PurpleAccount *pouncer;
+	const char *pouncee, *bname;
+	PurpleAccount *pouncer, *bacct;
 	PurplePounce *pounce;
 	GList *l, *l_next;
 
 	g_return_if_fail(buddy != NULL);
 
+	bacct = purple_buddy_get_account(buddy);
+	bname = purple_buddy_get_name(buddy);
+
 	for (l = purple_pounces_get_all(); l != NULL; l = l_next) {
 		pounce = (PurplePounce *)l->data;
 		l_next = l->next;
@@ -711,7 +714,7 @@
 		pouncer = purple_pounce_get_pouncer(pounce);
 		pouncee = purple_pounce_get_pouncee(pounce);
 
-		if ( (pouncer == buddy->account) && (strcmp(pouncee, buddy->name) == 0) )
+		if ( (pouncer == bacct) && (strcmp(pouncee, bname) == 0) )
 			purple_pounce_destroy(pounce);
 	}
 }