pidgin.vv: 1861747e: Add a prpl-data property to PurpleMedia.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Wed Feb 25 00:25:22 EST 2009


-----------------------------------------------------------------
Revision: 1861747ecccdbea47628d876a4faf6ca727065cb
Ancestor: 2c1ae01ec290ce8bbd6b336a4ba6acde8c3e3790
Author: maiku at soc.pidgin.im
Date: 2009-02-25T02:40:10
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/1861747ecccdbea47628d876a4faf6ca727065cb

Modified files:
        libpurple/media.c libpurple/media.h

ChangeLog: 

Add a prpl-data property to PurpleMedia.

-------------- next part --------------
============================================================
--- libpurple/media.c	73d3dd7c631f1261754acd989c8b27c71e5cfa5a
+++ libpurple/media.c	dba3f3bc36e66efd57aae811163b52ff64692f2d
@@ -90,6 +90,7 @@ struct _PurpleMediaPrivate
 	PurpleConnection *pc;
 	FsConference *conference;
 	gboolean initiator;
+	gpointer prpl_data;
 
 	GHashTable *sessions;	/* PurpleMediaSession table */
 	GHashTable *participants; /* FsParticipant table */
@@ -139,6 +140,7 @@ enum {
 	PROP_CONNECTION,
 	PROP_CONFERENCE,
 	PROP_INITIATOR,
+	PROP_PRPL_DATA,
 };
 
 GType
@@ -218,6 +220,12 @@ purple_media_class_init (PurpleMediaClas
 			FALSE,
 			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
+	g_object_class_install_property(gobject_class, PROP_PRPL_DATA,
+			g_param_spec_pointer("prpl-data",
+			"gpointer",
+			"Data the prpl plugin set on the media session.",
+			G_PARAM_READWRITE));
+
 	purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
@@ -430,6 +438,9 @@ purple_media_set_property (GObject *obje
 		case PROP_INITIATOR:
 			media->priv->initiator = g_value_get_boolean(value);
 			break;
+		case PROP_PRPL_DATA:
+			media->priv->prpl_data = g_value_get_pointer(value);
+			break;
 		default:	
 			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 			break;
@@ -457,6 +468,9 @@ purple_media_get_property (GObject *obje
 		case PROP_INITIATOR:
 			g_value_set_boolean(value, media->priv->initiator);
 			break;
+		case PROP_PRPL_DATA:
+			g_value_set_pointer(value, media->priv->prpl_data);
+			break;
 		default:	
 			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);	
 			break;
@@ -1383,7 +1397,23 @@ purple_media_get_connection(PurpleMedia 
 	return pc;
 }
 
+gpointer
+purple_media_get_prpl_data(PurpleMedia *media)
+{
+	gpointer prpl_data;
+	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
+	g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL);
+	return prpl_data;
+}
+
 void
+purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data)
+{
+	g_return_if_fail(PURPLE_IS_MEDIA(media));
+	g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL);
+}
+
+void
 purple_media_error(PurpleMedia *media, const gchar *error, ...)
 {
 	va_list args;
============================================================
--- libpurple/media.h	69e24f1fc03a3f12b1a6791c763b91617feacfe8
+++ libpurple/media.h	c8d8dbfa84c99d191edf30bf14663898ae0a3bbf
@@ -392,6 +392,23 @@ PurpleConnection *purple_media_get_conne
 PurpleConnection *purple_media_get_connection(PurpleMedia *media);
 
 /**
+ * Gets the prpl data from the media session.
+ *
+ * @param media The media session to retrieve the prpl data from.
+ *
+ * @return The prpl data retrieved.
+ */
+gpointer purple_media_get_prpl_data(PurpleMedia *media);
+
+/**
+ * Sets the prpl data on the media session.
+ *
+ * @param media The media session to set the prpl data on.
+ * @param prpl_data The data to set on the media session.
+ */
+void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data);
+
+/**
  * Signals an error in the media session.
  *
  * @param media The media object to set the state on.


More information about the Commits mailing list