pidgin.vv: 37a31fa5: Use stream-info instead of state-changed...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sat Mar 21 05:15:42 EDT 2009


-----------------------------------------------------------------
Revision: 37a31fa597ec5d7d9eaec451a1100b5bf5aa1501
Ancestor: 425ee87b3d3da7d8ab3defdb223a2c9fcb728a27
Author: maiku at soc.pidgin.im
Date: 2009-03-21T00:34:29
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/37a31fa597ec5d7d9eaec451a1100b5bf5aa1501

Modified files:
        libpurple/protocols/jabber/jingle/rtp.c

ChangeLog: 

Use stream-info instead of state-changed for hangup and reject.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	ee185429e9e93592cda6aea76bf71655529cda27
+++ libpurple/protocols/jabber/jingle/rtp.c	6b58a3c2385b5d2420b74f3e9c92188bc03fae1a
@@ -439,13 +439,22 @@ jingle_rtp_state_changed_cb(PurpleMedia 
 		gchar *sid, gchar *name, JingleSession *session)
 {
 	purple_debug_info("jingle-rtp", "state-changed: type %d id: %s name: %s\n", type, sid, name);
+}
 
-	if ((type == PURPLE_MEDIA_STATE_CHANGED_REJECTED ||
-			type == PURPLE_MEDIA_STATE_CHANGED_HANGUP) &&
-			sid == NULL && name == NULL) {
+static void
+jingle_rtp_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
+		gchar *sid, gchar *name, JingleSession *session)
+{
+	purple_debug_info("jingle-rtp", "stream-info: type %d "
+			"id: %s name: %s\n", type, sid, name);
+	if (type == PURPLE_MEDIA_INFO_HANGUP) {
 		jabber_iq_send(jingle_session_terminate_packet(
 				session, "success"));
 		g_object_unref(session);
+	} else if (type == PURPLE_MEDIA_INFO_REJECT) {
+		jabber_iq_send(jingle_session_terminate_packet(
+				session, "decline"));
+		g_object_unref(session);
 	}
 }
 
@@ -512,6 +521,8 @@ jingle_rtp_create_media(JingleContent *c
 				 G_CALLBACK(jingle_rtp_codecs_changed_cb), session);
 	g_signal_connect(G_OBJECT(media), "state-changed",
 				 G_CALLBACK(jingle_rtp_state_changed_cb), session);
+	g_signal_connect(G_OBJECT(media), "stream-info",
+			G_CALLBACK(jingle_rtp_stream_info_cb), session);
 
 	g_object_unref(session);
 	return media;


More information about the Commits mailing list