pidgin.vv: 662a26f9: Use the new ready signal instead of acce...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sun Jan 4 07:16:59 EST 2009


-----------------------------------------------------------------
Revision: 662a26f90f96617a44372127da76ab735a91ae0f
Ancestor: 9a9b0ae29d4e49c5fff84493f664cf349f613fb1
Author: maiku at soc.pidgin.im
Date: 2009-01-04T11:12:47
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/662a26f90f96617a44372127da76ab735a91ae0f

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

ChangeLog: 

Use the new ready signal instead of accept to send a session-accept.

-------------- next part --------------
============================================================
--- libpurple/media.c	27ed5dd28560ad4eb9c118ce28f4202cda15a0d1
+++ libpurple/media.c	1c67538c21cfb1012a7c6e2635193dbbde1fa04c
@@ -757,12 +757,12 @@ media_bus_call(GstBus *bus, GstMessage *
 						gboolean ready;
 						g_object_get(session->session, "codecs-ready", &ready, NULL);
 						if (session->codecs_ready == FALSE && ready == TRUE) {
+							session->codecs_ready = ready;
 							g_signal_emit(session->media,
 									purple_media_signals[CODECS_READY],
 									0, session->id);
 							purple_media_emit_ready(media, session, NULL);
 						}
-						session->codecs_ready = ready;
 
 						g_list_free(sessions);
 						break;
@@ -878,7 +878,6 @@ purple_media_got_accept(PurpleMedia *med
 	for (; sessions; sessions = g_list_delete_link(sessions, sessions)) {
 		PurpleMediaSession *session = sessions->data;
 		session->accepted = TRUE;
-		purple_media_emit_ready(media, session, NULL);
 	}
 }
 
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	8f257da095ad6d24804647b49adce087e6fa6945
+++ libpurple/protocols/jabber/jingle/rtp.c	5c105f894bed86563627b3cb799c5d924453c3ce
@@ -264,13 +264,6 @@ static void
 }
 
 static void
-jingle_rtp_accept_cb(PurpleMedia *media, JingleSession *session)
-{
-	jabber_iq_send(jingle_session_to_packet(session, JINGLE_TRANSPORT_INFO));
-	jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_ACCEPT));
-}
-
-static void
 jingle_rtp_reject_cb(PurpleMedia *media, JingleSession *session)
 {
 	jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_TERMINATE));
@@ -320,16 +313,22 @@ jingle_rtp_ready_cb(PurpleMedia *media, 
 {
 	purple_debug_info("rtp", "ready-new: session: %s name: %s\n", sid, name);
 
-	if (sid == NULL && name == NULL && jingle_session_is_initiator(session) == TRUE) {
-		GList *contents = jingle_session_get_contents(session);
+	if (sid == NULL && name == NULL) {
+		if (jingle_session_is_initiator(session) == TRUE) {
+			GList *contents = jingle_session_get_contents(session);
 
-		jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_INITIATE));
+			jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_INITIATE));
 
-		for (; contents; contents = g_list_next(contents)) {
-			JingleContent *content = (JingleContent *)contents->data;
-			JingleTransport *transport = jingle_content_get_transport(content);
-			if (JINGLE_IS_ICEUDP(transport))
-				jabber_iq_send(jingle_session_to_packet(session, JINGLE_TRANSPORT_INFO));
+			for (; contents; contents = g_list_next(contents)) {
+				JingleContent *content = (JingleContent *)contents->data;
+				JingleTransport *transport = jingle_content_get_transport(content);
+				if (JINGLE_IS_ICEUDP(transport))
+					jabber_iq_send(jingle_session_to_packet(session,
+							JINGLE_TRANSPORT_INFO));
+			}
+		} else {
+			jabber_iq_send(jingle_session_to_packet(session, JINGLE_TRANSPORT_INFO));
+			jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_ACCEPT));
 		}
 	}
 }
@@ -361,8 +360,6 @@ jingle_rtp_create_media(JingleContent *c
 	g_hash_table_insert(js->medias, sid, media);
 
 	/* connect callbacks */
-	g_signal_connect(G_OBJECT(media), "accepted",
-				 G_CALLBACK(jingle_rtp_accept_cb), session);
 	g_signal_connect(G_OBJECT(media), "reject",
 				 G_CALLBACK(jingle_rtp_reject_cb), session);
 	g_signal_connect(G_OBJECT(media), "hangup",


More information about the Commits mailing list