# HG changeset patch # User maiku@pidgin.im # Date 1256072423 0 # Node ID 33715feb7b8d5d477ce648c24d76dcafe095e2d9 # Parent f3f7f683fda5612ebdb8d4bd91452ccbde3d3e8c Add media_caps to PurpleBuddy structure and use it to determine the old caps in purple_prpl_got_media_caps. diff -r f3f7f683fda5 -r 33715feb7b8d ChangeLog.API --- a/ChangeLog.API Tue Oct 20 20:42:58 2009 +0000 +++ b/ChangeLog.API Tue Oct 20 21:00:23 2009 +0000 @@ -7,6 +7,7 @@ * 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 diff -r f3f7f683fda5 -r 33715feb7b8d libpurple/blist.h --- a/libpurple/blist.h Tue Oct 20 20:42:58 2009 +0000 +++ b/libpurple/blist.h Tue Oct 20 21:00:23 2009 +0000 @@ -108,6 +108,7 @@ #include "account.h" #include "buddyicon.h" +#include "media.h" #include "status.h" /**************************************************************************/ @@ -143,6 +144,7 @@ PurpleBuddyIcon *icon; /**< The buddy icon. */ PurpleAccount *account; /**< the account this buddy belongs to */ PurplePresence *presence; + PurpleMediaCaps media_caps; /**< The media capabilities of the buddy. */ }; /** diff -r f3f7f683fda5 -r 33715feb7b8d libpurple/prpl.c --- a/libpurple/prpl.c Tue Oct 20 20:42:58 2009 +0000 +++ b/libpurple/prpl.c Tue Oct 20 21:00:23 2009 +0000 @@ -576,12 +576,16 @@ 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 }