summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Akulich <akulichalexander@gmail.com>2019-11-11 03:28:47 +0300
committerAlexander Akulich <akulichalexander@gmail.com>2019-11-11 20:13:33 +0300
commitd6d76fed63b9e030eb88b1f66897c04e08ede132 (patch)
treee2146fe6b7a1c3137a4f64ae0a648137d02f1caa
parent526132482a8146172bc4c3c16d1c9def028cc67e (diff)
Message: Add a getter for 'silent' header key
-rw-r--r--TelepathyQt/message.cpp12
-rw-r--r--TelepathyQt/message.h1
2 files changed, 13 insertions, 0 deletions
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;