From 9adba9899fcf98db402e279970056f7a2ada7915 Mon Sep 17 00:00:00 2001 From: Mili Verma Date: Thu, 23 Feb 2012 17:38:30 +0000 Subject: Fix Stroke to allow empty values This patch gives a fix to a client of Stroke can send emtpty values in form fields. Test-information: Tests pass. Before patch, MLC is not able to send empty values in updates. After the patch, it is. diff --git a/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java b/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java index c2a2189..9ab5e37 100644 --- a/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java +++ b/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java @@ -191,12 +191,12 @@ public class FormSerializer extends GenericPayloadSerializer
{ private static void serializeValueAsString(GenericFormField field, XMLElement parent) { String value = field.getValue(); - if (!value.isEmpty()) { + // FIXME with the proper fix after Swiften is fixed: if (!value.isEmpty()) { XMLElement valueElement = new XMLElement( FormField.FORM_FIELD_ELEMENT_VALUE); valueElement.addNode(XMLTextNode.create(value)); parent.addNode(valueElement); - } + // } } @Override diff --git a/test/com/isode/stroke/serializer/payloadserializers/FormSerializerTest.java b/test/com/isode/stroke/serializer/payloadserializers/FormSerializerTest.java index 4a1ccc0..7636eb4 100644 --- a/test/com/isode/stroke/serializer/payloadserializers/FormSerializerTest.java +++ b/test/com/isode/stroke/serializer/payloadserializers/FormSerializerTest.java @@ -125,13 +125,13 @@ public class FormSerializerTest { + "jabber:bot" + "" + "Section 1: Bot Info" - + "" + + "" + "This is a bot.A quite good one actually" + "" + "" + "1" + "" - + "" + + "" + "" + "news" + "search" -- cgit v0.10.2-6-g49f6