[Telepathy-commits] [telepathy-qt4/master] StreamedMediaChannel: add awaitingLocalAnswer, awaitingRemoteAnswer and acceptCall

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Mar 23 06:26:20 PDT 2009


It's not completely clear from the abstract Group API how to do these
actions, so these simple wrappers are meant to guide API users to do the
right thing.
---
 TelepathyQt4/Client/streamed-media-channel.cpp |   15 +++++++++++++++
 TelepathyQt4/Client/streamed-media-channel.h   |    5 +++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/Client/streamed-media-channel.cpp b/TelepathyQt4/Client/streamed-media-channel.cpp
index 3a9c77c..263b63c 100644
--- a/TelepathyQt4/Client/streamed-media-channel.cpp
+++ b/TelepathyQt4/Client/streamed-media-channel.cpp
@@ -83,5 +83,20 @@ StreamedMediaChannel::~StreamedMediaChannel()
     delete mPriv;
 }
 
+bool StreamedMediaChannel::awaitingLocalAnswer() const
+{
+    return groupSelfHandleIsLocalPending();
+}
+
+bool StreamedMediaChannel::awaitingRemoteAnswer() const
+{
+    return !groupRemotePendingContacts().isEmpty();
+}
+
+PendingOperation *StreamedMediaChannel::acceptCall()
+{
+    return groupAddSelfHandle();
+}
+
 } // Telepathy::Client
 } // Telepathy
diff --git a/TelepathyQt4/Client/streamed-media-channel.h b/TelepathyQt4/Client/streamed-media-channel.h
index 936e99a..e15fcf9 100644
--- a/TelepathyQt4/Client/streamed-media-channel.h
+++ b/TelepathyQt4/Client/streamed-media-channel.h
@@ -100,12 +100,17 @@ public:
 #if 0
 public:
     MediaStreams streams() const;
+#endif
+
+public:
     bool awaitingLocalAnswer() const;
     bool awaitingRemoteAnswer() const;
 
 public Q_SLOTS:
     PendingOperation *acceptCall();
 
+#if 0
+public Q_SLOTS:
     PendingOperation *removeStreams(MediaStreams streams);
     PendingOperation *removeStreams(QSet<uint> streams);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list