changeset 29608:7c87e62790a6

Add a read only property to PurpleMedia to retrieve the MediaBackend object.
author maiku@pidgin.im
date Mon, 02 Nov 2009 20:20:21 +0000
parents 85a7a93cd19a
children 1eb68d854dfc
files libpurple/media/media.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media/media.c	Thu Oct 29 23:56:50 2009 +0000
+++ b/libpurple/media/media.c	Mon Nov 02 20:20:21 2009 +0000
@@ -149,6 +149,7 @@
 enum {
 	PROP_0,
 	PROP_MANAGER,
+	PROP_BACKEND,
 	PROP_ACCOUNT,
 	PROP_CONFERENCE_TYPE,
 	PROP_INITIATOR,
@@ -203,6 +204,17 @@
 			PURPLE_TYPE_MEDIA_MANAGER,
 			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
+	/*
+	 * This one should be PURPLE_TYPE_MEDIA_BACKEND, but it doesn't
+	 * like interfaces because they "aren't GObjects"
+	 */
+	g_object_class_install_property(gobject_class, PROP_BACKEND,
+			g_param_spec_object("backend",
+			"Purple Media Backend",
+			"The backend object this media object uses.",
+			G_TYPE_OBJECT,
+			G_PARAM_READABLE));
+
 	g_object_class_install_property(gobject_class, PROP_ACCOUNT,
 			g_param_spec_pointer("account",
 			"PurpleAccount",
@@ -423,6 +435,9 @@
 		case PROP_MANAGER:
 			g_value_set_object(value, media->priv->manager);
 			break;
+		case PROP_BACKEND:
+			g_value_set_object(value, media->priv->backend);
+			break;
 		case PROP_ACCOUNT:
 			g_value_set_pointer(value, media->priv->account);
 			break;