changeset 26402:8b4394e84633

Add stream-info signal.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 21 Mar 2009 00:27:22 +0000
parents 7909c74618fc
children 2c9fb8ac325b
files libpurple/media.c libpurple/media.h
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Fri Mar 20 08:10:26 2009 +0000
+++ b/libpurple/media.c	Sat Mar 21 00:27:22 2009 +0000
@@ -128,6 +128,7 @@
 	CODECS_CHANGED,
 	NEW_CANDIDATE,
 	STATE_CHANGED,
+	STREAM_INFO,
 	LAST_SIGNAL
 };
 static guint purple_media_signals[LAST_SIGNAL] = {0};
@@ -251,6 +252,11 @@
 					 purple_smarshal_VOID__ENUM_STRING_STRING,
 					 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE_CHANGED,
 					 G_TYPE_STRING, G_TYPE_STRING);
+	purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass),
+					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+					 purple_smarshal_VOID__ENUM_STRING_STRING,
+					 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE_CHANGED,
+					 G_TYPE_STRING, G_TYPE_STRING);
 	g_type_class_add_private(klass, sizeof(PurpleMediaPrivate));
 }
 
@@ -1403,6 +1409,9 @@
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_HANGUP,
 			NULL, NULL);
+	g_signal_emit(media, purple_media_signals[STREAM_INFO],
+			0, PURPLE_MEDIA_INFO_HANGUP,
+			NULL, NULL);
 	purple_media_end(media, NULL, NULL);
 }
 
@@ -1413,6 +1422,9 @@
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_REJECTED,
 			NULL, NULL);
+	g_signal_emit(media, purple_media_signals[STREAM_INFO],
+			0, PURPLE_MEDIA_INFO_REJECT,
+			NULL, NULL);
 	purple_media_end(media, NULL, NULL);
 }
 
--- a/libpurple/media.h	Fri Mar 20 08:10:26 2009 +0000
+++ b/libpurple/media.h	Sat Mar 21 00:27:22 2009 +0000
@@ -97,6 +97,14 @@
 	PURPLE_MEDIA_STATE_CHANGED_END,
 } PurpleMediaStateChangedType;
 
+/** Media info types */
+typedef enum {
+	PURPLE_MEDIA_INFO_HANGUP = 0,
+	PURPLE_MEDIA_INFO_REJECT,
+	PURPLE_MEDIA_INFO_MUTE,
+	PURPLE_MEDIA_INFO_HOLD,
+} PurpleMediaInfoType;
+
 typedef enum {
 	PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
 	PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,