pidgin.vv: 6576ff8b: Have purple_media_codecs_ready handle a ...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Wed Feb 25 15:50:27 EST 2009


-----------------------------------------------------------------
Revision: 6576ff8b014616e6a3d9d80dbeb652a50c48dbe6
Ancestor: 3803c8455ed3452c09ecbff2181d93f25b180fb2
Author: maiku at soc.pidgin.im
Date: 2009-02-25T08:18:17
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/6576ff8b014616e6a3d9d80dbeb652a50c48dbe6

Modified files:
        libpurple/media.c

ChangeLog: 

Have purple_media_codecs_ready handle a session wildcard.

-------------- next part --------------
============================================================
--- libpurple/media.c	0a5a462b7315be80a1df50aa1a7b3a5c11f0d043
+++ libpurple/media.c	146776267ab76fabba7e9f8398ef4e9d75e37763
@@ -2265,17 +2265,30 @@ purple_media_codecs_ready(PurpleMedia *m
 gboolean
 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id)
 {
-	PurpleMediaSession *session;
 	gboolean ret;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
 
-	session = purple_media_get_session(media, sess_id);
+	if (sess_id != NULL) {
+		PurpleMediaSession *session;
+		session = purple_media_get_session(media, sess_id);
 
-	if (session == NULL)
-		return FALSE;
+		if (session == NULL)
+			return FALSE;
 
-	g_object_get(session->session, "codecs-ready", &ret, NULL);
+		g_object_get(session->session, "codecs-ready", &ret, NULL);
+	} else {
+		GList *values = g_hash_table_get_values(media->priv->sessions);
+		for (; values; values = g_list_delete_link(values, values)) {
+			PurpleMediaSession *session = values->data;
+			g_object_get(session->session,
+					"codecs-ready", &ret, NULL);
+			if (ret == FALSE)
+				break;
+		}
+		if (values != NULL)
+			g_list_free(values);
+	}
 	return ret;
 }
 


More information about the Commits mailing list