QXmppSpamReport Class

Describes a spam/abuse report attached to a block request, as defined in XEP-0377: Blocking Command Reports. More...

Header: #include <QXmppSpamReport.h>
Since: QXmpp 1.17

Public Types

enum class Reason { Spam, Abuse }

Public Functions

QXmppSpamReport()
QXmppSpamReport(QXmppSpamReport::Reason reason)
bool forwardToOrigin() const
bool forwardToThirdParty() const
void setTextLanguage(const QString &language)
const QString &textLanguage() const

Detailed Description

A report carries a reason() (spam or abuse) and may optionally include explanatory text(), references to the offending messages (messageReferences()) and opt-in flags allowing the server to forward the report to the reported JID's origin domain (forwardToOrigin()) or to third-party abuse services (forwardToThirdParty()).

Reports are sent together with a block request via QXmppBlockingManager::reportAndBlock().

See also QXmppBlockingManager.

Member Type Documentation

enum class QXmppSpamReport::Reason

The reason a JID is being reported.

ConstantValueDescription
QXmppSpamReport::Reason::Spam0Unwanted or unsolicited messages (urn:xmpp:reporting:spam).
QXmppSpamReport::Reason::Abuse1Abusive behaviour not covered by another category (urn:xmpp:reporting:abuse).

Member Function Documentation

[constexpr noexcept default] QXmppSpamReport::QXmppSpamReport()

Constructs a report with the reason QXmppSpamReport::Reason::Spam.

[explicit] QXmppSpamReport::QXmppSpamReport(QXmppSpamReport::Reason reason)

Constructs a report with the given reason.

bool QXmppSpamReport::forwardToOrigin() const

Returns whether the server is allowed to forward this report to the domain where the reported message originated.

bool QXmppSpamReport::forwardToThirdParty() const

Returns whether the server is allowed to forward this report to third-party services that process reports (e.g. for statistics, analysis or block lists).

void QXmppSpamReport::setTextLanguage(const QString &language)

Sets the language (xml:lang) of the explanatory text(). When empty, no xml:lang attribute is serialized.

See also textLanguage().

const QString &QXmppSpamReport::textLanguage() const

Returns the language (xml:lang) of the explanatory text(). Empty if no language is set.

See also setTextLanguage().