pidgin.vv: a29031d1: Added purple_media_end and removed the p...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Tue Jan 27 18:05:29 EST 2009


-----------------------------------------------------------------
Revision: a29031d131de981b21aa9a1fa838dfdcf5d534db
Ancestor: c49cea147a4b072c29edd8385b2495abf7988ca9
Author: maiku at soc.pidgin.im
Date: 2009-01-27T07:48:03
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a29031d131de981b21aa9a1fa838dfdcf5d534db

Modified files:
        libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/google.c
        libpurple/protocols/jabber/jingle/rtp.c

ChangeLog: 

Added purple_media_end and removed the purple_media_got_hangup.

-------------- next part --------------
============================================================
--- libpurple/media.c	1e1f3b5fc2ba400d0166cd783ae1289dae8061bb
+++ libpurple/media.c	e9af9d77425050e69fa13bdb9f2eac485384ebab
@@ -1238,9 +1238,7 @@ purple_media_hangup(PurpleMedia *media)
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_HANGUP,
 			NULL, NULL);
-	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-			0, PURPLE_MEDIA_STATE_CHANGED_END,
-			NULL, NULL);
+	purple_media_end(media, NULL, NULL);
 }
 
 void
@@ -1249,17 +1247,17 @@ purple_media_reject(PurpleMedia *media)
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_REJECTED,
 			NULL, NULL);
-	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-			0, PURPLE_MEDIA_STATE_CHANGED_END,
-			NULL, NULL);
+	purple_media_end(media, NULL, NULL);
 }
 
 void
-purple_media_got_hangup(PurpleMedia *media)
+purple_media_end(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
-	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-			0, PURPLE_MEDIA_STATE_CHANGED_END,
-			NULL, NULL);
+	if (session_id == NULL && participant == NULL)
+		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
+				0, PURPLE_MEDIA_STATE_CHANGED_END,
+				NULL, NULL);
 }
 
 GList*
============================================================
--- libpurple/media.h	33dad1d2afd351f9bb3cde16cc2713f676aa7795
+++ libpurple/media.h	3dca047193a4ee3369c9c374161b1363445f8aa4
@@ -401,11 +401,14 @@ void purple_media_hangup(PurpleMedia *me
 void purple_media_hangup(PurpleMedia *media);
 
 /**
- * Set the media session to the got_hangup state.
+ * Ends all streams that match the given parameters
  *
- * @param media The media object to set the state on.
+ * @param media The media object with which to end streams.
+ * @param session_id The session to end streams on.
+ * @param participant The participant to end streams with.
  */
-void purple_media_got_hangup(PurpleMedia *media);
+void purple_media_end(PurpleMedia *media, const gchar *session_id,
+		const gchar *participant);
 
 /**
  * Enumerates a list of devices.
============================================================
--- libpurple/protocols/jabber/google.c	3887d48082256ecdc6430e1ae827bd7897d5199b
+++ libpurple/protocols/jabber/google.c	a853a056a9b84124a4d9777b3702f54345e0e17b
@@ -446,13 +446,13 @@ google_session_handle_reject(JabberStrea
 static void
 google_session_handle_reject(JabberStream *js, GoogleSession *session, xmlnode *packet, xmlnode *sess)
 {
-	purple_media_got_hangup(session->media);
+	purple_media_end(session->media, NULL, NULL);
 }
 
 static void
 google_session_handle_terminate(JabberStream *js, GoogleSession *session, xmlnode *packet, xmlnode *sess)
 {
-	purple_media_got_hangup(session->media);
+	purple_media_end(session->media, NULL, NULL);
 }
 
 static void
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	162f5f21ce6a7a7753f8c5945eb20b3ee5e43848
+++ libpurple/protocols/jabber/jingle/rtp.c	cd14bd1a633b423bdfd4bef60a5edc2c6f5a3bf6
@@ -594,7 +594,7 @@ jingle_rtp_handle_action_internal(Jingle
 
 			if (media != NULL) {
 				gchar *sid = jingle_session_get_sid(session);
-				purple_media_got_hangup(media);
+				purple_media_end(media, NULL, NULL);
 				g_hash_table_remove(jingle_session_get_js(
 						session)->medias, sid);
 				g_free(sid);


More information about the Commits mailing list