changeset 25634:741a702033e0

Show a message when the remote end terminates a session.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 15 Mar 2008 07:37:03 +0000
parents c96b34b58b85
children efaecb71baad
files pidgin/gtkmedia.c pidgin/gtkmedia.h
diffstat 2 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmedia.c	Fri Feb 08 20:18:49 2008 +0000
+++ b/pidgin/gtkmedia.c	Sat Mar 15 07:37:03 2008 +0000
@@ -74,7 +74,7 @@
 };
 
 GType
-pidgin_media_get_type()
+pidgin_media_get_type(void)
 {
 	static GType type = 0;
 
@@ -172,7 +172,7 @@
 {
 	g_signal_emit(gtkmedia, pidgin_media_signals[MESSAGE], 0, msg);
 }
-        
+
 static gboolean
 level_message_cb(GstBus *bus, GstMessage *message, PidginMedia *gtkmedia)
 {
@@ -184,8 +184,8 @@
 	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
+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 @@
 {
 	PidginMedia *media;
 	g_return_if_fail(PIDGIN_IS_MEDIA(object));
-	
+
 	media = PIDGIN_MEDIA(object);
 	switch (prop_id) {
 		case PROP_MEDIA:
@@ -270,6 +277,8 @@
 				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)
--- a/pidgin/gtkmedia.h	Fri Feb 08 20:18:49 2008 +0000
+++ b/pidgin/gtkmedia.h	Sat Mar 15 07:37:03 2008 +0000
@@ -62,7 +62,7 @@
 	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);