pidgin.vv: 0e2f31c8: Change purple_media_candidates_prepared ...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Fri Mar 20 04:35:44 EDT 2009


-----------------------------------------------------------------
Revision: 0e2f31c8d0c187e9c1500e9823f23cdfc7e46543
Ancestor: 9bdd5c72ef1ffacec8f63a8e5c61b4baeea3a210
Author: maiku at soc.pidgin.im
Date: 2009-03-19T22:57:53
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/0e2f31c8d0c187e9c1500e9823f23cdfc7e46543

Modified files:
        libpurple/media.c libpurple/media.h

ChangeLog: 

Change purple_media_candidates_prepared to use wildcards.

-------------- next part --------------
============================================================
--- libpurple/media.c	a6f607185585ba6a3cdb599786d8f79ff1e2cdc2
+++ libpurple/media.c	ac8914be8c32e09fec3d47c1cf31103f55a1f2fc
@@ -2239,28 +2239,26 @@ gboolean
 }
 
 gboolean
-purple_media_candidates_prepared(PurpleMedia *media, const gchar *name)
+purple_media_candidates_prepared(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
-	GList *sessions;
+	GList *streams;
+	gboolean prepared = TRUE;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
 
-	sessions = purple_media_get_session_names(media);
+	streams = purple_media_get_streams(media, session_id, participant);
 
-	for (; sessions; sessions = sessions->next) {
-		const gchar *session = sessions->data;
-		GList *local = purple_media_get_active_local_candidates(
-				media, session, name);
-		GList *remote = purple_media_get_active_remote_candidates(
-				media, session, name);
-		gboolean result = (local == NULL || remote == NULL);
-		purple_media_candidate_list_free(local);
-		purple_media_candidate_list_free(remote);
-		if (!result)
-			return FALSE;
+	for (; streams; streams = g_list_delete_link(streams, streams)) {
+		PurpleMediaStream *stream = streams->data;
+		if (stream->candidates_prepared == FALSE) {
+			g_list_free(streams);
+			prepared = FALSE;
+			break;
+		}
 	}
 
-	return TRUE;
+	return prepared;
 }
 
 gboolean
============================================================
--- libpurple/media.h	c8d8dbfa84c99d191edf30bf14663898ae0a3bbf
+++ libpurple/media.h	12f48910cb7b4aab44f60d32a888606a4f8eb513
@@ -607,14 +607,16 @@ gboolean purple_media_set_remote_codecs(
 					const gchar *name, GList *codecs);
 
 /**
- * Returns whether or not the candidates for a remote user are prepared
+ * Returns whether or not the candidates for set of streams are prepared
  *
  * @param media The media object to find the remote user in.
- * @param name The remote user to check for.
+ * @param session_id The session id of the session to check.
+ * @param participant The remote user to check for.
  *
- * @return @c TRUE All streams for the remote user have candidates prepared, @c FALSE otherwise.
+ * @return @c TRUE All streams for the given session_id/participant combination have candidates prepared, @c FALSE otherwise.
  */
-gboolean purple_media_candidates_prepared(PurpleMedia *media, const gchar *name);
+gboolean purple_media_candidates_prepared(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant);
 
 /**
  * Sets the send codec for the a session.


More information about the Commits mailing list