changeset 26122:5d9a97a23d6e

Remove some of the deprecated API.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Tue, 13 Jan 2009 13:43:13 +0000
parents 4ae228cf119f
children f09107a80608
files finch/gntmedia.c libpurple/media.c libpurple/media.h libpurple/protocols/jabber/google.c libpurple/protocols/jabber/jingle/rtp.c pidgin/gtkblist.c pidgin/gtkconv.c
diffstat 7 files changed, 16 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntmedia.c	Tue Jan 13 13:01:50 2009 +0000
+++ b/finch/gntmedia.c	Tue Jan 13 13:43:13 2009 +0000
@@ -359,7 +359,6 @@
 	if (!media)
 		return PURPLE_CMD_STATUS_FAILED;
 
-	purple_media_wait(media);
 	return PURPLE_CMD_STATUS_OK;
 }
 
--- a/libpurple/media.c	Tue Jan 13 13:01:50 2009 +0000
+++ b/libpurple/media.c	Tue Jan 13 13:43:13 2009 +0000
@@ -1215,18 +1215,6 @@
 }
 
 void
-purple_media_ready(PurpleMedia *media)
-{
-
-}
-
-void
-purple_media_wait(PurpleMedia *media)
-{
-
-}
-
-void
 purple_media_accept(PurpleMedia *media)
 {
 	GList *sessions;
@@ -1238,7 +1226,8 @@
 		PurpleMediaSession *session = sessions->data;
 		session->accepted = TRUE;
 
-		purple_media_emit_ready(media, session, NULL);
+		if (media->priv->initiator == FALSE)
+			purple_media_emit_ready(media, session, NULL);
 	}
 
 	streams = media->priv->streams;
@@ -1271,12 +1260,6 @@
 }
 
 void
-purple_media_got_request(PurpleMedia *media)
-{
-
-}
-
-void
 purple_media_got_hangup(PurpleMedia *media)
 {
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
@@ -1284,26 +1267,6 @@
 			NULL, NULL);
 }
 
-void
-purple_media_got_accept(PurpleMedia *media)
-{
-	GList *sessions;
-	GList *streams;
-
-	sessions = g_hash_table_get_values(media->priv->sessions);
-
-	for (; sessions; sessions = g_list_delete_link(sessions, sessions)) {
-		PurpleMediaSession *session = sessions->data;
-		session->accepted = TRUE;
-	}
-
-	streams = media->priv->streams;
-
-	for (; streams; streams = g_list_next(streams)) {
-		purple_media_set_remote_candidates(streams->data);
-	}
-}
-
 GList*
 purple_media_get_devices(const gchar *plugin)
 {
@@ -1543,10 +1506,6 @@
 {
 	gchar *name;
 	FsParticipant *participant;
-	PurpleMediaCandidate *local =
-			purple_media_candidate_from_fs(native_candidate);
-	PurpleMediaCandidate *remote =
-			purple_media_candidate_from_fs(remote_candidate);
 	PurpleMediaStream *stream;
 
 	g_object_get(fsstream, "participant", &participant, NULL);
@@ -1559,9 +1518,6 @@
 	stream->remote_candidate = fs_candidate_copy(remote_candidate);
 
 	purple_debug_info("media", "candidate pair established\n");
-
-	purple_media_candidate_free(local);
-	purple_media_candidate_free(remote);
 }
 
 static gboolean
--- a/libpurple/media.h	Tue Jan 13 13:01:50 2009 +0000
+++ b/libpurple/media.h	Tue Jan 13 13:43:13 2009 +0000
@@ -380,20 +380,6 @@
 void purple_media_error(PurpleMedia *media, const gchar *error, ...);
 
 /**
- * Set the media session to the ready state.
- *
- * @param media The media object to set the state on.
- */
-void purple_media_ready(PurpleMedia *media);
-
-/**
- * Set the media session to the wait state.
- *
- * @param media The media object to set the state on.
- */
-void purple_media_wait(PurpleMedia *media);
-
-/**
  * Set the media session to the accepted state.
  *
  * @param media The media object to set the state on.
@@ -415,13 +401,6 @@
 void purple_media_hangup(PurpleMedia *media);
 
 /**
- * Set the media session to the got_request state.
- *
- * @param media The media object to set the state on.
- */
-void purple_media_got_request(PurpleMedia *media);
-
-/**
  * Set the media session to the got_hangup state.
  *
  * @param media The media object to set the state on.
@@ -429,13 +408,6 @@
 void purple_media_got_hangup(PurpleMedia *media);
 
 /**
- * Set the media session to the got_accept state.
- *
- * @param media The media object to set the state on.
- */
-void purple_media_got_accept(PurpleMedia *media);
-
-/**
  * Enumerates a list of devices.
  *
  * @param plugin The name of the GStreamer plugin from which to enumerate devices.
--- a/libpurple/protocols/jabber/google.c	Tue Jan 13 13:01:50 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Tue Jan 13 13:43:13 2009 +0000
@@ -305,7 +305,6 @@
 			G_CALLBACK(google_session_ready), session);
 	g_signal_connect(G_OBJECT(session->media), "state-changed",
 			G_CALLBACK(google_session_state_changed_cb), session);
-	purple_media_ready(session->media);
 
 	if (sessions == NULL)
 		sessions = g_hash_table_new(google_session_id_hash,
@@ -367,7 +366,6 @@
 			G_CALLBACK(google_session_ready), session);
 	g_signal_connect(G_OBJECT(session->media), "state-changed",
 			G_CALLBACK(google_session_state_changed_cb), session);
-	purple_media_ready(session->media);
 
 	purple_media_codec_list_free(codecs);
 	
@@ -442,7 +440,7 @@
 	purple_media_set_remote_codecs(session->media, "google-voice",
 			session->remote_jid, codecs);
 
-	purple_media_got_accept(session->media);
+	purple_media_accept(session->media);
 }
 
 static void
--- a/libpurple/protocols/jabber/jingle/rtp.c	Tue Jan 13 13:01:50 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rtp.c	Tue Jan 13 13:43:13 2009 +0000
@@ -553,7 +553,7 @@
 			/* This needs to be for the entire session, not a single content */
 			/* very hacky */
 			if (xmlnode_get_next_twin(xmlcontent) == NULL)
-				purple_media_got_accept(jingle_rtp_get_media(session));
+				purple_media_accept(jingle_rtp_get_media(session));
 
 			g_object_unref(session);
 			break;
@@ -585,10 +585,6 @@
 						candidates);
 			}
 
-			/* very hacky */
-			if (xmlnode_get_next_twin(xmlcontent) == NULL)
-				purple_media_ready(jingle_rtp_get_media(session));
-
 			g_object_unref(session);
 			break;
 		}
@@ -696,9 +692,6 @@
 		return NULL;
 	}
 
-	purple_media_ready(media);
-	purple_media_wait(media);
-
 	g_free(jid);
 	g_free(me);
 
--- a/pidgin/gtkblist.c	Tue Jan 13 13:01:50 2009 +0000
+++ b/pidgin/gtkblist.c	Tue Jan 13 13:43:13 2009 +0000
@@ -340,32 +340,22 @@
 #ifdef USE_VV
 static void gtk_blist_menu_audio_call_cb(GtkWidget *w, PurpleBuddy *b)
 {
-	PurpleMedia *media = purple_prpl_initiate_media(purple_buddy_get_account(b),
+	purple_prpl_initiate_media(purple_buddy_get_account(b),
 		purple_buddy_get_name(b), PURPLE_MEDIA_AUDIO);
-	
-	if (media) {
-		purple_media_wait(media);
-	}
 }
 
 static void gtk_blist_menu_video_call_cb(GtkWidget *w, PurpleBuddy *b)
 {
-	PurpleMedia *media = NULL;
-	
 	/* if the buddy supports both audio and video, start a combined call,
 	 otherwise start a pure video session */
 	if (purple_prpl_can_do_media(purple_buddy_get_account(b),
 		purple_buddy_get_name(b), PURPLE_MEDIA_AUDIO)) {
-		media = purple_prpl_initiate_media(purple_buddy_get_account(b),
+		purple_prpl_initiate_media(purple_buddy_get_account(b),
 			purple_buddy_get_name(b), PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO);
 	} else {
-		media = purple_prpl_initiate_media(purple_buddy_get_account(b),
+		purple_prpl_initiate_media(purple_buddy_get_account(b),
 			purple_buddy_get_name(b), PURPLE_MEDIA_VIDEO);
 	}
-	
-	if (media) {
-		purple_media_wait(media);
-	}
 }
 
 #endif
--- a/pidgin/gtkconv.c	Tue Jan 13 13:01:50 2009 +0000
+++ b/pidgin/gtkconv.c	Tue Jan 13 13:43:13 2009 +0000
@@ -7765,13 +7765,9 @@
 	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
 	PurpleAccount *account = purple_conversation_get_account(conv);
 
-	PurpleMedia *media =
-		purple_prpl_initiate_media(account,
-					   purple_conversation_get_name(conv),
-					   PURPLE_MEDIA_AUDIO);
-
-	if (media)
-		purple_media_wait(media);
+	purple_prpl_initiate_media(account,
+			purple_conversation_get_name(conv),
+			PURPLE_MEDIA_AUDIO);
 }
 
 static void
@@ -7781,13 +7777,9 @@
 	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
 	PurpleAccount *account = purple_conversation_get_account(conv);
 
-	PurpleMedia *media =
-		purple_prpl_initiate_media(account,
-					   purple_conversation_get_name(conv),
-					   PURPLE_MEDIA_VIDEO);
-
-	if (media)
-		purple_media_wait(media);
+	purple_prpl_initiate_media(account,
+			purple_conversation_get_name(conv),
+			PURPLE_MEDIA_VIDEO);
 }
 
 static void
@@ -7797,13 +7789,9 @@
 	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
 	PurpleAccount *account = purple_conversation_get_account(conv);
 
-	PurpleMedia *media =
-		purple_prpl_initiate_media(account,
-					   purple_conversation_get_name(conv),
-					   PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO);
-
-	if (media)
-		purple_media_wait(media);
+	purple_prpl_initiate_media(account,
+			purple_conversation_get_name(conv),
+			PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO);
 }
 
 static void