summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift')
-rw-r--r--Sluift/ElementConvertors/DOMElementConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/DefaultElementConvertor.cpp4
-rw-r--r--Sluift/client.cpp15
3 files changed, 17 insertions, 4 deletions
diff --git a/Sluift/ElementConvertors/DOMElementConvertor.cpp b/Sluift/ElementConvertors/DOMElementConvertor.cpp
index 56b45aa..5e72cc8 100644
--- a/Sluift/ElementConvertors/DOMElementConvertor.cpp
+++ b/Sluift/ElementConvertors/DOMElementConvertor.cpp
@@ -185,7 +185,7 @@ boost::optional<std::string> DOMElementConvertor::convertToLua(
// Parse the payload again
ParserClient parserClient(L);
- std::shared_ptr<XMLParser> parser(parsers.createXMLParser(&parserClient));
+ std::shared_ptr<XMLParser> parser(parsers.createXMLParser(&parserClient, false));
bool result = parser->parse(serializedPayload);
assert(result);
diff --git a/Sluift/ElementConvertors/DefaultElementConvertor.cpp b/Sluift/ElementConvertors/DefaultElementConvertor.cpp
index 75e6706..d3d60ff 100644
--- a/Sluift/ElementConvertors/DefaultElementConvertor.cpp
+++ b/Sluift/ElementConvertors/DefaultElementConvertor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2019 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ DefaultElementConvertor::~DefaultElementConvertor() {
}
std::shared_ptr<Element> DefaultElementConvertor::convertFromLua(lua_State*, int, const std::string& type) {
- SWIFT_LOG(warning) << "Unable to convert type '" << type << "'" << std::endl;
+ SWIFT_LOG(warning) << "Unable to convert type '" << type << "'";
return std::shared_ptr<Element>();
}
diff --git a/Sluift/client.cpp b/Sluift/client.cpp
index 24ece85..814ad45 100644
--- a/Sluift/client.cpp
+++ b/Sluift/client.cpp
@@ -299,6 +299,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
"body the body of the message. Can alternatively be specified using the `body` option\n",
"to the JID to send the message to\n"
+ "id the id to set on the stanza\n"
"body the body of the message\n"
"subject the subject of the MUC room to set\n"
"type the type of message to send (`normal`, `chat`, `error`, `groupchat`, `headline`)\n"
@@ -307,6 +308,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
Sluift::globals.eventLoop.runOnce();
JID to;
boost::optional<std::string> body;
+ boost::optional<std::string> id;
boost::optional<std::string> subject;
std::vector<std::shared_ptr<Payload> > payloads;
int index = 2;
@@ -324,6 +326,10 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
to = *value;
}
+ if (boost::optional<std::string> value = Lua::getStringField(L, index, "id")) {
+ id = value;
+ }
+
if (boost::optional<std::string> value = Lua::getStringField(L, index, "body")) {
body = value;
}
@@ -350,6 +356,9 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
if (body && !body->empty()) {
message->setBody(*body);
}
+ if (id) {
+ message->setID(*id);
+ }
if (subject) {
message->setSubject(*subject);
}
@@ -369,7 +378,8 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
"self\n"
"body the text of the presence. Can alternatively be specified using the `status` option\n",
- "to the JID to send the message to\n"
+ "to the JID to send the presence to\n"
+ "id the id to set on the stanza\n"
"status the text of the presence\n"
"show the availability of the presence (`online`, `ffc`, `away`, `xa`, `dnd`)\n"
"priority the priority of the presence\n"
@@ -388,6 +398,9 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
if (boost::optional<std::string> value = Lua::getStringField(L, index, "to")) {
presence->setTo(*value);
}
+ if (boost::optional<std::string> id = Lua::getStringField(L, index, "id")) {
+ presence->setID(*id);
+ }
if (boost::optional<std::string> value = Lua::getStringField(L, index, "status")) {
presence->setStatus(*value);
}