telepathy-idle: muc-channel: stop implementing {Get,List}Properties

Jonny Lamb jonny at kemper.freedesktop.org
Wed May 16 10:45:09 PDT 2012


Module: telepathy-idle
Branch: master
Commit: 5430aa1495a9efb0e9b9ad030fc7c66655aac064
URL:    http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=5430aa1495a9efb0e9b9ad030fc7c66655aac064

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Mon May 14 16:00:11 2012 +0100

muc-channel: stop implementing {Get,List}Properties

We're porting to RoomConfig now, we don't need this.

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 src/idle-muc-channel.c |  146 ------------------------------------------------
 1 files changed, 0 insertions(+), 146 deletions(-)

diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c
index 2c101a5..abbae29 100644
--- a/src/idle-muc-channel.c
+++ b/src/idle-muc-channel.c
@@ -1689,150 +1689,6 @@ static void idle_muc_channel_get_password_flags (TpSvcChannelInterfacePassword *
 
 
 /**
- * idle_muc_channel_get_properties
- *
- * Implements DBus method GetProperties
- * on interface org.freedesktop.Telepathy.Properties
- *
- * @error: Used to return a pointer to a GError detailing any error
- *         that occured, DBus will throw the error only if this
- *         function returns false.
- *
- * Returns: TRUE if successful, FALSE if an error was thrown.
- */
-static void idle_muc_channel_get_properties (TpSvcPropertiesInterface *iface, const GArray * properties, DBusGMethodInvocation *context) {
-	IdleMUCChannel *obj = IDLE_MUC_CHANNEL(iface);
-	IdleMUCChannelPrivate *priv;
-	GError *error;
-	GPtrArray *ret;
-
-	g_assert(obj != NULL);
-	g_assert(IDLE_IS_MUC_CHANNEL(obj));
-
-	priv = obj->priv;
-
-	for (guint i = 0; i < properties->len; i++) {
-		IdleMUCChannelTPProperty prop = g_array_index(properties, guint, i);
-
-		if (prop >= LAST_TP_PROPERTY_ENUM) {
-			IDLE_DEBUG("invalid property id %u", prop);
-
-			error = g_error_new(TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid property id %u", prop);
-			dbus_g_method_return_error(context, error);
-			g_error_free(error);
-
-			return;
-		}
-
-		if (!(priv->properties[prop].flags & TP_PROPERTY_FLAG_READ)) {
-			IDLE_DEBUG("not allowed to read property %u", prop);
-
-			error = g_error_new(TP_ERROR, TP_ERROR_PERMISSION_DENIED, "not allowed to read property %u", prop);
-			dbus_g_method_return_error(context, error);
-			g_error_free(error);
-
-			return;
-		}
-	}
-
-	ret = g_ptr_array_sized_new(properties->len);
-
-	for (guint i = 0; i < properties->len; i++) {
-		IdleMUCChannelTPProperty prop = g_array_index(properties, guint, i);
-		GValue prop_val = {0, };
-
-		g_value_init(&prop_val, TP_STRUCT_TYPE_PROPERTY_VALUE);
-		g_value_take_boxed(&prop_val,
-				dbus_g_type_specialized_construct(TP_STRUCT_TYPE_PROPERTY_VALUE));
-
-		dbus_g_type_struct_set(&prop_val,
-								0, prop,
-								1, priv->properties[prop].value,
-								G_MAXUINT);
-
-		g_ptr_array_add(ret, g_value_get_boxed(&prop_val));
-	}
-
-	tp_svc_properties_interface_return_from_get_properties(context, ret);
-
-	g_ptr_array_foreach(ret, _free_prop_value_struct, NULL);
-	g_ptr_array_free(ret, TRUE);
-}
-
-/**
- * idle_muc_channel_list_properties
- *
- * Implements DBus method ListProperties
- * on interface org.freedesktop.Telepathy.Properties
- *
- * @error: Used to return a pointer to a GError detailing any error
- *         that occured, DBus will throw the error only if this
- *         function returns false.
- *
- * Returns: TRUE if successful, FALSE if an error was thrown.
- */
-static void idle_muc_channel_list_properties (TpSvcPropertiesInterface *iface, DBusGMethodInvocation *context) {
-	IdleMUCChannel *obj = IDLE_MUC_CHANNEL(iface);
-	IdleMUCChannelPrivate *priv;
-	GError *error;
-	GPtrArray *ret;
-
-	g_assert(obj != NULL);
-	g_assert(IDLE_IS_MUC_CHANNEL(obj));
-
-	priv = obj->priv;
-
-	ret = g_ptr_array_sized_new(LAST_TP_PROPERTY_ENUM);
-
-	for (int i = 0; i < LAST_TP_PROPERTY_ENUM; i++) {
-		GValue prop = {0, };
-		const gchar *dbus_sig;
-
-		switch (property_signatures[i].type) {
-			case G_TYPE_BOOLEAN:
-				dbus_sig = "b";
-				break;
-
-			case G_TYPE_UINT:
-				dbus_sig = "u";
-				break;
-
-			case G_TYPE_STRING:
-				dbus_sig = "s";
-				break;
-
-			default:
-				IDLE_DEBUG("encountered unknown type %s", g_type_name(property_signatures[i].type));
-				error = g_error_new(TP_ERROR, TP_ERROR_NOT_AVAILABLE, "internal error in %s", G_STRFUNC);
-				dbus_g_method_return_error(context, error);
-				g_error_free(error);
-				g_ptr_array_free(ret, TRUE);
-
-				return;
-		}
-
-		g_value_init(&prop, TP_STRUCT_TYPE_PROPERTY_SPEC);
-		g_value_take_boxed(&prop,
-				dbus_g_type_specialized_construct(TP_STRUCT_TYPE_PROPERTY_SPEC));
-
-		dbus_g_type_struct_set(&prop,
-				0, i,
-				1, property_signatures[i].name,
-				2, dbus_sig,
-				3, priv->properties[i].flags,
-				G_MAXUINT);
-
-		g_ptr_array_add(ret, g_value_get_boxed(&prop));
-	}
-
-	tp_svc_properties_interface_return_from_list_properties(context, ret);
-
-	g_ptr_array_foreach(ret, _free_prop_info_struct, NULL);
-	g_ptr_array_free(ret, TRUE);
-}
-
-
-/**
  * idle_muc_channel_provide_password
  *
  * Implements DBus method ProvidePassword
@@ -2241,8 +2097,6 @@ static void _password_iface_init(gpointer g_iface, gpointer iface_data) {
 
 static void _properties_iface_init(gpointer g_iface, gpointer iface_data) {
 #define IMPLEMENT(x) (void) idle_muc_channel_##x
-	IMPLEMENT(get_properties);
-	IMPLEMENT(list_properties);
 	IMPLEMENT(set_properties);
 #undef IMPLEMENT
 }



More information about the telepathy-commits mailing list