pidgin.vv.yahoo.voice: 73020a8e: Use the url decoded name for the media s...

maiku at pidgin.im maiku at pidgin.im
Sat Aug 29 18:01:51 EDT 2009


-----------------------------------------------------------------
Revision: 73020a8edef357e9fd6bc50d9712be4b6cea44d7
Ancestor: e24fe04d6dada7593746f960b9cb1aa4acb074b2
Author: maiku at pidgin.im
Date: 2009-08-29T21:28:21
Branch: im.pidgin.pidgin.vv.yahoo.voice
URL: http://d.pidgin.im/viewmtn/revision/info/73020a8edef357e9fd6bc50d9712be4b6cea44d7

Modified files:
        libpurple/protocols/yahoo/yahoo_sip.c

ChangeLog: 

Use the url decoded name for the media session.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_sip.c	1a250ef7eab5f06e32ec5c71e42137200b443c5f
+++ libpurple/protocols/yahoo/yahoo_sip.c	a4a5c29684d541274b76dddbd98a28814cf9bf34
@@ -104,7 +104,8 @@ yahoo_sip_send_response(PurpleMedia *med
 static void
 yahoo_sip_send_response(PurpleMedia *media, nua_handle_t *nh)
 {
-	const sip_to_t *remote = nua_handle_remote(nh);
+	const gchar *name = purple_url_decode(
+			nua_handle_remote(nh)->a_display);
 	GList *codecs, *candidates;
 	gchar **codec_strs, **candidate_strs,
 			*codec_str, *candidate_str, *sdp_str;
@@ -129,7 +130,7 @@ yahoo_sip_send_response(PurpleMedia *med
 	purple_debug_info("yahoo", "local codecs:\n%s", codec_str);
 
 	candidates = purple_media_get_local_candidates(media,
-			"yahoo-voice", remote->a_display);
+			"yahoo-voice", name);
 	candidate_strs = g_new0(gchar*, g_list_length(candidates) + 1);
 
 	if (candidates->data)
@@ -322,17 +323,18 @@ event_callback(nua_event_t event, int st
 		YahooSip *ysip = yd->ysip;
 		ysip->shutdown = TRUE;
 	} else if (event == nua_i_invite) {
+		const gchar *name = purple_url_decode(
+				nua_handle_remote(nh)->a_display);
 		PurpleMedia *media;
 		PurpleAccount *account = magic;
-		const sip_to_t *remote = nua_handle_remote(nh);
 		GParameter param;
 		purple_debug_info("yahoo", "INVITE status %d display: %s\n",
-				status, remote->a_display);
+				status, name);
 		nua_respond(nh, 180, "Ringing", TAG_END());
 		media = purple_media_manager_create_media(
 				purple_media_manager_get(),
 				account, "fsrtpconference",
-				remote->a_display, FALSE);
+				name, FALSE);
 
 		if (!media) {
 			purple_debug_error("yahoo",
@@ -357,7 +359,7 @@ event_callback(nua_event_t event, int st
 		param.value.g_type = 0;
 		g_value_init(&param.value, G_TYPE_UINT);
 		g_value_set_uint(&param.value, 4); /* NICE_COMPATIBILITY_YAHOO */
-		purple_media_add_stream(media, "yahoo-voice", remote->a_display,
+		purple_media_add_stream(media, "yahoo-voice", name,
 				PURPLE_MEDIA_AUDIO, FALSE, "nice", 1, &param);
 	} else if (event == nua_i_state && status == 100) {
 		/*
@@ -365,7 +367,8 @@ event_callback(nua_event_t event, int st
 		 * I need to add the check back.
 		 */
 		const sdp_session_t *sdp_session = NULL;
-		const sip_to_t *remote = nua_handle_remote(nh);
+		const gchar *name = purple_url_decode(
+				nua_handle_remote(nh)->a_display);
 		sdp_media_t *sdp_media;
 		sdp_rtpmap_t *codec_iter;
 		sdp_attribute_t *conn_iter;
@@ -401,7 +404,7 @@ event_callback(nua_event_t event, int st
 			codecs = g_list_append(codecs, codec);
 		}
 		purple_media_set_remote_codecs(media, "yahoo-voice",
-				remote->a_display, codecs);
+				name, codecs);
 		purple_media_codec_list_free(codecs);
 
 		for (; conn_iter; conn_iter = conn_iter->a_next) {
@@ -433,7 +436,7 @@ event_callback(nua_event_t event, int st
 			candidates = g_list_append(candidates, candidate);
 		}
 		purple_media_add_remote_candidates(media, "yahoo-voice",
-				remote->a_display, candidates);		
+				name, candidates);
 		purple_media_codec_list_free(candidates);
 	} else if ((event == nua_i_bye || event == nua_i_cancel)
 			&& status >= 200) {


More information about the Commits mailing list