From 9694874732bc4543793bdc933c09c1d7b8ada50e Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 6 May 2010 18:21:58 +0200 Subject: [PATCH] Add stubs to TpConnection for setting the self presence and getting the allowed statuses https://bugs.freedesktop.org/show_bug.cgi?id=24107 --- telepathy-glib/connection.c | 48 +++++++++++++++++++++++++++++++++++++++++++ telepathy-glib/connection.h | 13 +++++++++++ 2 files changed, 61 insertions(+), 0 deletions(-) diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index cd4b1a1..6d5f3c4 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -60,6 +60,7 @@ * * connection status tracking * calling GetInterfaces() automatically + * Getting the valid presence statuses automatically * * * Since: 0.7.1 @@ -2273,3 +2274,50 @@ tp_connection_get_detailed_error (TpConnection *self, } } } + +/** + * tp_connection_get_allowed_presence_statuses: + * @self: a connection + * + * Return a dictionary of presence statuses valid for use in this connection. + * + * The value may have changed arbitrarily during the time the Connection + * spends in status TP_CONNECTION_STATUS_CONNECTING, again staying fixed for + * the entire time in TP_CONNECTION_STATUS_CONNECTED. + * + * This method requires TP_CONNECTION_FEATURE_SELF_PRESENCE to be enabled. + * + * Returns: Dictionary from string identifiers to structs for each valid status. + * + * Since: 0.11.5 + */ +GHashTable * +tp_connection_get_allowed_presence_statuses (TpConnection *self) +{ + return NULL; +} + +/** + * tp_connection_set_self_presence: + * @self: a connection + * @status: the desired status, one of the statuses returned by + * tp_connection_get_allowed_presence_statuses() + * @status_message: desired status message + * @callback: called when the operations has finished + * @user_data: user-supplied data + * + * Set the self presence status. + * + * Note that clients SHOULD set the status message for the local user to the + * empty string, unless the user has actually provided a specific message (i.e. + * one that conveys more information than the Status). + * + * Since: 0.11.5 + */ +void +tp_connection_set_self_presence (TpConnection *self, gchar *status, + gchar *status_message, TpConnectionSetSelfPresenceCb callback, + gpointer user_data) +{ + +} diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h index 13737ab..d80e869 100644 --- a/telepathy-glib/connection.h +++ b/telepathy-glib/connection.h @@ -159,6 +159,15 @@ gboolean tp_connection_parse_object_path (TpConnection *self, gchar **protocol, const gchar *tp_connection_get_detailed_error (TpConnection *self, const GHashTable **details); +GHashTable *tp_connection_get_allowed_presence_statuses (TpConnection *self); + +typedef void (*TpConnectionSetSelfPresenceCb) (TpConnection *connection, + const GError *error, gpointer user_data); + +void tp_connection_set_self_presence (TpConnection *self, gchar *status, + gchar *status_message, TpConnectionSetSelfPresenceCb callback, + gpointer user_data); + #define TP_CONNECTION_FEATURE_CORE \ (tp_connection_get_feature_quark_core ()) GQuark tp_connection_get_feature_quark_core (void) G_GNUC_CONST; @@ -175,6 +184,10 @@ GQuark tp_connection_get_feature_quark_capabilities (void) G_GNUC_CONST; (tp_connection_get_feature_quark_avatar_requirements ()) GQuark tp_connection_get_feature_quark_avatar_requirements (void) G_GNUC_CONST; +#define TP_CONNECTION_FEATURE_SELF_PRESENCE \ + (tp_connection_get_feature_quark_self_presence ()) +GQuark tp_connection_get_feature_quark_self_presence (void) G_GNUC_CONST; + /* connection-handles.c */ typedef void (*TpConnectionHoldHandlesCb) (TpConnection *connection, -- 1.6.6.1