Mercurial > pidgin.yaz
changeset 29531:33715feb7b8d
Add media_caps to PurpleBuddy structure and use it to determine the old caps
in purple_prpl_got_media_caps.
author | maiku@pidgin.im |
---|---|
date | Tue, 20 Oct 2009 21:00:23 +0000 |
parents | f3f7f683fda5 |
children | c5712737e59a |
files | ChangeLog.API libpurple/blist.h libpurple/prpl.c |
diffstat | 3 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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. */ }; /**
--- 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 }