From d6d76fed63b9e030eb88b1f66897c04e08ede132 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Mon, 11 Nov 2019 03:28:47 +0300 Subject: 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 @@ -847,6 +847,18 @@ bool ReceivedMessage::isRescued() const return booleanFromPart(mPriv->parts, 0, "rescued", false); } +/** + * 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. * 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; -- cgit v1.2.3