[telepathy-qt4/master] TextChannel: Added hasChatStateInterface method.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Mon Nov 2 09:32:21 PST 2009


---
 TelepathyQt4/text-channel.cpp |   16 ++++++++++++++++
 TelepathyQt4/text-channel.h   |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/text-channel.cpp b/TelepathyQt4/text-channel.cpp
index f682ae8..42cc3f2 100644
--- a/TelepathyQt4/text-channel.cpp
+++ b/TelepathyQt4/text-channel.cpp
@@ -667,6 +667,22 @@ bool TextChannel::hasMessagesInterface() const
 }
 
 /**
+ * Return whether this channel supports the Telepathy ChatState interface.
+ * If it does not, some advanced functionality will be unavailable.
+ *
+ * The result of calling this method is undefined until basic Channel
+ * functionality has been enabled by calling becomeReady and waiting for the
+ * pending operation to complete.
+ *
+ * \return true if the ChatState interface is supported
+ */
+bool TextChannel::hasChatStateInterface() const
+{
+    return interfaces().contains(QLatin1String(
+                TELEPATHY_INTERFACE_CHANNEL_INTERFACE_CHAT_STATE));
+}
+
+/**
  * Return whether contacts can be invited into this channel using
  * inviteContacts (which is equivalent to groupAddContacts). Whether this
  * is the case depends on the underlying protocol, the type of channel,
diff --git a/TelepathyQt4/text-channel.h b/TelepathyQt4/text-channel.h
index dd3e59d..03dcb04 100644
--- a/TelepathyQt4/text-channel.h
+++ b/TelepathyQt4/text-channel.h
@@ -77,6 +77,7 @@ public:
     virtual ~TextChannel();
 
     bool hasMessagesInterface() const;
+    bool hasChatStateInterface() const;
     bool canInviteContacts() const;
 
     // requires FeatureMessageCapabilities
-- 
1.5.6.5




More information about the telepathy-commits mailing list