changeset 29025:786d58ae6f76

merge of '1d05d85bcdc5deb8a2a27d792f649f71abe13d0e' and '262e6658a8bed6e9d4e2434fdcace27dff672ac9'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 11 Feb 2010 04:16:02 +0000
parents ff3a5a1b585e (current diff) 9e735d7e2f1d (diff)
children 774ca88cb685
files
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Thu Feb 11 04:12:39 2010 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Thu Feb 11 04:16:02 2010 +0000
@@ -3146,7 +3146,7 @@
 			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 @@
 		/* 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 @@
 		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 @@
 	}
 
 	for (; l; l = l->next) {
+		PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE;
 		jbr = l->data;
 
 		if (jabber_resource_has_capability(jbr,
@@ -3214,13 +3215,15 @@
 			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