changeset 26324:065d865e7dd1

Use stream-info for reject instead of state-changed.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 21 Mar 2009 01:11:48 +0000
parents 51b986bbe260
children 31236ac583ef
files pidgin/gtkmedia.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmedia.c	Sat Mar 21 01:03:49 2009 +0000
+++ b/pidgin/gtkmedia.c	Sat Mar 21 01:11:48 2009 +0000
@@ -671,10 +671,6 @@
 			pidgin_media_emit_message(gtkmedia,
 					_("The call has been terminated."));
 			gtk_widget_destroy(GTK_WIDGET(gtkmedia));
-			
-		} else if (type == PURPLE_MEDIA_STATE_CHANGED_REJECTED) {
-			pidgin_media_emit_message(gtkmedia,
-					_("You have rejected the call."));
 		}
 	} else if (type == PURPLE_MEDIA_STATE_CHANGED_NEW &&
 			sid != NULL && name != NULL) {
@@ -690,6 +686,16 @@
 }
 
 static void
+pidgin_media_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
+		gchar *sid, gchar *name, PidginMedia *gtkmedia)
+{
+	if (type == PURPLE_MEDIA_INFO_REJECT) {
+		pidgin_media_emit_message(gtkmedia,
+				_("You have rejected the call."));
+	}
+}
+
+static void
 pidgin_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
 	PidginMedia *media;
@@ -718,6 +724,8 @@
 				G_CALLBACK(pidgin_media_accepted_cb), media);
 			g_signal_connect(G_OBJECT(media->priv->media), "state-changed",
 				G_CALLBACK(pidgin_media_state_changed_cb), media);
+			g_signal_connect(G_OBJECT(media->priv->media), "stream-info",
+				G_CALLBACK(pidgin_media_stream_info_cb), media);
 			break;
 		}
 		case PROP_SCREENNAME: