# HG changeset patch # User maiku@pidgin.im # Date 1256069185 0 # Node ID 4f14b03a9d5051af384cdd2fde2d65cb41239745 # Parent c855d321fc78c911a7dc2a45557b4a1e46d634cb Add the purple_media_got_media_caps function in order to signal when a prpl has retrieved a contact's media capabilities. diff -r c855d321fc78 -r 4f14b03a9d50 ChangeLog.API --- 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 diff -r c855d321fc78 -r 4f14b03a9d50 libpurple/prpl.c --- 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 **************************************************************************/ diff -r c855d321fc78 -r 4f14b03a9d50 libpurple/prpl.h --- 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); + /*@}*/ /**************************************************************************/