pidgin.next.minor: 9bbd55d2: Add media_caps to PurpleBuddy structure ...

maiku at pidgin.im maiku at pidgin.im
Tue Oct 20 17:06:17 EDT 2009


-----------------------------------------------------------------
Revision: 9bbd55d2626c1060df75a2000851bb474bf02213
Ancestor: a198f6b293c17b1f66b92d8962c7dbd22afa21f5
Author: maiku at pidgin.im
Date: 2009-10-20T21:00:23
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/9bbd55d2626c1060df75a2000851bb474bf02213

Modified files:
        ChangeLog.API libpurple/blist.h libpurple/prpl.c

ChangeLog: 

Add media_caps to PurpleBuddy structure and use it to determine the old caps
in purple_prpl_got_media_caps.

-------------- next part --------------
============================================================
--- ChangeLog.API	33dce0e32174315bdb094d1ce544dfc5fe04c860
+++ ChangeLog.API	6f70759f63bf7359ec98c556a1014d0b83a9837f
@@ -7,6 +7,7 @@ version 2.7.0 (??/??/????):
 		* purple_network_get_all_local_system_ips
 		* purple_prpl_got_media_caps
 		* purple_uuid_random
+		* media_caps to the PurpleBuddy struct
 		* buddy-caps-changed blist signal
 		* ui-caps-changed media manager signal
 	
============================================================
--- libpurple/blist.h	77356121b24a252d2aac3c67d1fb863f93d34c9f
+++ libpurple/blist.h	ae0aff41f3aaa49cc021af2e5e3a1c943038a77d
@@ -108,6 +108,7 @@ typedef enum
 
 #include "account.h"
 #include "buddyicon.h"
+#include "media.h"
 #include "status.h"
 
 /**************************************************************************/
@@ -143,6 +144,7 @@ struct _PurpleBuddy {
 	PurpleBuddyIcon *icon;                    /**< The buddy icon. */
 	PurpleAccount *account;					/**< the account this buddy belongs to */
 	PurplePresence *presence;
+	PurpleMediaCaps media_caps;		/**< The media capabilities of the buddy. */
 };
 
 /**
============================================================
--- libpurple/prpl.c	b686db639b91c1e07116fb29fda8e905d70a6175
+++ libpurple/prpl.c	5fb669b670096bc70c6954a6e45e9045299675bd
@@ -576,12 +576,16 @@ purple_prpl_got_media_caps(PurpleAccount
 
 	while (list) {
 		PurpleBuddy *buddy = list->data;
+		PurpleMediaCaps oldcaps = buddy->media_caps;
 		list = g_slist_delete_link(list, list);
+		buddy->media_caps = purple_prpl_get_media_caps(account, name);
 
+		if (oldcaps == buddy->media_caps)
+			continue;
+
 		purple_signal_emit(purple_blist_get_handle(),
 				"buddy-caps-changed", buddy,
-				purple_prpl_get_media_caps(account, name),
-				PURPLE_MEDIA_CAPS_NONE);
+				buddy->media_caps, oldcaps);
 	}
 #endif
 }


More information about the Commits mailing list