[telepathy-glib/master] account: merge _get_requested_{presence, status, status_message} into one

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Sep 25 05:12:17 PDT 2009


Same idea as merging _get_current_{presence,status,status_message}.

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
 docs/reference/telepathy-glib-sections.txt |    2 -
 telepathy-glib/account.c                   |   47 ++++++++-------------------
 telepathy-glib/account.h                   |    6 +---
 3 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index f578ebc..a4e0fac 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -3018,8 +3018,6 @@ tp_account_get_has_been_online
 tp_account_get_connection_status
 tp_account_get_current_presence
 tp_account_get_requested_presence
-tp_account_get_requested_status
-tp_account_get_requested_status_message
 tp_account_get_parameters
 tp_account_get_nickname
 tp_account_set_nickname_async
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index 0bd7e69..f024c1c 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -2161,6 +2161,8 @@ tp_account_get_connection_status (TpAccount *account,
 /**
  * tp_account_get_current_presence:
  * @account: a #TpAccount
+ * @status: return location for the current status
+ * @status_message: return location for the current status message
  *
  * Gets the current presence, status and status message of @account.
  *
@@ -2185,49 +2187,28 @@ tp_account_get_current_presence (TpAccount *account,
 /**
  * tp_account_get_requested_presence:
  * @account: a #TpAccount
+ * @status: return location for the requested status
+ * @status_message: return location for the requested status message
  *
- * Gets the presence from the RequestedPresence parameter on @account.
+ * Gets the requested presence, requested status and requested status message
+ * from @account.
  *
  * Returns: the presence from the RequestedPresence parameter on @account
  *
  * Since: 0.7.UNRELEASED
  */
 TpConnectionPresenceType
-tp_account_get_requested_presence (TpAccount *account)
+tp_account_get_requested_presence (TpAccount *account,
+    gchar **status,
+    gchar **status_message)
 {
-  return account->priv->requested_presence;
-}
+  if (status != NULL)
+    *status = g_strdup (account->priv->requested_status);
 
-/**
- * tp_account_get_requested_status:
- * @account: a #TpAccount
- *
- * Gets the status from the RequestedPresence parameter on @account.
- *
- * Returns: the status from the RequestedPresence parameter on @account
- *
- * Since: 0.7.UNRELEASED
- */
-const gchar *
-tp_account_get_requested_status (TpAccount *account)
-{
-  return account->priv->requested_status;
-}
+  if (status_message != NULL)
+    *status_message = g_strdup (account->priv->requested_message);
 
-/**
- * tp_account_get_requested_status_message:
- * @account: a #TpAccount
- *
- * Gets the message from the RequestedPresence parameter on @account.
- *
- * Returns: the message from the RequestedPresence parameter on @account
- *
- * Since: 0.7.UNRELEASED
- */
-const gchar *
-tp_account_get_requested_status_message (TpAccount *account)
-{
-  return account->priv->requested_message;
+  return account->priv->requested_presence;
 }
 
 /**
diff --git a/telepathy-glib/account.h b/telepathy-glib/account.h
index e336bf8..7692d9a 100644
--- a/telepathy-glib/account.h
+++ b/telepathy-glib/account.h
@@ -160,11 +160,7 @@ TpConnectionPresenceType tp_account_get_current_presence (TpAccount *account,
     gchar **status, gchar **status_message);
 
 TpConnectionPresenceType tp_account_get_requested_presence (
-    TpAccount *account);
-
-const gchar *tp_account_get_requested_status (TpAccount *account);
-
-const gchar *tp_account_get_requested_status_message (TpAccount *account);
+    TpAccount *account, gchar **status, gchar **status_message);
 
 const GHashTable *tp_account_get_parameters (TpAccount *account);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list