[telepathy-glib/master] account: replace _get_{presence, status, status_message} with _get_current_presence
Jonny Lamb
jonny.lamb at collabora.co.uk
Thu Sep 24 09:49:05 PDT 2009
Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
docs/reference/telepathy-glib-sections.txt | 4 +--
telepathy-glib/account-manager.c | 8 ++---
telepathy-glib/account.c | 44 ++++++---------------------
telepathy-glib/account.h | 7 +---
4 files changed, 16 insertions(+), 47 deletions(-)
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index c86eadd..f578ebc 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -3016,9 +3016,7 @@ tp_account_set_connect_automatically_async
tp_account_set_connect_automatically_finish
tp_account_get_has_been_online
tp_account_get_connection_status
-tp_account_get_presence
-tp_account_get_status
-tp_account_get_status_message
+tp_account_get_current_presence
tp_account_get_requested_presence
tp_account_get_requested_status
tp_account_get_requested_status_message
diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c
index 9580f16..9d869b7 100644
--- a/telepathy-glib/account-manager.c
+++ b/telepathy-glib/account-manager.c
@@ -894,7 +894,7 @@ _tp_account_manager_update_global_presence (TpAccountManager *manager)
TpAccount *a = TP_ACCOUNT (value);
TpConnectionPresenceType p;
- p = tp_account_get_presence (a);
+ p = tp_account_get_current_presence (a, NULL, NULL);
if (tp_connection_presence_type_cmp_availability (p, presence) > 0)
{
@@ -915,10 +915,8 @@ _tp_account_manager_update_global_presence (TpAccountManager *manager)
return;
}
- priv->global_presence = tp_account_get_presence (account);
- priv->global_status = g_strdup (tp_account_get_status (account));
- priv->global_status_message = g_strdup (
- tp_account_get_status_message (account));
+ priv->global_presence = tp_account_get_current_presence (account,
+ &(priv->global_status), &(priv->global_status_message));
DEBUG ("Updated global presence to: %s (%d) \"%s\"",
priv->global_status, priv->global_presence, priv->global_status_message);
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index f4c50d0..3a7101f 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -2217,51 +2217,27 @@ tp_account_get_connection_status (TpAccount *account,
}
/**
- * tp_account_get_presence:
+ * tp_account_get_current_presence:
* @account: a #TpAccount
*
- * Gets the type from the CurrentPresence parameter on @account.
+ * Gets the current presence, status and status message of @account.
*
* Returns: the type from the CurrentPresence parameter on @account
*
* Since: 0.7.UNRELEASED
*/
TpConnectionPresenceType
-tp_account_get_presence (TpAccount *account)
+tp_account_get_current_presence (TpAccount *account,
+ gchar **status,
+ gchar **status_message)
{
- return account->priv->presence;
-}
+ if (status != NULL)
+ *status = g_strdup (account->priv->status);
-/**
- * tp_account_get_status:
- * @account: a #TpAccount
- *
- * Gets the status from the CurrentPresence parameter on @account.
- *
- * Returns: the status from the CurrentPresence parameter on @account
- *
- * Since: 0.7.UNRELEASED
- */
-const gchar *
-tp_account_get_status (TpAccount *account)
-{
- return account->priv->status;
-}
+ if (status_message != NULL)
+ *status_message = g_strdup (account->priv->message);
-/**
- * tp_account_get_status_message:
- * @account: a #TpAccount
- *
- * Gets the message from the CurrentPresence parameter on @account.
- *
- * Returns: the message from the CurrentPresence parameter on @account
- *
- * Since: 0.7.UNRELEASED
- */
-const gchar *
-tp_account_get_status_message (TpAccount *account)
-{
- return account->priv->message;
+ return account->priv->presence;
}
/**
diff --git a/telepathy-glib/account.h b/telepathy-glib/account.h
index a365607..e336bf8 100644
--- a/telepathy-glib/account.h
+++ b/telepathy-glib/account.h
@@ -156,11 +156,8 @@ gboolean tp_account_get_has_been_online (TpAccount *account);
TpConnectionStatus tp_account_get_connection_status (TpAccount *account,
TpConnectionStatusReason *reason);
-TpConnectionPresenceType tp_account_get_presence (TpAccount *account);
-
-const gchar *tp_account_get_status (TpAccount *account);
-
-const gchar *tp_account_get_status_message (TpAccount *account);
+TpConnectionPresenceType tp_account_get_current_presence (TpAccount *account,
+ gchar **status, gchar **status_message);
TpConnectionPresenceType tp_account_get_requested_presence (
TpAccount *account);
--
1.5.6.5
More information about the telepathy-commits
mailing list