pidgin: 262e6658: Oops, just realized that caps can be res...

qulogic at pidgin.im qulogic at pidgin.im
Wed Feb 10 23:20:26 EST 2010


-----------------------------------------------------------------
Revision: 262e6658a8bed6e9d4e2434fdcace27dff672ac9
Ancestor: 32b85baaacb01e5073c7589441a33c7f29c66f29
Author: qulogic at pidgin.im
Date: 2010-02-11T04:15:00
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/262e6658a8bed6e9d4e2434fdcace27dff672ac9

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Oops, just realized that caps can be reset in certain situations, and we
only want that to happen for the specific resource, not the entire buddy
caps.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	abdf49add02277cf2131471b76b0c787a2c55fb8
+++ libpurple/protocols/jabber/jabber.c	139f9dcfa145014e3c7a95d92f71e9ca1fe13682
@@ -3146,7 +3146,7 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 			purple_account_get_connection(account)->proto_data;
 	JabberBuddy *jb;
 	JabberBuddyResource *jbr;
-	PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE;
+	PurpleMediaCaps total = PURPLE_MEDIA_CAPS_NONE;
 	gchar *resource;
 	GList *specific = NULL, *l;
 
@@ -3162,7 +3162,7 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 		/* no resources online, we're trying to get caps for someone
 		 * whose presence we're not subscribed to, or
 		 * someone who is offline. */
-		return caps;
+		return total;
 
 	} else if ((resource = jabber_get_resource(who)) != NULL) {
 		/* they've specified a resource, no need to ask or
@@ -3173,7 +3173,7 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 		if (!jbr) {
 			purple_debug_error("jabber", "jabber_get_media_caps:"
 					" Can't find resource %s\n", who);
-			return caps;
+			return total;
 		}
 
 		l = specific = g_list_prepend(specific, jbr);
@@ -3184,6 +3184,7 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 	}
 
 	for (; l; l = l->next) {
+		PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE;
 		jbr = l->data;
 
 		if (jabber_resource_has_capability(jbr,
@@ -3214,13 +3215,15 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 			if (jabber_resource_has_capability(jbr, NS_GOOGLE_VIDEO))
 				caps |= PURPLE_MEDIA_CAPS_AUDIO_VIDEO;
 		}
+
+		total |= caps;
 	}
 
 	if (specific) {
 		g_list_free(specific);
 	}
 
-	return caps;
+	return total;
 #else
 	return PURPLE_MEDIA_CAPS_NONE;
 #endif


More information about the Commits mailing list