changeset 26327:db9d2a760329

Use the right enum for the stream-info signal.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 21 Mar 2009 03:09:10 +0000
parents 8c21dbe149d8
children 144802b7ed77
files libpurple/media.c libpurple/media.h
diffstat 2 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Sat Mar 21 02:25:09 2009 +0000
+++ b/libpurple/media.c	Sat Mar 21 03:09:10 2009 +0000
@@ -181,6 +181,27 @@
 	return type;
 }
 
+GType
+purple_media_info_type_get_type()
+{
+	static GType type = 0;
+	if (type == 0) {
+		static const GEnumValue values[] = {
+			{ PURPLE_MEDIA_INFO_HANGUP,
+					"PURPLE_MEDIA_INFO_HANGUP", "hangup" },
+			{ PURPLE_MEDIA_INFO_REJECT,
+					"PURPLE_MEDIA_INFO_REJECT", "reject" },
+			{ PURPLE_MEDIA_INFO_MUTE,
+					"PURPLE_MEDIA_INFO_MUTE", "mute" },
+			{ PURPLE_MEDIA_INFO_HOLD,
+					"PURPLE_MEDIA_INFO_HOLD", "hold" },
+			{ 0, NULL, NULL }
+		};
+		type = g_enum_register_static("PurpleMediaInfoType", values);
+	}
+	return type;
+}
+
 static void
 purple_media_class_init (PurpleMediaClass *klass)
 {
@@ -255,7 +276,7 @@
 	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_NONE, 3, PURPLE_MEDIA_TYPE_INFO_TYPE,
 					 G_TYPE_STRING, G_TYPE_STRING);
 	g_type_class_add_private(klass, sizeof(PurpleMediaPrivate));
 }
--- a/libpurple/media.h	Sat Mar 21 02:25:09 2009 +0000
+++ b/libpurple/media.h	Sat Mar 21 03:09:10 2009 +0000
@@ -45,6 +45,7 @@
 #define PURPLE_MEDIA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
 
 #define PURPLE_MEDIA_TYPE_STATE_CHANGED	(purple_media_state_changed_get_type())
+#define PURPLE_MEDIA_TYPE_INFO_TYPE	(purple_media_info_type_get_type())
 
 /** @copydoc _PurpleMedia */
 typedef struct _PurpleMedia PurpleMedia;