cpw.malu.xmpp.jingle_ft: 874bf9f0: Choose the right session when calling ji...

malu at pidgin.im malu at pidgin.im
Sun Jun 20 16:31:39 EDT 2010


-----------------------------------------------------------------
Revision: 874bf9f058856f28c2ed428b8ec9825c7ba59f05
Ancestor: a1bed004d6a995c05ec80f3335187aef96b23a93
Author: malu at pidgin.im
Date: 2010-06-20T20:27:09
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/874bf9f058856f28c2ed428b8ec9825c7ba59f05

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

ChangeLog: 

Choose the right session when calling jingle_rtp_terminate_session

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	e38e19048dd7642307f905ec315c7deeafb46699
+++ libpurple/protocols/jabber/jingle/rtp.c	c43653d6bb94c9402406818094b9a7327d144d08
@@ -972,18 +972,27 @@ jingle_rtp_terminate_session(JabberStrea
 jingle_rtp_terminate_session(JabberStream *js, const gchar *who)
 {
 	JingleSession *session;
-/* XXX: This may cause file transfers and xml sessions to stop as well */
-	session = jingle_session_find_by_jid(js, who);
+	GList *sessions = jingle_session_get_all(js);
+	GList *iter;
 
-	if (session) {
-		PurpleMedia *media = jingle_rtp_get_media(session);
-		if (media) {
-			purple_debug_info("jingle-rtp", "hanging up media\n");
-			purple_media_stream_info(media,
-					PURPLE_MEDIA_INFO_HANGUP,
+	purple_debug_info("jingle-rtp", "jingle_rtp_terminate_session\n");
+	
+	for (iter = sessions ; iter ; iter = g_list_next(iter)) {
+		JingleSession *session = (JingleSession *) iter->data;
+		
+		if (purple_strequal(jingle_session_get_remote_jid(session), who)) {
+			PurpleMedia *media = jingle_rtp_get_media(session);
+
+			if (media) {
+				purple_debug_info("jingle-rtp", "hanging up media\n");
+				purple_media_stream_info(media, PURPLE_MEDIA_INFO_HANGUP,
 					NULL, NULL, TRUE);
+				break;
+			}
 		}
 	}
+
+	g_list_free(sessions);
 }
 
 #endif /* USE_VV */


More information about the Commits mailing list