[next] telepathy-glib: Deprecate tp_connection_hold_handles()
Xavier Claessens
xclaesse at kemper.freedesktop.org
Thu May 10 08:07:49 PDT 2012
Module: telepathy-glib
Branch: next
Commit: 9e6ee0fc8a5f5e07aa006cfc832a469735484849
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=9e6ee0fc8a5f5e07aa006cfc832a469735484849
Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date: Thu May 10 13:50:57 2012 +0200
Deprecate tp_connection_hold_handles()
Holding handles is not needed with Connection Managers having
immortal handles (any Connection Manager using telepathy-glib >= 0.13.8).
Other Connection Managers are considered deprecated, clients wanting to
still support them should continue using this deprecated function.
---
telepathy-glib/connection-handles.c | 7 +++++++
telepathy-glib/connection.h | 3 ++-
telepathy-glib/contact.c | 4 ++++
3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c
index f264ef0..8fadb9a 100644
--- a/telepathy-glib/connection-handles.c
+++ b/telepathy-glib/connection-handles.c
@@ -99,6 +99,8 @@ hold_handles_context_free (gpointer p)
* For convenience, the handle type and handles requested by the caller are
* passed through to this callback on success, so the caller does not have to
* include them in @user_data.
+ *
+ * Deprecated: See tp_connection_hold_handles().
*/
static void
@@ -161,6 +163,11 @@ connection_held_handles (TpConnection *self,
* reference count of handles; you should not use the RequestHandles,
* HoldHandles and GetContactAttributes D-Bus methods directly as well as these
* functions.
+ *
+ * Deprecated: Holding handles is not needed with Connection Managers having
+ * immortal handles (any Connection Manager using telepathy-glib >= 0.13.8).
+ * Other Connection Managers are considered deprecated, clients wanting to
+ * still support them should continue using this deprecated function.
*/
void
tp_connection_hold_handles (TpConnection *self,
diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h
index 4f7cea3..04506c0 100644
--- a/telepathy-glib/connection.h
+++ b/telepathy-glib/connection.h
@@ -231,16 +231,17 @@ GQuark tp_connection_get_feature_quark_contact_info (void) G_GNUC_CONST;
/* connection-handles.c */
+#ifndef TP_DISABLE_DEPRECATED
typedef void (*TpConnectionHoldHandlesCb) (TpConnection *connection,
TpHandleType handle_type, guint n_handles, const TpHandle *handles,
const GError *error, gpointer user_data, GObject *weak_object);
+_TP_DEPRECATED_IN_UNRELEASED
void tp_connection_hold_handles (TpConnection *self, gint timeout_ms,
TpHandleType handle_type, guint n_handles, const TpHandle *handles,
TpConnectionHoldHandlesCb callback,
gpointer user_data, GDestroyNotify destroy, GObject *weak_object);
-#ifndef TP_DISABLE_DEPRECATED
typedef void (*TpConnectionRequestHandlesCb) (TpConnection *connection,
TpHandleType handle_type,
guint n_handles, const TpHandle *handles, const gchar * const *ids,
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 469543b..f86170b 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -1969,11 +1969,13 @@ contacts_held_one (TpConnection *connection,
static void
contacts_hold_one (ContactsContext *c)
{
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
c->refcount++;
tp_connection_hold_handles (c->connection, -1,
TP_HANDLE_TYPE_CONTACT, 1,
&g_array_index (c->handles, TpHandle, c->next_index),
contacts_held_one, c, contacts_context_unref, c->weak_object);
+ G_GNUC_END_IGNORE_DEPRECATIONS
}
@@ -4245,10 +4247,12 @@ tp_connection_get_contacts_by_handle (TpConnection *self,
/* After that we'll get the features */
contacts_context_queue_features (context);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* but first, we need to hold onto them */
tp_connection_hold_handles (self, -1,
TP_HANDLE_TYPE_CONTACT, n_handles, handles,
contacts_held_handles, context, contacts_context_unref, weak_object);
+ G_GNUC_END_IGNORE_DEPRECATIONS
}
More information about the telepathy-commits
mailing list