diff --git a/src/xmpp/xmpp-core/protocol.cpp b/src/xmpp/xmpp-core/protocol.cpp index 85e4cd71..e87c3773 100644 --- a/src/xmpp/xmpp-core/protocol.cpp +++ b/src/xmpp/xmpp-core/protocol.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include using namespace XMPP; @@ -95,46 +96,46 @@ StreamFeatures::StreamFeatures() // BasicProtocol //---------------------------------------------------------------------------- BasicProtocol::SASLCondEntry BasicProtocol::saslCondTable[] = { - { "aborted", Aborted }, - { "account-disabled", AccountDisabled }, - { "credentials-expired", CredentialsExpired }, - { "encryption-required", EncryptionRequired }, - { "incorrect-encoding", IncorrectEncoding }, - { "invalid-authzid", InvalidAuthzid }, - { "invalid-mechanism", InvalidMech }, - { "malformed-request", MalformedRequest }, - { "mechanism-too-weak", MechTooWeak }, - { "not-authorized", NotAuthorized }, - { "temporary-auth-failure", TemporaryAuthFailure }, - { nullptr, 0 }, + { "aborted", SASLCond::Aborted }, + { "account-disabled", SASLCond::AccountDisabled }, + { "credentials-expired", SASLCond::CredentialsExpired }, + { "encryption-required", SASLCond::EncryptionRequired }, + { "incorrect-encoding", SASLCond::IncorrectEncoding }, + { "invalid-authzid", SASLCond::InvalidAuthzid }, + { "invalid-mechanism", SASLCond::InvalidMechanism }, + { "malformed-request", SASLCond::MalformedRequest }, + { "mechanism-too-weak", SASLCond::MechanismTooWeak }, + { "not-authorized", SASLCond::NotAuthorized }, + { "temporary-auth-failure", SASLCond::TemporaryAuthFailure }, + { nullptr, SASLCond(0) }, }; BasicProtocol::StreamCondEntry BasicProtocol::streamCondTable[] = { - { "bad-format", BadFormat }, - { "bad-namespace-prefix", BadNamespacePrefix }, - { "conflict", Conflict }, - { "connection-timeout", ConnectionTimeout }, - { "host-gone", HostGone }, - { "host-unknown", HostUnknown }, - { "improper-addressing", ImproperAddressing }, - { "internal-server-error", InternalServerError }, - { "invalid-from", InvalidFrom }, - { "invalid-namespace", InvalidNamespace }, - { "invalid-xml", InvalidXml }, - { "not-authorized", StreamNotAuthorized }, - { "not-well-formed", NotWellFormed }, - { "policy-violation", PolicyViolation }, - { "remote-connection-failed", RemoteConnectionFailed }, - { "reset", StreamReset }, - { "resource-constraint", ResourceConstraint }, - { "restricted-xml", RestrictedXml }, - { "see-other-host", SeeOtherHost }, - { "system-shutdown", SystemShutdown }, - { "undefined-condition", UndefinedCondition }, - { "unsupported-encoding", UnsupportedEncoding }, - { "unsupported-stanza-type", UnsupportedStanzaType }, - { "unsupported-version", UnsupportedVersion }, - { nullptr, 0 }, + { "bad-format", StreamCond::BadFormat }, + { "bad-namespace-prefix", StreamCond::BadNamespacePrefix }, + { "conflict", StreamCond::Conflict }, + { "connection-timeout", StreamCond::ConnectionTimeout }, + { "host-gone", StreamCond::HostGone }, + { "host-unknown", StreamCond::HostUnknown }, + { "improper-addressing", StreamCond::ImproperAddressing }, + { "internal-server-error", StreamCond::InternalServerError }, + { "invalid-from", StreamCond::InvalidFrom }, + { "invalid-namespace", StreamCond::InvalidNamespace }, + { "invalid-xml", StreamCond::InvalidXml }, + { "not-authorized", StreamCond::NotAuthorized }, + { "not-well-formed", StreamCond::NotWellFormed }, + { "policy-violation", StreamCond::PolicyViolation }, + { "remote-connection-failed", StreamCond::RemoteConnectionFailed }, + { "reset", StreamCond::Reset }, + { "resource-constraint", StreamCond::ResourceConstraint }, + { "restricted-xml", StreamCond::RestrictedXml }, + { "see-other-host", StreamCond::SeeOtherHost }, + { "system-shutdown", StreamCond::SystemShutdown }, + { "undefined-condition", StreamCond::UndefinedCondition }, + { "unsupported-encoding", StreamCond::UnsupportedEncoding }, + { "unsupported-stanza-type", StreamCond::UnsupportedStanzaType }, + { "unsupported-version", StreamCond::UnsupportedVersion }, + { nullptr, StreamCond(0) }, }; BasicProtocol::BasicProtocol() : XmlProtocol() { init(); } @@ -143,7 +144,7 @@ BasicProtocol::~BasicProtocol() { } void BasicProtocol::init() { - errCond = -1; + errCond = {}; sasl_authed = false; doShutdown = false; delayedError = false; @@ -210,7 +211,7 @@ QDomElement BasicProtocol::recvStanza() void BasicProtocol::shutdown() { doShutdown = true; } -void BasicProtocol::shutdownWithError(int cond, const QString &str) +void BasicProtocol::shutdownWithError(StreamCond cond, const QString &str) { otherHost = str; delayErrorAndClose(cond); @@ -236,25 +237,25 @@ void BasicProtocol::setSASLNext(const QByteArray &step) { sasl_step = step; } void BasicProtocol::setSASLAuthed() { sasl_authed = true; } -int BasicProtocol::stringToSASLCond(const QString &s) +std::optional BasicProtocol::stringToSASLCond(const QString &s) { for (int n = 0; saslCondTable[n].str; ++n) { if (s == saslCondTable[n].str) return saslCondTable[n].cond; } - return -1; + return {}; } -int BasicProtocol::stringToStreamCond(const QString &s) +std::optional BasicProtocol::stringToStreamCond(const QString &s) { for (int n = 0; streamCondTable[n].str; ++n) { if (s == streamCondTable[n].str) return streamCondTable[n].cond; } - return -1; + return {}; } -QString BasicProtocol::saslCondToString(int x) +QString BasicProtocol::saslCondToString(SASLCond x) { for (int n = 0; saslCondTable[n].str; ++n) { if (x == saslCondTable[n].cond) @@ -263,7 +264,7 @@ QString BasicProtocol::saslCondToString(int x) return QString(); } -QString BasicProtocol::streamCondToString(int x) +QString BasicProtocol::streamCondToString(StreamCond x) { for (int n = 0; streamCondTable[n].str; ++n) { if (x == streamCondTable[n].cond) @@ -281,13 +282,13 @@ void BasicProtocol::extractStreamError(const QDomElement &e) QDomElement t = firstChildElement(e); if (t.isNull() || t.namespaceURI() != NS_STREAMS) { // probably old-style error - errCond = -1; + errCond = {}; errText = e.text(); } else errCond = stringToStreamCond(t.tagName()); - if (errCond != -1) { - if (errCond == SeeOtherHost) + if (errCond.has_value()) { + if (std::get(*errCond) == StreamCond::SeeOtherHost) otherHost = t.text(); auto nodes = e.elementsByTagNameNS(NS_STREAMS, "text"); @@ -320,7 +321,7 @@ void BasicProtocol::send(const QDomElement &e, bool clip) { writeElement(e, Type void BasicProtocol::sendUrgent(const QDomElement &e, bool clip) { writeElement(e, TypeElement, false, clip, true); } -void BasicProtocol::sendStreamError(int cond, const QString &text, const QDomElement &appSpec) +void BasicProtocol::sendStreamError(StreamCond cond, const QString &text, const QDomElement &appSpec) { QDomElement se = doc.createElementNS(NS_ETHERX, "stream:error"); QDomElement err = doc.createElementNS(NS_STREAMS, streamCondToString(cond)); @@ -346,7 +347,7 @@ void BasicProtocol::sendStreamError(const QString &text) writeElement(se, 100, false); } -bool BasicProtocol::errorAndClose(int cond, const QString &text, const QDomElement &appSpec) +bool BasicProtocol::errorAndClose(StreamCond cond, const QString &text, const QDomElement &appSpec) { closeError = true; errCond = cond; @@ -363,7 +364,7 @@ bool BasicProtocol::error(int code) return true; } -void BasicProtocol::delayErrorAndClose(int cond, const QString &text, const QDomElement &appSpec) +void BasicProtocol::delayErrorAndClose(StreamCond cond, const QString &text, const QDomElement &appSpec) { errorCode = ErrStream; errCond = cond; @@ -415,7 +416,7 @@ void BasicProtocol::handleDocOpen(const Parser::Event &pe) { if (isIncoming()) { if (xmlEncoding() != "UTF-8") { - delayErrorAndClose(UnsupportedEncoding); + delayErrorAndClose(StreamCond::UnsupportedEncoding); return; } } @@ -455,7 +456,7 @@ void BasicProtocol::handleDocOpen(const Parser::Event &pe) handleStreamOpen(pe); } else { if (isIncoming()) - delayErrorAndClose(BadFormat); + delayErrorAndClose(StreamCond::BadFormat); else delayError(ErrProtocol); } @@ -464,7 +465,7 @@ void BasicProtocol::handleDocOpen(const Parser::Event &pe) bool BasicProtocol::handleError() { if (isIncoming()) - return errorAndClose(NotWellFormed); + return errorAndClose(StreamCond::NotWellFormed); else return error(ErrParse); } @@ -485,7 +486,8 @@ bool BasicProtocol::doStep(const QDomElement &e) // handle pending error if (delayedError) { if (isIncoming()) - return errorAndClose(errCond, errText, errAppSpec); + // see delayErrorAndClose. it's the only place we set errCond + return errorAndClose(std::get(*errCond), errText, errAppSpec); else return error(errorCode); } @@ -834,13 +836,13 @@ void CoreProtocol::handleStreamOpen(const Parser::Event &pe) // verify namespace if ((!server && ns != NS_CLIENT) || (server && ns != NS_SERVER) || (dialback && db != NS_DIALBACK)) { - delayErrorAndClose(InvalidNamespace); + delayErrorAndClose(StreamCond::InvalidNamespace); return; } // verify version if (version.major < 1 && !dialback) { - delayErrorAndClose(UnsupportedVersion); + delayErrorAndClose(StreamCond::UnsupportedVersion); return; } } else { @@ -1474,7 +1476,7 @@ bool CoreProtocol::normalStep(const QDomElement &e) } else if (e.tagName() == "failure") { QDomElement t = firstChildElement(e); if (t.isNull() || t.namespaceURI() != NS_SASL) - errCond = -1; + errCond = {}; else errCond = stringToSASLCond(t.tagName()); @@ -1518,7 +1520,7 @@ bool CoreProtocol::normalStep(const QDomElement &e) jid_ = j; return loginComplete(); } else { - errCond = -1; + errCond = {}; QDomElement err = e.elementsByTagNameNS(NS_CLIENT, "error").item(0).toElement(); if (!err.isNull()) { @@ -1535,9 +1537,9 @@ bool CoreProtocol::normalStep(const QDomElement &e) if (!t.isNull() && t.namespaceURI() == NS_STANZAS) { QString cond = t.tagName(); if (cond == "not-allowed") - errCond = BindNotAllowed; + errCond = BindCond::BindNotAllowed; else if (cond == "conflict") - errCond = BindConflict; + errCond = BindCond::BindConflict; } } diff --git a/src/xmpp/xmpp-core/protocol.h b/src/xmpp/xmpp-core/protocol.h index 2db6352f..deb0419f 100644 --- a/src/xmpp/xmpp-core/protocol.h +++ b/src/xmpp/xmpp-core/protocol.h @@ -29,6 +29,8 @@ #include #include +#include + #define NS_ETHERX "http://etherx.jabber.org/streams" #define NS_CLIENT "jabber:client" #define NS_SERVER "jabber:server" @@ -70,20 +72,20 @@ class StreamFeatures { class BasicProtocol : public XmlProtocol { public: // xmpp 1.0 error conditions // rfc6120 - enum SASLCond { + enum class SASLCond { Aborted, // server confirms auth abort AccountDisabled, // account temporrily disabled CredentialsExpired, // credential expired EncryptionRequired, // can't use mech without TLS IncorrectEncoding, // Incorrect encoding. should not happen InvalidAuthzid, // bad input JID - InvalidMech, // bad mechanism + InvalidMechanism, // bad mechanism MalformedRequest, // malformded request - MechTooWeak, // can't use mech with this authzid + MechanismTooWeak, // can't use mech with this authzid NotAuthorized, // bad user, bad password, bad creditials TemporaryAuthFailure, // please try again later! }; - enum StreamCond { + enum class StreamCond { BadFormat, BadNamespacePrefix, Conflict, @@ -95,10 +97,11 @@ class BasicProtocol : public XmlProtocol { InvalidFrom, InvalidNamespace, InvalidXml, - StreamNotAuthorized, + NotAuthorized, + NotWellFormed, PolicyViolation, RemoteConnectionFailed, - StreamReset, + Reset, ResourceConstraint, RestrictedXml, SeeOtherHost, @@ -107,9 +110,8 @@ class BasicProtocol : public XmlProtocol { UnsupportedEncoding, UnsupportedStanzaType, UnsupportedVersion, - NotWellFormed }; - enum BindCond { BindBadRequest, BindNotAllowed, BindConflict }; + enum class BindCond { BindBadRequest, BindNotAllowed, BindConflict }; // extend the XmlProtocol enums enum Need { @@ -165,18 +167,19 @@ class BasicProtocol : public XmlProtocol { // shutdown void shutdown(); - void shutdownWithError(int cond, const QString &otherHost = ""); + void shutdownWithError(StreamCond cond, const QString &otherHost = ""); // information QString to, from, id, lang; Version version; // error output - int errCond; - QString errText; - QHash errLangText; - QDomElement errAppSpec; - QString otherHost; + using ErrorCond = std::variant; // int for old/deprecated error codes + std::optional errCond; + QString errText; + QHash errLangText; + QDomElement errAppSpec; + QString otherHost; QByteArray spare; // filled with unprocessed data on NStartTLS and NSASLLayer @@ -185,19 +188,19 @@ class BasicProtocol : public XmlProtocol { enum { TypeElement, TypeStanza, TypeDirect, TypePing }; protected: - static int stringToSASLCond(const QString &s); - static int stringToStreamCond(const QString &s); - static QString saslCondToString(int); - static QString streamCondToString(int); + static std::optional stringToSASLCond(const QString &s); + static std::optional stringToStreamCond(const QString &s); + static QString saslCondToString(SASLCond); + static QString streamCondToString(StreamCond); void send(const QDomElement &e, bool clip = false); void sendUrgent(const QDomElement &e, bool clip = false); - void sendStreamError(int cond, const QString &text = "", const QDomElement &appSpec = QDomElement()); + void sendStreamError(StreamCond cond, const QString &text = "", const QDomElement &appSpec = QDomElement()); void sendStreamError(const QString &text); // old-style - bool errorAndClose(int cond, const QString &text = "", const QDomElement &appSpec = QDomElement()); + bool errorAndClose(StreamCond cond, const QString &text = "", const QDomElement &appSpec = QDomElement()); bool error(int code); - void delayErrorAndClose(int cond, const QString &text = "", const QDomElement &appSpec = QDomElement()); + void delayErrorAndClose(StreamCond cond, const QString &text = "", const QDomElement &appSpec = QDomElement()); void delayError(int code); // reimplemented @@ -225,13 +228,13 @@ class BasicProtocol : public XmlProtocol { private: struct SASLCondEntry { const char *str; - int cond; + SASLCond cond; }; static SASLCondEntry saslCondTable[]; struct StreamCondEntry { const char *str; - int cond; + StreamCond cond; }; static StreamCondEntry streamCondTable[]; diff --git a/src/xmpp/xmpp-core/stream.cpp b/src/xmpp/xmpp-core/stream.cpp index 0384166c..14a8f180 100644 --- a/src/xmpp/xmpp-core/stream.cpp +++ b/src/xmpp/xmpp-core/stream.cpp @@ -834,7 +834,7 @@ void ClientStream::srvProcessNext() if (d->srv.to != d->server) { // host-gone, host-unknown, see-other-host - d->srv.shutdownWithError(CoreProtocol::HostUnknown); + d->srv.shutdownWithError(CoreProtocol::StreamCond::HostUnknown); } else d->srv.setFrom(d->server); break; @@ -1296,7 +1296,7 @@ void ClientStream::handleError() reset(); emit error(ErrProtocol); } else if (c == CoreProtocol::ErrStream) { - int x = d->client.errCond; + auto x = std::get(*d->client.errCond); QString text = d->client.errText; auto langText = d->client.errLangText; QDomElement appSpec = d->client.errAppSpec; @@ -1305,91 +1305,91 @@ void ClientStream::handleError() int strErr = -1; switch (x) { - case CoreProtocol::BadFormat: { + case CoreProtocol::StreamCond::BadFormat: { break; } // should NOT happen (we send the right format) - case CoreProtocol::BadNamespacePrefix: { + case CoreProtocol::StreamCond::BadNamespacePrefix: { break; } // should NOT happen (we send prefixes) - case CoreProtocol::Conflict: { + case CoreProtocol::StreamCond::Conflict: { strErr = Conflict; break; } - case CoreProtocol::ConnectionTimeout: { + case CoreProtocol::StreamCond::ConnectionTimeout: { strErr = ConnectionTimeout; break; } - case CoreProtocol::HostGone: { + case CoreProtocol::StreamCond::HostGone: { connErr = HostGone; break; } - case CoreProtocol::HostUnknown: { + case CoreProtocol::StreamCond::HostUnknown: { connErr = HostUnknown; break; } - case CoreProtocol::ImproperAddressing: { + case CoreProtocol::StreamCond::ImproperAddressing: { break; } // should NOT happen (we aren't a server) - case CoreProtocol::InternalServerError: { + case CoreProtocol::StreamCond::InternalServerError: { strErr = InternalServerError; break; } - case CoreProtocol::InvalidFrom: { + case CoreProtocol::StreamCond::InvalidFrom: { strErr = InvalidFrom; break; } - case CoreProtocol::InvalidNamespace: { + case CoreProtocol::StreamCond::InvalidNamespace: { break; } // should NOT happen (we set the right ns) - case CoreProtocol::InvalidXml: { + case CoreProtocol::StreamCond::InvalidXml: { strErr = InvalidXml; break; } // shouldn't happen either, but just in case ... - case CoreProtocol::StreamNotAuthorized: { + case CoreProtocol::StreamCond::NotAuthorized: { break; } // should NOT happen (we're not stupid) - case CoreProtocol::PolicyViolation: { + case CoreProtocol::StreamCond::PolicyViolation: { strErr = PolicyViolation; break; } - case CoreProtocol::RemoteConnectionFailed: { + case CoreProtocol::StreamCond::RemoteConnectionFailed: { connErr = RemoteConnectionFailed; break; } - case CoreProtocol::StreamReset: { + case CoreProtocol::StreamCond::Reset: { strErr = StreamReset; break; } - case CoreProtocol::ResourceConstraint: { + case CoreProtocol::StreamCond::ResourceConstraint: { strErr = ResourceConstraint; break; } - case CoreProtocol::RestrictedXml: { + case CoreProtocol::StreamCond::RestrictedXml: { strErr = InvalidXml; break; } // group with this one - case CoreProtocol::SeeOtherHost: { + case CoreProtocol::StreamCond::SeeOtherHost: { connErr = SeeOtherHost; break; } - case CoreProtocol::SystemShutdown: { + case CoreProtocol::StreamCond::SystemShutdown: { strErr = SystemShutdown; break; } - case CoreProtocol::UndefinedCondition: { + case CoreProtocol::StreamCond::UndefinedCondition: { break; } // leave as null error - case CoreProtocol::UnsupportedEncoding: { + case CoreProtocol::StreamCond::UnsupportedEncoding: { break; } // should NOT happen (we send good encoding) - case CoreProtocol::UnsupportedStanzaType: { + case CoreProtocol::StreamCond::UnsupportedStanzaType: { break; } // should NOT happen (we're not stupid) - case CoreProtocol::UnsupportedVersion: { + case CoreProtocol::StreamCond::UnsupportedVersion: { connErr = UnsupportedVersion; break; } - case CoreProtocol::NotWellFormed: { + case CoreProtocol::StreamCond::NotWellFormed: { strErr = InvalidXml; break; } // group with this one @@ -1418,9 +1418,9 @@ void ClientStream::handleError() d->errCond = TLSStart; emit error(ErrTLS); } else if (c == CoreProtocol::ErrAuth) { - int x = d->client.errCond; int r = GenericAuthError; if (d->client.old) { + auto x = std::get(*d->client.errCond); if (x == 401) // not authorized r = NotAuthorized; else if (x == 409) // conflict @@ -1428,48 +1428,49 @@ void ClientStream::handleError() else if (x == 406) // not acceptable (this should NOT happen) r = GenericAuthError; } else { + auto x = std::get(*d->client.errCond); switch (x) { - case CoreProtocol::Aborted: { + case CoreProtocol::SASLCond::Aborted: { r = GenericAuthError; break; } // should NOT happen (we never send ) - case CoreProtocol::AccountDisabled: { + case CoreProtocol::SASLCond::AccountDisabled: { r = AccountDisabled; break; } // account temporrily disabled - case CoreProtocol::CredentialsExpired: { + case CoreProtocol::SASLCond::CredentialsExpired: { r = CredentialsExpired; break; } // credential expired - case CoreProtocol::EncryptionRequired: { + case CoreProtocol::SASLCond::EncryptionRequired: { r = EncryptionRequired; break; } // can't use mech without TLS - case CoreProtocol::IncorrectEncoding: { + case CoreProtocol::SASLCond::IncorrectEncoding: { r = GenericAuthError; break; } // should NOT happen - case CoreProtocol::InvalidAuthzid: { + case CoreProtocol::SASLCond::InvalidAuthzid: { r = InvalidAuthzid; break; } - case CoreProtocol::InvalidMech: { + case CoreProtocol::SASLCond::InvalidMechanism: { r = InvalidMech; break; } - case CoreProtocol::MalformedRequest: { + case CoreProtocol::SASLCond::MalformedRequest: { r = MalformedRequest; break; } - case CoreProtocol::MechTooWeak: { + case CoreProtocol::SASLCond::MechanismTooWeak: { r = MechTooWeak; break; } - case CoreProtocol::NotAuthorized: { + case CoreProtocol::SASLCond::NotAuthorized: { r = NotAuthorized; break; } - case CoreProtocol::TemporaryAuthFailure: { + case CoreProtocol::SASLCond::TemporaryAuthFailure: { r = TemporaryAuthFailure; break; } @@ -1484,12 +1485,13 @@ void ClientStream::handleError() d->errCond = NoMech; emit error(ErrAuth); } else if (c == CoreProtocol::ErrBind) { - int r = -1; - if (d->client.errCond == CoreProtocol::BindBadRequest) { + int r = -1; + auto x = std::get(*d->client.errCond); + if (x == CoreProtocol::BindCond::BindBadRequest) { // should NOT happen - } else if (d->client.errCond == CoreProtocol::BindNotAllowed) { + } else if (x == CoreProtocol::BindCond::BindNotAllowed) { r = BindNotAllowed; - } else if (d->client.errCond == CoreProtocol::BindConflict) { + } else if (x == CoreProtocol::BindCond::BindConflict) { r = BindConflict; } diff --git a/src/xmpp/xmpp-core/xmpp_stanza.cpp b/src/xmpp/xmpp-core/xmpp_stanza.cpp index b3779539..a06b923c 100644 --- a/src/xmpp/xmpp-core/xmpp_stanza.cpp +++ b/src/xmpp/xmpp-core/xmpp_stanza.cpp @@ -203,6 +203,7 @@ Stanza::Error::Private::ErrorCondEntry Stanza::Error::Private::errorCondTable[] { "not-acceptable", NotAcceptable }, { "not-allowed", NotAllowed }, { "not-authorized", NotAuthorized }, + { "policy-violation", PolicyViolation }, { "recipient-unavailable", RecipientUnavailable }, { "redirect", Redirect }, { "registration-required", RegistrationRequired }, @@ -228,6 +229,7 @@ Stanza::Error::Private::ErrorCodeEntry Stanza::Error::Private::errorCodeTable[] { NotAcceptable, Modify, 406 }, { NotAllowed, Cancel, 405 }, { NotAuthorized, Auth, 401 }, + { PolicyViolation, Modify, 405 }, // it can be Wait too according to rfc6120 { RecipientUnavailable, Wait, 404 }, { Redirect, Modify, 302 }, // temporary { RegistrationRequired, Auth, 407 }, @@ -270,6 +272,7 @@ Stanza::Error::Private::ErrorDescEntry Stanza::Error::Private::errorDescriptions { NotAuthorized, QT_TR_NOOP("Not authorized"), QT_TR_NOOP("The sender must provide proper credentials before being allowed to perform the action, or has " "provided improper credentials.") }, + { PolicyViolation, QT_TR_NOOP("Policy violation"), QT_TR_NOOP("The sender has violated some service policy.") }, { RecipientUnavailable, QT_TR_NOOP("Recipient unavailable"), QT_TR_NOOP("The intended recipient is temporarily unavailable.") }, { Redirect, QT_TR_NOOP("Redirect"), diff --git a/src/xmpp/xmpp-core/xmpp_stanza.h b/src/xmpp/xmpp-core/xmpp_stanza.h index c562f58c..bdf321ab 100644 --- a/src/xmpp/xmpp-core/xmpp_stanza.h +++ b/src/xmpp/xmpp-core/xmpp_stanza.h @@ -54,7 +54,7 @@ class Stanza { NotAcceptable, NotAllowed, NotAuthorized, - PaymentRequired, + PolicyViolation, RecipientUnavailable, Redirect, RegistrationRequired,