[Telepathy-commits] [telepathy-mission-control/master] Add mc_channelrequest_get_account()
Alberto Mardegan
alberto.mardegan at nokia.com
Fri Jan 30 00:05:35 PST 2009
Not sure whether it will be useful, but doesn't harm.
---
libmcclient/mc-account-request.c | 19 +++++++++++++++++++
libmcclient/mc-account.h | 1 +
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/libmcclient/mc-account-request.c b/libmcclient/mc-account-request.c
index 9d39cd4..a5818b1 100644
--- a/libmcclient/mc-account-request.c
+++ b/libmcclient/mc-account-request.c
@@ -593,3 +593,22 @@ mc_channelrequest_get_from_path (const gchar *object_path)
return 0;
}
+/**
+ * mc_channelrequest_get_account:
+ * @request_id: the ID of the channel request.
+ *
+ * Gets the account on which this channel request was made.
+ *
+ * Returns: the #McAccount (reference count is not increased), or %NULL if the
+ * request is not valid.
+ */
+McAccount *
+mc_channelrequest_get_account (guint request_id)
+{
+ McChannelRequest *req;
+
+ g_return_val_if_fail (request_id != 0, NULL);
+ req = REQUEST_FROM_ID (request_id);
+ return req ? req->account : NULL;
+}
+
diff --git a/libmcclient/mc-account.h b/libmcclient/mc-account.h
index f82989c..f915c32 100644
--- a/libmcclient/mc-account.h
+++ b/libmcclient/mc-account.h
@@ -296,6 +296,7 @@ guint mc_account_channelrequest_get_from_path (McAccount *account,
const gchar *object_path);
const gchar *mc_channelrequest_get_path (guint request_id);
guint mc_channelrequest_get_from_path (const gchar *object_path);
+McAccount *mc_channelrequest_get_account (guint request_id);
/* Account statistics */
--
1.5.6.5
More information about the telepathy-commits
mailing list