telepathy-qt: Message: Add a getter for 'silent' header key

Alexandr Akulich kaffeine at kemper.freedesktop.org
Mon Nov 11 17:28:15 UTC 2019


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

Author: Alexander Akulich <akulichalexander at gmail.com>
Date:   Mon Nov 11 03:28:47 2019 +0300

Message: Add a getter for 'silent' header key

---

 TelepathyQt/message.cpp | 12 ++++++++++++
 TelepathyQt/message.h   |  1 +
 2 files changed, 13 insertions(+)

diff --git a/TelepathyQt/message.cpp b/TelepathyQt/message.cpp
index a10fcac6..380fb54c 100644
--- a/TelepathyQt/message.cpp
+++ b/TelepathyQt/message.cpp
@@ -848,6 +848,18 @@ bool ReceivedMessage::isRescued() const
 }
 
 /**
+ * Return whether the incoming message should trigger a user notification.
+ *
+ * If \c true, UI should not notify the user about this message.
+ *
+ * \return \c true if the silent flag is set, \c false otherwise.
+ */
+bool ReceivedMessage::isSilent() const
+{
+    return booleanFromPart(mPriv->parts, 0, "silent", false);
+}
+
+/**
  * Return whether the incoming message is a delivery report.
  *
  * \return \c true if a delivery report, \c false otherwise.
diff --git a/TelepathyQt/message.h b/TelepathyQt/message.h
index 9141d32f..22e5c295 100644
--- a/TelepathyQt/message.h
+++ b/TelepathyQt/message.h
@@ -146,6 +146,7 @@ public:
 
     bool isScrollback() const;
     bool isRescued() const;
+    bool isSilent() const;
 
     bool isDeliveryReport() const;
     DeliveryDetails deliveryDetails() const;



More information about the telepathy-commits mailing list