diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-05-06 16:38:47 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-08-14 17:32:53 +0200 |
| commit | b6d341f649dd12cd884d43fc6d21dfa8f1bdac95 (patch) | |
| tree | d9321abdf97c0fff647b8bdc9ecb2ce4dcf9fda6 /src/base | |
| parent | c89d39d66affd6a1c2a299ca424deaf88ea17ba9 (diff) | |
| download | qxmpp-b6d341f649dd12cd884d43fc6d21dfa8f1bdac95.tar.gz | |
Message: Add isCarbonForwarded attribute
It's now also possible to see which messages were carbon forwarded when
using the CarbonManagerV2.
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/QXmppMessage.cpp | 24 | ||||
| -rw-r--r-- | src/base/QXmppMessage.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp index 2f0fb5fe..3062b227 100644 --- a/src/base/QXmppMessage.cpp +++ b/src/base/QXmppMessage.cpp @@ -106,6 +106,7 @@ public: // XEP-0280: Message Carbons bool privatemsg; + bool isCarbonForwarded; // XEP-0308: Last Message Correction QString replaceId; @@ -159,6 +160,7 @@ QXmppMessagePrivate::QXmppMessagePrivate() receiptRequested(false), attentionRequested(false), privatemsg(false), + isCarbonForwarded(false), markable(false), marker(QXmppMessage::NoMarker), hints(0), @@ -661,6 +663,28 @@ void QXmppMessage::setPrivate(const bool priv) } /// +/// Returns whether this message has been forwarded using carbons. +/// +/// \since QXmpp 1.5 +/// +bool QXmppMessage::isCarbonForwarded() const +{ + return d->isCarbonForwarded; +} + +/// +/// Sets whether this message has been forwarded using carbons. +/// +/// Setting this to true has no effect, this is purely informational. +/// +/// \since QXmpp 1.5 +/// +void QXmppMessage::setCarbonForwarded(bool forwarded) +{ + d->isCarbonForwarded = forwarded; +} + +/// /// Returns the message id to replace with this message as used in \xep{0308}: /// Last Message Correction. If the returned string is empty, this message is /// not replacing another. diff --git a/src/base/QXmppMessage.h b/src/base/QXmppMessage.h index ba6917c4..43949118 100644 --- a/src/base/QXmppMessage.h +++ b/src/base/QXmppMessage.h @@ -173,6 +173,8 @@ public: // XEP-0280: Message Carbons bool isPrivate() const; void setPrivate(const bool); + bool isCarbonForwarded() const; + void setCarbonForwarded(bool); // XEP-0308: Last Message Correction QString replaceId() const; |
