summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.cpp5
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.h1
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp4
3 files changed, 2 insertions, 8 deletions
diff --git a/Swiften/Parser/PayloadParsers/FormParser.cpp b/Swiften/Parser/PayloadParsers/FormParser.cpp
index f8e02a4..72449b8 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.cpp
+++ b/Swiften/Parser/PayloadParsers/FormParser.cpp
@@ -63,12 +63,9 @@ void FormParser::handleStartElement(const std::string& element, const std::strin
else if (type == "text-private") {
currentFieldParseHelper_ = TextPrivateFormFieldParseHelper::create();
}
- else if (type == "text-single") {
+ else /*if (type == "text-single") || undefined */ {
currentFieldParseHelper_ = TextSingleFormFieldParseHelper::create();
}
- else {
- currentFieldParseHelper_ = UntypedFormFieldParseHelper::create();
- }
if (currentFieldParseHelper_) {
currentFieldParseHelper_->getField()->setName(attributes.getAttribute("var"));
currentFieldParseHelper_->getField()->setLabel(attributes.getAttribute("label"));
diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h
index 90a3550..e6e6ec0 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.h
+++ b/Swiften/Parser/PayloadParsers/FormParser.h
@@ -96,7 +96,6 @@ namespace Swift {
SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(JIDSingle, JID);
SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(JIDMulti, JIDList);
SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(ListMulti, StringList);
- SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(Untyped, StringList);
enum Level {
TopLevel = 0,
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
index 6ec825b..7feada1 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
@@ -77,7 +77,6 @@ class FormParserTest : public CppUnit::TestFixture {
"</field>"
"<field var=\"untyped\">"
"<value>foo</value>"
- "<value>baz</value>"
"</field>"
"</x>"));
@@ -114,8 +113,7 @@ class FormParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(JID("baz@fum.org"), boost::dynamic_pointer_cast<JIDMultiFormField>(payload->getFields()[8])->getValue()[1]);
CPPUNIT_ASSERT_EQUAL(std::string("Tell all your friends about your new bot!"), payload->getFields()[8]->getDescription());
- CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[0]);
- CPPUNIT_ASSERT_EQUAL(std::string("baz"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[1]);
+ CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<TextSingleFormField>(payload->getFields()[9])->getValue());
}
};