telepathy-qt: AccountManager: Add audioCallAccounts() / videoCallAccounts() methods
Dario Freddi
drf at kemper.freedesktop.org
Fri Jul 13 10:43:09 PDT 2012
Module: telepathy-qt
Branch: master
Commit: 90295f0e806f189b6eeb0ba5965191b2f97095ed
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=90295f0e806f189b6eeb0ba5965191b2f97095ed
Author: George Kiagiadakis <george.kiagiadakis at collabora.com>
Date: Fri Jul 13 19:19:21 2012 +0300
AccountManager: Add audioCallAccounts() / videoCallAccounts() methods
---
TelepathyQt/account-manager.cpp | 48 +++++++++++++++++++++++++++++++++++++++
TelepathyQt/account-manager.h | 3 ++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt/account-manager.cpp b/TelepathyQt/account-manager.cpp
index 6d94606..6ae6280 100644
--- a/TelepathyQt/account-manager.cpp
+++ b/TelepathyQt/account-manager.cpp
@@ -658,6 +658,54 @@ AccountSetPtr AccountManager::textChatroomAccounts() const
}
/**
+ * Return a set of accounts containing all accounts that support audio calls (using the
+ * Call interface) by providing a contact identifier.
+ *
+ * For this method to work, you must use an AccountFactory which makes Account::FeatureCapabilities
+ * ready.
+ *
+ * This method requires AccountManager::FeatureCore to be ready.
+ *
+ * \return A pointer to an AccountSet object containing the matching accounts.
+ */
+AccountSetPtr AccountManager::audioCallAccounts() const
+{
+ if (!accountFactory()->features().contains(Account::FeatureCapabilities)) {
+ warning() << "Account filtering by capabilities can only be used with an AccountFactory"
+ << "which makes Account::FeatureCapabilities ready";
+ return filterAccounts(AccountFilterConstPtr());
+ }
+
+ AccountCapabilityFilterPtr filter = AccountCapabilityFilter::create();
+ filter->addRequestableChannelClassSubset(RequestableChannelClassSpec::audioCall());
+ return filterAccounts(filter);
+}
+
+/**
+ * Return a set of accounts containing all accounts that support video calls (using the
+ * Call interface) by providing a contact identifier.
+ *
+ * For this method to work, you must use an AccountFactory which makes Account::FeatureCapabilities
+ * ready.
+ *
+ * This method requires AccountManager::FeatureCore to be ready.
+ *
+ * \return A pointer to an AccountSet object containing the matching accounts.
+ */
+AccountSetPtr AccountManager::videoCallAccounts() const
+{
+ if (!accountFactory()->features().contains(Account::FeatureCapabilities)) {
+ warning() << "Account filtering by capabilities can only be used with an AccountFactory"
+ << "which makes Account::FeatureCapabilities ready";
+ return filterAccounts(AccountFilterConstPtr());
+ }
+
+ AccountCapabilityFilterPtr filter = AccountCapabilityFilter::create();
+ filter->addRequestableChannelClassSubset(RequestableChannelClassSpec::videoCall());
+ return filterAccounts(filter);
+}
+
+/**
* Return a set of accounts containing all accounts that support media calls (using the
* StreamedMedia interface) by providing a contact identifier.
*
diff --git a/TelepathyQt/account-manager.h b/TelepathyQt/account-manager.h
index dc0aa4a..01dc161 100644
--- a/TelepathyQt/account-manager.h
+++ b/TelepathyQt/account-manager.h
@@ -97,6 +97,9 @@ public:
AccountSetPtr textChatAccounts() const;
AccountSetPtr textChatroomAccounts() const;
+ AccountSetPtr audioCallAccounts() const;
+ AccountSetPtr videoCallAccounts() const;
+
TP_QT_DEPRECATED AccountSetPtr streamedMediaCallAccounts() const;
TP_QT_DEPRECATED AccountSetPtr streamedMediaAudioCallAccounts() const;
TP_QT_DEPRECATED AccountSetPtr streamedMediaVideoCallAccounts() const;
More information about the telepathy-commits
mailing list