changeset 29134:4f14b03a9d50

Add the purple_media_got_media_caps function in order to signal when a prpl has retrieved a contact's media capabilities.
author maiku@pidgin.im
date Tue, 20 Oct 2009 20:06:25 +0000
parents c855d321fc78
children 7a6c114c1a49
files ChangeLog.API libpurple/prpl.c libpurple/prpl.h
diffstat 3 files changed, 36 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Tue Oct 20 20:04:06 2009 +0000
+++ b/ChangeLog.API	Tue Oct 20 20:06:25 2009 +0000
@@ -5,6 +5,7 @@
 		Added:
 		* purple_account_get_name_for_display
 		* purple_network_get_all_local_system_ips
+		* purple_prpl_got_media_caps
 		* purple_uuid_random
 		* buddy-caps-changed blist signal
 		* ui-caps-changed media manager signal
--- a/libpurple/prpl.c	Tue Oct 20 20:04:06 2009 +0000
+++ b/libpurple/prpl.c	Tue Oct 20 20:06:25 2009 +0000
@@ -560,6 +560,30 @@
 	return PURPLE_MEDIA_CAPS_NONE;
 }
 
+void
+purple_prpl_got_media_caps(PurpleAccount *account, const char *name)
+{
+#ifdef USE_VV
+	GSList *list;
+
+	g_return_if_fail(account != NULL);
+	g_return_if_fail(name    != NULL);
+
+	if ((list = purple_find_buddies(account, name)) == NULL)
+		return;
+
+	while (list) {
+		PurpleBuddy *buddy = list->data;
+		list = g_slist_delete_link(list, list);
+
+		purple_signal_emit(purple_blist_get_handle(),
+				"buddy-caps-changed", buddy,
+				purple_prpl_get_media_caps(account, name),
+				PURPLE_MEDIA_CAPS_NONE);
+	}
+#endif
+}
+
 /**************************************************************************
  * Protocol Plugin Subsystem API
  **************************************************************************/
--- a/libpurple/prpl.h	Tue Oct 20 20:04:06 2009 +0000
+++ b/libpurple/prpl.h	Tue Oct 20 20:06:25 2009 +0000
@@ -815,6 +815,17 @@
 					const char *who,
 					PurpleMediaSessionType type);
 
+/**
+ * Signals that the prpl received capabilities for the given contact.
+ *
+ * This function is intended to be used only by prpls.
+ *
+ * @param account The account the user is on.
+ * @param who The name of the contact for which capabilities have been received.
+ * @since 2.7.0
+ */
+void purple_prpl_got_media_caps(PurpleAccount *account, const char *who);
+
 /*@}*/
 
 /**************************************************************************/