telepathy-qt: Add client side support for conference calls

David Edmundson davidedmundson at kemper.freedesktop.org
Tue Feb 10 06:30:10 PST 2015


Module: telepathy-qt
Branch: master
Commit: d39d1f68725bb96b022b8f6756622ed8c2e71aae
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=d39d1f68725bb96b022b8f6756622ed8c2e71aae

Author: Gustavo Pichorim Boiko <gustavo.boiko at canonical.com>
Date:   Fri Jan 30 18:38:05 2015 -0200

Add client side support for conference calls

---

 TelepathyQt/account.cpp |  142 +++++++++++++++++++++++++++++++++++++++++++++++
 TelepathyQt/account.h   |   22 ++++++++
 2 files changed, 164 insertions(+)

diff --git a/TelepathyQt/account.cpp b/TelepathyQt/account.cpp
index 52025a4..8247a30 100644
--- a/TelepathyQt/account.cpp
+++ b/TelepathyQt/account.cpp
@@ -536,6 +536,22 @@ QVariantMap conferenceStreamedMediaCallRequest(const QList<Tp::ChannelPtr> &chan
     return request;
 }
 
+QVariantMap conferenceCallRequest(const QList<Tp::ChannelPtr> &channels,
+        const QStringList &initialInviteeContactsIdentifiers)
+{
+    QVariantMap request = conferenceRequest(TP_QT_IFACE_CHANNEL_TYPE_CALL,
+            Tp::HandleTypeNone, channels, initialInviteeContactsIdentifiers);
+    return request;
+}
+
+QVariantMap conferenceCallRequest(const QList<Tp::ChannelPtr> &channels,
+        const QList<Tp::ContactPtr> &initialInviteeContacts)
+{
+    QVariantMap request = conferenceRequest(TP_QT_IFACE_CHANNEL_TYPE_CALL,
+            Tp::HandleTypeNone, channels, initialInviteeContacts);
+    return request;
+}
+
 QVariantMap contactSearchRequest(const ConnectionCapabilities &capabilities,
         const QString &server, uint limit)
 {
@@ -2989,6 +3005,75 @@ PendingChannelRequest *Account::createConferenceStreamedMediaCall(
 }
 
 /**
+ * Start a request to create a conference call with the given
+ * channels \a channels.
+ *
+ * \param channels The conference channels.
+ * \param initialInviteeContactsIdentifiers A list of additional contacts
+ *                                          identifiers to be invited to this
+ *                                          conference when it is created.
+ * \param userActionTime The time at which user action occurred, or QDateTime()
+ *                       if this channel request is for some reason not
+ *                       involving user action.
+ * \param preferredHandler Either the well-known bus name (starting with
+ *                         org.freedesktop.Telepathy.Client.) of the preferred
+ *                         handler for this channel, or an empty string to
+ *                         indicate that any handler would be acceptable.
+ * \param hints Arbitrary metadata which will be relayed to the handler if supported,
+ *              as indicated by supportsRequestHints().
+ * \return A PendingChannelRequest which will emit PendingChannelRequest::finished
+ *         when the request has been made.
+ * \sa ensureChannel(), createChannel()
+ */
+PendingChannelRequest *Account::createConferenceCall(
+        const QList<ChannelPtr> &channels,
+        const QStringList &initialInviteeContactsIdentifiers,
+        const QDateTime &userActionTime,
+        const QString &preferredHandler,
+        const ChannelRequestHints &hints)
+{
+    QVariantMap request = conferenceCallRequest(channels,
+            initialInviteeContactsIdentifiers);
+
+    return new PendingChannelRequest(AccountPtr(this), request, userActionTime,
+            preferredHandler, true, hints);
+}
+
+/**
+ * Start a request to create a conference call with the given
+ * channels \a channels.
+ *
+ * \param channels The conference channels.
+ * \param initialInviteeContacts A list of additional contacts
+ *                               to be invited to this
+ *                               conference when it is created.
+ * \param userActionTime The time at which user action occurred, or QDateTime()
+ *                       if this channel request is for some reason not
+ *                       involving user action.
+ * \param preferredHandler Either the well-known bus name (starting with
+ *                         org.freedesktop.Telepathy.Client.) of the preferred
+ *                         handler for this channel, or an empty string to
+ *                         indicate that any handler would be acceptable.
+ * \param hints Arbitrary metadata which will be relayed to the handler if supported,
+ *              as indicated by supportsRequestHints().
+ * \return A PendingChannelRequest which will emit PendingChannelRequest::finished
+ *         when the request has been made.
+ * \sa ensureChannel(), createChannel()
+ */
+PendingChannelRequest *Account::createConferenceCall(
+        const QList<ChannelPtr> &channels,
+        const QList<ContactPtr> &initialInviteeContacts,
+        const QDateTime &userActionTime,
+        const QString &preferredHandler,
+        const ChannelRequestHints &hints)
+{
+    QVariantMap request = conferenceCallRequest(channels, initialInviteeContacts);
+
+    return new PendingChannelRequest(AccountPtr(this), request, userActionTime,
+            preferredHandler, true, hints);
+}
+
+/**
  * Start a request to create a conference text chat with the given
  * channels \a channels.
  *
@@ -3131,6 +3216,63 @@ PendingChannelRequest *Account::createConferenceTextChatroom(
 }
 
 /**
+ * Start a request to create a conference call with the given
+ * channels \a channels.
+ * This initially just creates a PendingChannel object,
+ * which can be used to track the success or failure of the request.
+ *
+ * \param channels The conference channels.
+ * \param initialInviteeContactsIdentifiers A list of additional contacts
+ *                                          identifiers to be invited to this
+ *                                          conference when it is created.
+ * \param userActionTime The time at which user action occurred, or QDateTime()
+ *                       if this channel request is for some reason not
+ *                       involving user action.
+ * \return A PendingChannel which will emit PendingChannel::finished
+ *         successfully, when the Channel is available for handling using
+ *         PendingChannel::channel(), or with an error if one has been encountered.
+ * \sa ensureAndHandleChannel(), createAndHandleChannel()
+ */
+PendingChannel *Account::createAndHandleConferenceCall(
+        const QList<ChannelPtr> &channels,
+        const QStringList &initialInviteeContactsIdentifiers,
+        const QDateTime &userActionTime)
+{
+    QVariantMap request = conferenceCallRequest(channels,
+            initialInviteeContactsIdentifiers);
+
+    return createAndHandleChannel(request, userActionTime);
+}
+
+/**
+ * Start a request to create a conference call with the given
+ * channels \a channels.
+ * This initially just creates a PendingChannel object,
+ * which can be used to track the success or failure of the request.
+ *
+ * \param channels The conference channels.
+ * \param initialInviteeContacts A list of additional contacts
+ *                               to be invited to this
+ *                               conference when it is created.
+ * \param userActionTime The time at which user action occurred, or QDateTime()
+ *                       if this channel request is for some reason not
+ *                       involving user action.
+ * \return A PendingChannel which will emit PendingChannel::finished
+ *         successfully, when the Channel is available for handling using
+ *         PendingChannel::channel(), or with an error if one has been encountered.
+ * \sa ensureAndHandleChannel(), createAndHandleChannel()
+ */
+PendingChannel *Account::createAndHandleConferenceCall(
+        const QList<ChannelPtr> &channels,
+        const QList<ContactPtr> &initialInviteeContacts,
+        const QDateTime &userActionTime)
+{
+    QVariantMap request = conferenceCallRequest(channels, initialInviteeContacts);
+
+    return createAndHandleChannel(request, userActionTime);
+}
+
+/**
  * Start a request to create a contact search channel with the given
  * server \a server and limit \a limit.
  *
diff --git a/TelepathyQt/account.h b/TelepathyQt/account.h
index 72f858f..24db4e3 100644
--- a/TelepathyQt/account.h
+++ b/TelepathyQt/account.h
@@ -350,6 +350,19 @@ public:
             const QString &preferredHandler = QString(),
             const ChannelRequestHints &hints = ChannelRequestHints());
 
+    PendingChannelRequest *createConferenceCall(
+            const QList<ChannelPtr> &channels,
+            const QStringList &initialInviteeContactsIdentifiers = QStringList(),
+            const QDateTime &userActionTime = QDateTime::currentDateTime(),
+            const QString &preferredHandler = QString(),
+            const ChannelRequestHints &hints = ChannelRequestHints());
+    PendingChannelRequest *createConferenceCall(
+            const QList<ChannelPtr> &channels,
+            const QList<ContactPtr> &initialInviteeContacts = QList<ContactPtr>(),
+            const QDateTime &userActionTime = QDateTime::currentDateTime(),
+            const QString &preferredHandler = QString(),
+            const ChannelRequestHints &hints = ChannelRequestHints());
+
     PendingChannelRequest *createConferenceTextChat(
             const QList<ChannelPtr> &channels,
             const QList<ContactPtr> &initialInviteeContacts = QList<ContactPtr>(),
@@ -378,6 +391,15 @@ public:
             const QString &preferredHandler = QString(),
             const ChannelRequestHints &hints = ChannelRequestHints());
 
+    PendingChannel *createAndHandleConferenceCall(
+            const QList<ChannelPtr> &channels,
+            const QStringList &initialInviteeContactsIdentifiers = QStringList(),
+            const QDateTime &userActionTime = QDateTime::currentDateTime());
+    PendingChannel *createAndHandleConferenceCall(
+            const QList<ChannelPtr> &channels,
+            const QList<ContactPtr> &initialInviteeContacts = QList<ContactPtr>(),
+            const QDateTime &userActionTime = QDateTime::currentDateTime());
+
     PendingChannelRequest *createContactSearch(
             const QString &server,
             uint limit = 0,



More information about the telepathy-commits mailing list