summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-09 18:32:34 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-10 13:26:22 +0100
commit13b476434ad64ab703e5d78f96f66186d7699bb3 (patch)
tree00a3636976af5d66c65bf4ce8d4364011914cde5
parent5a3524270c6d1febeccfbf636fc59b2da48f33b6 (diff)
tp_group_mixin_get_members etc.: remove accessors for members
tp_group_mixin_get_local_pending_members_with_info() uses a dbus-glib data type, and none of these are actually used in the five core CMs (they all track members separately in any case). Make them private if used in the implementation, or remove them entirely. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77190 Reviewed-by: Xavier Claessens
-rw-r--r--docs/reference/telepathy-glib/telepathy-glib-sections.txt6
-rw-r--r--telepathy-glib/group-mixin.c127
-rw-r--r--telepathy-glib/group-mixin.h15
-rw-r--r--telepathy-glib/versions/main-1.0.abi6
4 files changed, 7 insertions, 147 deletions
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index 38956d8dd..ed33c3e86 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -1787,12 +1787,6 @@ tp_group_mixin_get_self_handle
tp_group_mixin_get_group_flags
tp_group_mixin_add_members
tp_group_mixin_remove_members
-tp_group_mixin_get_members
-tp_group_mixin_get_local_pending_members
-tp_group_mixin_get_local_pending_members_with_info
-tp_group_mixin_get_remote_pending_members
-tp_group_mixin_get_all_members
-tp_group_mixin_get_handle_owners
tp_group_mixin_change_flags
tp_group_mixin_change_members
tp_group_mixin_add_handle_owner
diff --git a/telepathy-glib/group-mixin.c b/telepathy-glib/group-mixin.c
index 12f81ebfe..8c5308a61 100644
--- a/telepathy-glib/group-mixin.c
+++ b/telepathy-glib/group-mixin.c
@@ -77,6 +77,13 @@
#include "debug-internal.h"
+static gboolean tp_group_mixin_get_members (GObject *obj,
+ GArray **ret, GError **error);
+static gboolean tp_group_mixin_get_local_pending_members_with_info (
+ GObject *obj, GPtrArray **ret, GError **error);
+static gboolean tp_group_mixin_get_remote_pending_members (GObject *obj,
+ GArray **ret, GError **error);
+
static const char *
group_change_reason_str (guint reason)
{
@@ -733,28 +740,6 @@ tp_group_mixin_get_members (GObject *obj,
return TRUE;
}
-/**
- * tp_group_mixin_get_local_pending_members: (skip)
- * @obj: An object implementing the group interface using this mixin
- * @ret: Used to return a newly-allocated GArray of guint contact handles
- * @error: Unused
- *
- * Get the group's local-pending members.
- *
- * Returns: %TRUE
- */
-gboolean
-tp_group_mixin_get_local_pending_members (GObject *obj,
- GArray **ret,
- GError **error)
-{
- TpGroupMixin *mixin = TP_GROUP_MIXIN (obj);
-
- *ret = tp_handle_set_to_array (mixin->local_pending);
-
- return TRUE;
-}
-
typedef struct {
TpGroupMixin *mixin;
GPtrArray *array;
@@ -841,104 +826,6 @@ tp_group_mixin_get_remote_pending_members (GObject *obj,
return TRUE;
}
-/**
- * tp_group_mixin_get_all_members: (skip)
- * @obj: An object implementing the group interface using this mixin
- * @members: Used to return a newly-allocated GArray of guint representing
- * the handles of the group's members
- * @local_pending: Used to return a newly-allocated GArray of guint
- * representing the handles of the group's local pending members
- * @remote_pending: Used to return a newly-allocated GArray of guint
- * representing the handles of the group's remote pending members
- * @error: Unused
- *
- * Get the group's current and pending members.
- *
- * Returns: %TRUE
- */
-gboolean
-tp_group_mixin_get_all_members (GObject *obj,
- GArray **members,
- GArray **local_pending,
- GArray **remote_pending,
- GError **error)
-{
- TpGroupMixin *mixin = TP_GROUP_MIXIN (obj);
-
- *members = tp_handle_set_to_array (mixin->members);
- *local_pending = tp_handle_set_to_array (mixin->local_pending);
- *remote_pending = tp_handle_set_to_array (mixin->remote_pending);
-
- return TRUE;
-}
-
-/**
- * tp_group_mixin_get_handle_owners: (skip)
- * @obj: An object implementing the group interface with this mixin
- * @handles: An array of guint representing locally valid handles
- * @ret: Used to return an array of guint representing globally valid
- * handles, or 0 where unavailable, if %TRUE is returned
- * @error: Used to return an error if %FALSE is returned
- *
- * If the mixin has the flag %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES,
- * return the global owners of the given local handles, or 0 where
- * unavailable.
- *
- * Returns: %TRUE (setting @ret) on success, %FALSE (setting @error) on
- * failure
- */
-gboolean
-tp_group_mixin_get_handle_owners (GObject *obj,
- const GArray *handles,
- GArray **ret,
- GError **error)
-{
- TpGroupMixin *mixin = TP_GROUP_MIXIN (obj);
- TpGroupMixinPrivate *priv = mixin->priv;
- guint i;
-
- if ((mixin->group_flags &
- TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) == 0)
- {
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
- "channel doesn't have channel specific handles");
-
- return FALSE;
- }
-
- if (!tp_handles_are_valid (mixin->handle_repo, handles, FALSE, error))
- {
- return FALSE;
- }
-
- *ret = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), handles->len);
-
- for (i = 0; i < handles->len; i++)
- {
- TpHandle local_handle = g_array_index (handles, TpHandle, i);
- TpHandle owner_handle;
-
- if (!tp_handle_set_is_member (mixin->members, local_handle))
- {
- g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
- "handle %u is not a member", local_handle);
-
- g_array_unref (*ret);
- *ret = NULL;
-
- return FALSE;
- }
-
- owner_handle = GPOINTER_TO_UINT (
- g_hash_table_lookup (priv->handle_owners,
- GUINT_TO_POINTER (local_handle)));
-
- g_array_append_val (*ret, owner_handle);
- }
-
- return TRUE;
-}
-
#define GFTS_APPEND_FLAG_IF_SET(flag) \
if (flags & flag) \
{ \
diff --git a/telepathy-glib/group-mixin.h b/telepathy-glib/group-mixin.h
index 1f2d7cb3d..677335ea0 100644
--- a/telepathy-glib/group-mixin.h
+++ b/telepathy-glib/group-mixin.h
@@ -187,21 +187,6 @@ gboolean tp_group_mixin_remove_members (GObject *obj,
const GArray *contacts, const gchar *message, guint reason,
GError **error);
-gboolean tp_group_mixin_get_members (GObject *obj,
- GArray **ret, GError **error);
-gboolean tp_group_mixin_get_local_pending_members (GObject *obj,
- GArray **ret, GError **error);
-gboolean tp_group_mixin_get_local_pending_members_with_info (GObject *obj,
- GPtrArray **ret, GError **error);
-gboolean tp_group_mixin_get_remote_pending_members (GObject *obj,
- GArray **ret, GError **error);
-gboolean tp_group_mixin_get_all_members (GObject *obj,
- GArray **members, GArray **local_pending, GArray **remote_pending,
- GError **error);
-
-gboolean tp_group_mixin_get_handle_owners (GObject *obj,
- const GArray *handles, GArray **ret, GError **error);
-
void tp_group_mixin_change_flags (GObject *obj,
TpChannelGroupFlags add, TpChannelGroupFlags del);
gboolean tp_group_mixin_change_members (GObject *obj,
diff --git a/telepathy-glib/versions/main-1.0.abi b/telepathy-glib/versions/main-1.0.abi
index b8ff454e7..f404e2d71 100644
--- a/telepathy-glib/versions/main-1.0.abi
+++ b/telepathy-glib/versions/main-1.0.abi
@@ -866,15 +866,9 @@ tp_group_mixin_class_get_offset_quark
tp_group_mixin_class_init
tp_group_mixin_class_set_remove_with_reason_func
tp_group_mixin_finalize
-tp_group_mixin_get_all_members
tp_group_mixin_get_dbus_property
tp_group_mixin_get_group_flags
-tp_group_mixin_get_handle_owners
-tp_group_mixin_get_local_pending_members
-tp_group_mixin_get_local_pending_members_with_info
-tp_group_mixin_get_members
tp_group_mixin_get_offset_quark
-tp_group_mixin_get_remote_pending_members
tp_group_mixin_get_self_handle
tp_group_mixin_iface_init
tp_group_mixin_init