diff options
Diffstat (limited to 'Sluift')
-rw-r--r-- | Sluift/ElementConvertors/MAMQueryConvertor.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Sluift/ElementConvertors/MAMQueryConvertor.cpp b/Sluift/ElementConvertors/MAMQueryConvertor.cpp index cf4f787..6217eb7 100644 --- a/Sluift/ElementConvertors/MAMQueryConvertor.cpp +++ b/Sluift/ElementConvertors/MAMQueryConvertor.cpp @@ -31,6 +31,11 @@ boost::shared_ptr<MAMQuery> MAMQueryConvertor::doConvertFromLua(lua_State* L) { result->setQueryID(std::string(lua_tostring(L, -1))); } lua_pop(L, 1); + lua_getfield(L, -1, "node"); + if (lua_isstring(L, -1)) { + result->setNode(std::string(lua_tostring(L, -1))); + } + lua_pop(L, 1); lua_getfield(L, -1, "form"); if (!lua_isnil(L, -1)) { boost::shared_ptr<Form> form = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form")); @@ -56,6 +61,10 @@ void MAMQueryConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<MAMQuery> lua_pushstring(L, (*payload->getQueryID()).c_str()); lua_setfield(L, -2, "query_id"); } + if (payload->getNode()) { + lua_pushstring(L, (*payload->getNode()).c_str()); + lua_setfield(L, -2, "node"); + } if (convertors->convertToLuaUntyped(L, payload->getForm()) > 0) { lua_setfield(L, -2, "form"); } @@ -69,6 +78,7 @@ boost::optional<LuaElementConvertor::Documentation> MAMQueryConvertor::getDocume "MAMQuery", "This table has the following fields:\n\n" "- `query_id`: string (Optional)\n" + "- `node`: string (Optional)\n" "- `form`: string @{Form} (Optional)\n" "- `result_set`: @{ResultSet} (Optional)\n" ); |