12#include "QXmppFallback.h"
13#include "QXmppFileShare.h"
14#include "QXmppStanza.h"
21class QXmppMessagePrivate;
26class QXmppMixInvitation;
28class QXmppOmemoElement;
66#if QXMPP_DEPRECATED_SINCE(1, 5)
70 static const EncryptionMethod NoEncryption = EncryptionMethod::NoEncryption;
71 static const EncryptionMethod UnknownEncryption = EncryptionMethod::UnknownEncryption;
72 static const EncryptionMethod OTR = EncryptionMethod::Otr;
73 static const EncryptionMethod LegacyOpenPGP = EncryptionMethod::LegacyOpenPgp;
74 static const EncryptionMethod OX = EncryptionMethod::Ox;
75 static const EncryptionMethod OMEMO = EncryptionMethod::Omemo0;
121 NoPermanentStore = 1 << 0,
127 QXmppMessage(
const QString &from = QString(),
const QString &to = QString(),
128 const QString &body = QString(),
const QString &thread = QString());
139 QString body()
const;
140 void setBody(
const QString &);
142 QString e2eeFallbackBody()
const;
143 void setE2eeFallbackBody(
const QString &fallbackBody);
145 QString subject()
const;
146 void setSubject(
const QString &);
148 QString thread()
const;
149 void setThread(
const QString &);
151 QString parentThread()
const;
152 void setParentThread(
const QString &);
158 QString outOfBandUrl()
const;
159 void setOutOfBandUrl(
const QString &);
161 QVector<QXmppOutOfBandUrl> outOfBandUrls()
const;
162 void setOutOfBandUrls(
const QVector<QXmppOutOfBandUrl> &urls);
165 QString xhtml()
const;
166 void setXhtml(
const QString &xhtml);
173 QDateTime stamp()
const;
174 void setStamp(
const QDateTime &stamp);
177 bool isReceiptRequested()
const;
178 void setReceiptRequested(
bool requested);
180 QString receiptId()
const;
181 void setReceiptId(
const QString &
id);
184 bool isAttentionRequested()
const;
185 void setAttentionRequested(
bool requested);
193 static bool isSlashMeCommand(
const QString &body);
194 bool isSlashMeCommand()
const;
195 static QString slashMeCommandText(
const QString &body);
196 QString slashMeCommandText()
const;
199 QString mucInvitationJid()
const;
200 void setMucInvitationJid(
const QString &jid);
202 QString mucInvitationPassword()
const;
203 void setMucInvitationPassword(
const QString &password);
205 QString mucInvitationReason()
const;
206 void setMucInvitationReason(
const QString &reason);
209 bool isPrivate()
const;
210 void setPrivate(
const bool);
211 bool isCarbonForwarded()
const;
212 void setCarbonForwarded(
bool);
215 QString replaceId()
const;
216 void setReplaceId(
const QString &);
219 bool isMarkable()
const;
220 void setMarkable(
const bool);
222 QString markedId()
const;
223 void setMarkerId(
const QString &);
225 QString markedThread()
const;
226 void setMarkedThread(
const QString &);
229 void setMarker(
const Marker);
232 bool hasHint(
const Hint hint)
const;
233 void addHint(
const Hint hint);
234 void removeHint(
const Hint hint);
235 void removeAllHints();
238 std::optional<QXmppJingleMessageInitiationElement> jingleMessageInitiationElement()
const;
239 void setJingleMessageInitiationElement(
const std::optional<QXmppJingleMessageInitiationElement> &jingleMessageInitiationElement);
242#if QXMPP_DEPRECATED_SINCE(1, 8)
243 [[deprecated(
"Use stanzaIds() instead.")]]
244 QString stanzaId()
const;
245 [[deprecated(
"Use setStanzaIds() instead.")]]
246 void setStanzaId(
const QString &
id);
248 [[deprecated(
"Use stanzaIds() instead.")]]
249 QString stanzaIdBy()
const;
250 [[deprecated(
"Use setStanzaIds() instead.")]]
251 void setStanzaIdBy(
const QString &
id);
254 QVector<QXmppStanzaId> stanzaIds()
const;
255 void setStanzaIds(
const QVector<QXmppStanzaId> &);
257 QString originId()
const;
258 void setOriginId(
const QString &
id);
261 QString attachId()
const;
262 void setAttachId(
const QString &);
265 QString mixParticipantId()
const;
267 QString mixUserJid()
const;
268 void setMixUserJid(
const QString &);
270 QString mixUserNick()
const;
271 void setMixUserNick(
const QString &);
276 QString encryptionMethodNs()
const;
277 void setEncryptionMethodNs(
const QString &);
279 QString encryptionName()
const;
280 void setEncryptionName(
const QString &);
283 bool isSpoiler()
const;
284 void setIsSpoiler(
bool);
286 QString spoilerHint()
const;
287 void setSpoilerHint(
const QString &);
290 std::optional<QXmppMixInvitation> mixInvitation()
const;
291 void setMixInvitation(
const std::optional<QXmppMixInvitation> &mixInvitation);
294#if QXMPP_DEPRECATED_SINCE(1, 7)
295 [[deprecated(
"Use fallbackMarkers()")]]
bool isFallback()
const;
296 [[deprecated(
"Use setFallbackMarkers()")]]
void setIsFallback(
bool isFallback);
298 const QVector<QXmppFallback> &fallbackMarkers()
const;
299 void setFallbackMarkers(
const QVector<QXmppFallback> &);
300 QString readFallbackRemovedText(
QXmppFallback::Element element,
const QVector<QString> &supportedNamespaces)
const;
304 std::optional<QXmppTrustMessageElement> trustMessageElement()
const;
305 void setTrustMessageElement(
const std::optional<QXmppTrustMessageElement> &trustMessageElement);
308 std::optional<QXmppMessageReaction> reaction()
const;
309 void setReaction(
const std::optional<QXmppMessageReaction> &reaction);
312 const QVector<QXmppFileShare> &sharedFiles()
const;
313 void setSharedFiles(
const QVector<QXmppFileShare> &sharedFiles);
314 QVector<QXmppFileSourcesAttachment> fileSourcesAttachments()
const;
315 void setFileSourcesAttachments(
const QVector<QXmppFileSourcesAttachment> &);
318 std::optional<QXmpp::Reply> reply()
const;
319 void setReply(
const std::optional<QXmpp::Reply> &);
320 QString readReplyQuoteFromBody()
const;
323 std::optional<QXmppCallInviteElement> callInviteElement()
const;
324 void setCallInviteElement(std::optional<QXmppCallInviteElement> callInviteElement);
329 std::optional<QXmppOmemoElement> omemoElement()
const;
330 void setOmemoElement(
const std::optional<QXmppOmemoElement> &omemoElement);
333 void parse(
const QDomElement &element)
override final;
335 void toXml(QXmlStreamWriter *writer)
const override final;
339 void parseExtensions(
const QDomElement &element,
QXmpp::SceMode sceMode);
340 virtual bool parseExtension(
const QDomElement &element,
QXmpp::SceMode);
341 virtual void serializeExtensions(QXmlStreamWriter *writer,
QXmpp::SceMode,
const QString &baseNamespace = {})
const;
344 QSharedDataPointer<QXmppMessagePrivate> d;
Definition: QXmppBitsOfBinaryDataList.h:16
The QXmppCallInviteElement class represents a Call Invite element as specified by XEP-0482: Call Invi...
Definition: QXmppJingleData.h:649
Definition: QXmppFallback.h:20
Element
Definition: QXmppFallback.h:22
The QXmppJingleMessageInitiationElement class represents a Jingle Message Initiation element as speci...
Definition: QXmppJingleData.h:602
The QXmppMessageReaction class represents a reaction to a message in the form of emojis as specified ...
Definition: QXmppMessageReaction.h:17
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:64
QXmppMessage & operator=(QXmppMessage &&)
Move-assignment operator.
QXmppMessage & operator=(const QXmppMessage &other)
Assignment operator.
Type
This enum describes a message type.
Definition: QXmppMessage.h:80
QXmppMessage(QXmppMessage &&)
Move-constructor.
Marker
Definition: QXmppMessage.h:108
Hint
Definition: QXmppMessage.h:120
State
Definition: QXmppMessage.h:94
@ Active
User is actively participating in the chat session.
Definition: QXmppMessage.h:96
@ Inactive
User has not been actively participating in the chat session.
Definition: QXmppMessage.h:97
@ Composing
User is composing a message.
Definition: QXmppMessage.h:99
@ Gone
User has effectively ended their participation in the chat session.
Definition: QXmppMessage.h:98
QXmppMessage(const QXmppMessage &other)
Constructs a copy of other.
virtual void parse(const QDomElement &)=0
virtual bool isXmppStanza() const
Definition: QXmppNonza.h:19
virtual void toXml(QXmlStreamWriter *writer) const =0
Definition: QXmppOutOfBandUrl.h:19
The Error class represents a stanza error.
Definition: QXmppStanza.h:94
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:88
The QXmppTrustMessageElement class represents a trust message element as defined by XEP-0434: Trust M...
Definition: QXmppTrustMessageElement.h:18
Definition: Algorithms.h:12
SceMode
Definition: QXmppGlobal.h:136
EncryptionMethod
Definition: QXmppGlobal.h:89
Stanza ID element as defined in XEP-0359: Unique and Stable Stanza IDs.
Definition: QXmppMessage.h:51
QString by
JID of the generating entity.
Definition: QXmppMessage.h:55
QString id
Identifier of the stanza element.
Definition: QXmppMessage.h:53
Definition: QXmppMessage.h:41
QString to
Definition: QXmppMessage.h:44
QString id
ID of the referenced message.
Definition: QXmppMessage.h:46