pidgin.vv: 3ed39e87: Show a message when the remote end termi...

sadrul at pidgin.im sadrul at pidgin.im
Sat Mar 15 03:37:58 EDT 2008


-----------------------------------------------------------------
Revision: 3ed39e8792f4a2e92ef5a3c7f4fb14251c9dae11
Ancestor: b3d7acc18ee83cbe110e729c61fe0e15e3d9ac9e
Author: sadrul at pidgin.im
Date: 2008-03-15T07:37:03
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/3ed39e8792f4a2e92ef5a3c7f4fb14251c9dae11

Modified files:
        pidgin/gtkmedia.c pidgin/gtkmedia.h

ChangeLog: 

Show a message when the remote end terminates a session.

-------------- next part --------------
============================================================
--- pidgin/gtkmedia.c	140b19f4132115121f428058e48f417bdfda2fea
+++ pidgin/gtkmedia.c	8eafb4d22e4ef00e77e7f4959734e37910d1129d
@@ -74,7 +74,7 @@ GType
 };
 
 GType
-pidgin_media_get_type()
+pidgin_media_get_type(void)
 {
 	static GType type = 0;
 
@@ -172,7 +172,7 @@ pidgin_media_emit_message(PidginMedia *g
 {
 	g_signal_emit(gtkmedia, pidgin_media_signals[MESSAGE], 0, msg);
 }
-        
+
 static gboolean
 level_message_cb(GstBus *bus, GstMessage *message, PidginMedia *gtkmedia)
 {
@@ -184,9 +184,9 @@ level_message_cb(GstBus *bus, GstMessage
 	gdouble rms;
 	const GValue *list;
 	const GValue *value;
-		
-	GstElement *src = GST_MESSAGE_SRC(message);
 
+	GstElement *src = GST_ELEMENT(message);
+
 	if (message->type != GST_MESSAGE_ELEMENT)
 		return TRUE;
 
@@ -236,6 +236,13 @@ static void
 }
 
 static void
+pidgin_media_got_hangup_cb(PurpleMedia *media, PidginMedia *gtkmedia)
+{
+	pidgin_media_emit_message(gtkmedia, _("The call has been terminated."));
+	gtk_widget_destroy(GTK_WIDGET(gtkmedia));
+}
+
+static void
 pidgin_media_reject_cb(PurpleMedia *media, PidginMedia *gtkmedia)
 {
 	pidgin_media_emit_message(gtkmedia, _("You have rejected the call."));
@@ -247,7 +254,7 @@ pidgin_media_set_property (GObject *obje
 {
 	PidginMedia *media;
 	g_return_if_fail(PIDGIN_IS_MEDIA(object));
-	
+
 	media = PIDGIN_MEDIA(object);
 	switch (prop_id) {
 		case PROP_MEDIA:
@@ -270,6 +277,8 @@ pidgin_media_set_property (GObject *obje
 				G_CALLBACK(pidgin_media_hangup_cb), media);
 			g_signal_connect(G_OBJECT(media->priv->media), "reject",
 				G_CALLBACK(pidgin_media_reject_cb), media);
+			g_signal_connect(G_OBJECT(media->priv->media), "got-hangup",
+				G_CALLBACK(pidgin_media_got_hangup_cb), media);
 			break;
 		case PROP_SEND_LEVEL:
 			if (media->priv->send_level)
============================================================
--- pidgin/gtkmedia.h	e7d0ade2ce38d82bd4371cd209fc542708fcf3dc
+++ pidgin/gtkmedia.h	24dd2de18b5da816f5423b8326b9391c8be7f352
@@ -62,7 +62,7 @@ struct _PidginMedia
 	PidginMediaPrivate *priv;
 };
 
-GType pidgin_media_get_type();
+GType pidgin_media_get_type(void);
 
 GtkWidget *pidgin_media_new(PurpleMedia *media, GstElement *send_level, GstElement *recv_level);
 


More information about the Commits mailing list