summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2019-10-30 08:05:07 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2019-10-30 12:13:22 (GMT)
commit8baf0e407b3b4914654a6036a16ac81b7a2e7414 (patch)
tree1a7cb840d2b8630357106ed69cd16081fea16147
parenta616265f7a5a48c5769262027795f99df91a6ae8 (diff)
downloadswift-8baf0e407b3b4914654a6036a16ac81b7a2e7414.zip
swift-8baf0e407b3b4914654a6036a16ac81b7a2e7414.tar.bz2
Bring StreamError enum to spec
RFC 6120 no longer defines invalid-id, and adds unsupported-feature. The StreamError enum was derived from the schema in section A.2, which erroneously had these two deviations from 4.9.3. Test-Information: Unit tests pass on Debian 9 Change-Id: I2bb3d0b09448877bbd4618fa852baab87bfa1abc
-rw-r--r--Swiften/Elements/StreamError.h2
-rw-r--r--Swiften/Parser/StreamErrorParser.cpp6
-rw-r--r--Swiften/Serializer/StreamErrorSerializer.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/Elements/StreamError.h b/Swiften/Elements/StreamError.h
index aa294fd..6dda15c 100644
--- a/Swiften/Elements/StreamError.h
+++ b/Swiften/Elements/StreamError.h
@@ -27,7 +27,6 @@ namespace Swift {
ImproperAddressing,
InternalServerError,
InvalidFrom,
- InvalidID,
InvalidNamespace,
InvalidXML,
NotAuthorized,
@@ -41,6 +40,7 @@ namespace Swift {
SystemShutdown,
UndefinedCondition,
UnsupportedEncoding,
+ UnsupportedFeature,
UnsupportedStanzaType,
UnsupportedVersion
};
diff --git a/Swiften/Parser/StreamErrorParser.cpp b/Swiften/Parser/StreamErrorParser.cpp
index 64e0681..e89af58 100644
--- a/Swiften/Parser/StreamErrorParser.cpp
+++ b/Swiften/Parser/StreamErrorParser.cpp
@@ -48,9 +48,6 @@ void StreamErrorParser::handleEndElement(const std::string& element, const std::
else if(element == "invalid-from") {
getElementGeneric()->setType(StreamError::InvalidFrom);
}
- else if(element == "invalid-id") {
- getElementGeneric()->setType(StreamError::InvalidID);
- }
else if(element == "invalid-namespace") {
getElementGeneric()->setType(StreamError::InvalidNamespace);
}
@@ -90,6 +87,9 @@ void StreamErrorParser::handleEndElement(const std::string& element, const std::
else if(element == "unsupported-encoding") {
getElementGeneric()->setType(StreamError::UnsupportedEncoding);
}
+ else if(element == "unsupported-feature") {
+ getElementGeneric()->setType(StreamError::UnsupportedFeature);
+ }
else if(element == "unsupported-stanza-type") {
getElementGeneric()->setType(StreamError::UnsupportedStanzaType);
}
diff --git a/Swiften/Serializer/StreamErrorSerializer.cpp b/Swiften/Serializer/StreamErrorSerializer.cpp
index 66a71ca..684e8fe 100644
--- a/Swiften/Serializer/StreamErrorSerializer.cpp
+++ b/Swiften/Serializer/StreamErrorSerializer.cpp
@@ -30,7 +30,6 @@ SafeByteArray StreamErrorSerializer::serialize(std::shared_ptr<ToplevelElement>
case StreamError::ImproperAddressing: typeTag = "improper-addressing"; break;
case StreamError::InternalServerError: typeTag = "internal-server-error"; break;
case StreamError::InvalidFrom: typeTag = "invalid-from"; break;
- case StreamError::InvalidID: typeTag = "invalid-id"; break;
case StreamError::InvalidNamespace: typeTag = "invalid-namespace"; break;
case StreamError::InvalidXML: typeTag = "invalid-xml"; break;
case StreamError::NotAuthorized: typeTag = "not-authorized"; break;
@@ -44,6 +43,7 @@ SafeByteArray StreamErrorSerializer::serialize(std::shared_ptr<ToplevelElement>
case StreamError::SystemShutdown: typeTag = "system-shutdown"; break;
case StreamError::UndefinedCondition: typeTag = "undefined-condition"; break;
case StreamError::UnsupportedEncoding: typeTag = "unsupported-encoding"; break;
+ case StreamError::UnsupportedFeature: typeTag = "unsupported-feature"; break;
case StreamError::UnsupportedStanzaType: typeTag = "unsupported-stanza-type"; break;
case StreamError::UnsupportedVersion: typeTag = "unsupported-version"; break;
}