pidgin.vv: a38c44e8: Replace the got-request signal in Pidgin...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Tue Jan 13 06:35:55 EST 2009


-----------------------------------------------------------------
Revision: a38c44e88ee54fa639c5d924a5100699df189a26
Ancestor: 4dbef5200fa1106b8cc1926e91928aa7becef507
Author: maiku at soc.pidgin.im
Date: 2009-01-13T11:22:19
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a38c44e88ee54fa639c5d924a5100699df189a26

Modified files:
        pidgin/gtkmedia.c

ChangeLog: 

Replace the got-request signal in PidginMedia.

-------------- next part --------------
============================================================
--- pidgin/gtkmedia.c	dd163b9397a60d79933a3dac84094a06910aba03
+++ pidgin/gtkmedia.c	b08181c19e76495f954d3d0bfeea1f63359080ea
@@ -400,6 +400,7 @@ pidgin_media_ready_cb(PurpleMedia *media
 	gboolean audiorecvbool = FALSE;
 	gboolean videorecvbool = FALSE;
 	GstBus *bus;
+	gboolean is_initiator;
 
 	PurpleMediaSessionType type = purple_media_get_session_type(media, sid);
 	if (type & PURPLE_MEDIA_AUDIO) {
@@ -542,29 +543,24 @@ pidgin_media_ready_cb(PurpleMedia *media
 		gtkmedia->priv->send_widget = send_widget;
 	if (recv_widget != NULL)
 		gtkmedia->priv->recv_widget = recv_widget;
-}
 
-static void
-pidgin_media_got_request_cb(PurpleMedia *media, PidginMedia *gtkmedia)
-{
-	PurpleMediaSessionType type = purple_media_get_overall_type(media);
-	gchar *message;
+	g_object_get(G_OBJECT(media), "initiator", &is_initiator, NULL);
 
-	if (type & PURPLE_MEDIA_AUDIO && type & PURPLE_MEDIA_VIDEO) {
-		message = g_strdup_printf(_("%s wishes to start an audio/video session with you."),
-					  gtkmedia->priv->screenname);
-	} else if (type & PURPLE_MEDIA_AUDIO) {
-		message = g_strdup_printf(_("%s wishes to start an audio session with you."),
-					  gtkmedia->priv->screenname);
-	} else if (type & PURPLE_MEDIA_VIDEO) {
-		message = g_strdup_printf(_("%s wishes to start a video session with you."),
-					  gtkmedia->priv->screenname);
-	} else {
-		return;
+	if (is_initiator == FALSE) {
+		gchar *message;
+		if (type & PURPLE_MEDIA_AUDIO && type & PURPLE_MEDIA_VIDEO) {
+			message = g_strdup_printf(_("%s wishes to start an audio/video session with you."),
+						  gtkmedia->priv->screenname);
+		} else if (type & PURPLE_MEDIA_AUDIO) {
+			message = g_strdup_printf(_("%s wishes to start an audio session with you."),
+						  gtkmedia->priv->screenname);
+		} else if (type & PURPLE_MEDIA_VIDEO) {
+			message = g_strdup_printf(_("%s wishes to start a video session with you."),
+						  gtkmedia->priv->screenname);
+		}
+		pidgin_media_emit_message(gtkmedia, message);
+		g_free(message);
 	}
-
-	pidgin_media_emit_message(gtkmedia, message);
-	g_free(message);
 }
 
 static void
@@ -634,8 +630,6 @@ pidgin_media_set_property (GObject *obje
 
 			g_signal_connect(G_OBJECT(media->priv->media), "error",
 				G_CALLBACK(pidgin_media_error_cb), media);
-			g_signal_connect(G_OBJECT(media->priv->media), "got-request",
-				G_CALLBACK(pidgin_media_got_request_cb), media);
 			g_signal_connect(G_OBJECT(media->priv->media), "state-changed",
 				G_CALLBACK(pidgin_media_state_changed_cb), media);
 			break;


More information about the Commits mailing list