diff libpurple/prpl.c @ 26190:d6e23439b77c

Change purple_prpl_can_do_media to purple_prpl_get_media_caps. This allows for it to only be called once. From the caps returned you can then tell which media capabilities a buddy has without having to call the function for each different type.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 11 Feb 2009 00:01:20 +0000
parents d68924f1265f
children ff4212a5268f
line wrap: on
line diff
--- a/libpurple/prpl.c	Sun Feb 08 23:17:51 2009 +0000
+++ b/libpurple/prpl.c	Wed Feb 11 00:01:20 2009 +0000
@@ -524,10 +524,8 @@
 #endif
 }
 
-gboolean
-purple_prpl_can_do_media(PurpleAccount *account,
-			 const char *who, 
-			 PurpleMediaSessionType type)
+PurpleMediaCaps
+purple_prpl_get_media_caps(PurpleAccount *account, const char *who)
 {
 #ifdef USE_VV
 	PurpleConnection *gc = NULL;
@@ -541,14 +539,12 @@
 	if (prpl)
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 	
-	if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, can_do_media)) {
-		return prpl_info->can_do_media(gc, who, type);
-	} else {
-		return FALSE;
+	if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info,
+			get_media_caps)) {
+		return prpl_info->get_media_caps(gc, who);
 	}
-#else
-	return FALSE;
 #endif
+	return PURPLE_MEDIA_CAPS_NONE;
 }
 
 /**************************************************************************