summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-05-11 15:38:57 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-06-14 20:28:20 (GMT)
commit9b1c1ec6922047fa30c19c0744619dc458a12b78 (patch)
tree230a96de2a104324b8ab179834a7b9914c0443f9 /Sluift/ElementConvertors
parent0d5dcec01a396ab64c559a5b0cd04eb38f2f1954 (diff)
downloadswift-9b1c1ec6922047fa30c19c0744619dc458a12b78.zip
swift-9b1c1ec6922047fa30c19c0744619dc458a12b78.tar.bz2
Fix handling of notify attribute in PubSub retract elements
Test-Information: Added serializer and parser unit tests. All tests pass on Mac OS X 10.11.4. Change-Id: I8550c76ba182a67613d55634c72c0f2979f8b80a
Diffstat (limited to 'Sluift/ElementConvertors')
-rw-r--r--Sluift/ElementConvertors/PubSubRetractConvertor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Sluift/ElementConvertors/PubSubRetractConvertor.cpp b/Sluift/ElementConvertors/PubSubRetractConvertor.cpp
index 6597f0b..38e15a1 100644
--- a/Sluift/ElementConvertors/PubSubRetractConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubRetractConvertor.cpp
@@ -75,8 +75,10 @@ void PubSubRetractConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSub
}
lua_setfield(L, -2, "items");
}
- lua_pushboolean(L, payload->isNotify());
- lua_setfield(L, -2, "notify");
+ if (payload->isNotify().is_initialized()) {
+ lua_pushboolean(L, payload->isNotify().get_value_or(false));
+ lua_setfield(L, -2, "notify");
+ }
}
boost::optional<LuaElementConvertor::Documentation> PubSubRetractConvertor::getDocumentation() const {