summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2019-01-25 14:40:19 (GMT)
committerKevin Smith <kevin.smith@isode.com>2019-01-25 14:42:26 (GMT)
commit256d1392b0d45ffeac44f764297ea31d65cb0229 (patch)
treef815f19ae20d84a2da63a8f2d08418da6aefe53d /Sluift/client.cpp
parent3666cbbe30e4d4e25401a5902ae359bc2c24248b (diff)
downloadswift-256d1392b0d45ffeac44f764297ea31d65cb0229.zip
swift-256d1392b0d45ffeac44f764297ea31d65cb0229.tar.bz2
Allow Sluift to set stanza IDs
Test-Information: Compiles Change-Id: I5bfbf270524a1a31c9105f108f47f64eb95276d1
Diffstat (limited to 'Sluift/client.cpp')
-rw-r--r--Sluift/client.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Sluift/client.cpp b/Sluift/client.cpp
index 24ece85..814ad45 100644
--- a/Sluift/client.cpp
+++ b/Sluift/client.cpp
@@ -301,2 +301,3 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
"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"
@@ -309,2 +310,3 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
boost::optional<std::string> body;
+ boost::optional<std::string> id;
boost::optional<std::string> subject;
@@ -326,2 +328,6 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
+ if (boost::optional<std::string> value = Lua::getStringField(L, index, "id")) {
+ id = value;
+ }
+
if (boost::optional<std::string> value = Lua::getStringField(L, index, "body")) {
@@ -352,2 +358,5 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
}
+ if (id) {
+ message->setID(*id);
+ }
if (subject) {
@@ -371,3 +380,4 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
- "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"
@@ -390,2 +400,5 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
}
+ 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")) {