diff options
| -rw-r--r-- | Sluift/client.cpp | 15 |
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 | |||
| @@ -299,6 +299,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( | |||
| 299 | "body the body of the message. Can alternatively be specified using the `body` option\n", | 299 | "body the body of the message. Can alternatively be specified using the `body` option\n", |
| 300 | 300 | ||
| 301 | "to the JID to send the message to\n" | 301 | "to the JID to send the message to\n" |
| 302 | "id the id to set on the stanza\n" | ||
| 302 | "body the body of the message\n" | 303 | "body the body of the message\n" |
| 303 | "subject the subject of the MUC room to set\n" | 304 | "subject the subject of the MUC room to set\n" |
| 304 | "type the type of message to send (`normal`, `chat`, `error`, `groupchat`, `headline`)\n" | 305 | "type the type of message to send (`normal`, `chat`, `error`, `groupchat`, `headline`)\n" |
| @@ -307,6 +308,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( | |||
| 307 | Sluift::globals.eventLoop.runOnce(); | 308 | Sluift::globals.eventLoop.runOnce(); |
| 308 | JID to; | 309 | JID to; |
| 309 | boost::optional<std::string> body; | 310 | boost::optional<std::string> body; |
| 311 | boost::optional<std::string> id; | ||
| 310 | boost::optional<std::string> subject; | 312 | boost::optional<std::string> subject; |
| 311 | std::vector<std::shared_ptr<Payload> > payloads; | 313 | std::vector<std::shared_ptr<Payload> > payloads; |
| 312 | int index = 2; | 314 | int index = 2; |
| @@ -324,6 +326,10 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( | |||
| 324 | to = *value; | 326 | to = *value; |
| 325 | } | 327 | } |
| 326 | 328 | ||
| 329 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "id")) { | ||
| 330 | id = value; | ||
| 331 | } | ||
| 332 | |||
| 327 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "body")) { | 333 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "body")) { |
| 328 | body = value; | 334 | body = value; |
| 329 | } | 335 | } |
| @@ -350,6 +356,9 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( | |||
| 350 | if (body && !body->empty()) { | 356 | if (body && !body->empty()) { |
| 351 | message->setBody(*body); | 357 | message->setBody(*body); |
| 352 | } | 358 | } |
| 359 | if (id) { | ||
| 360 | message->setID(*id); | ||
| 361 | } | ||
| 353 | if (subject) { | 362 | if (subject) { |
| 354 | message->setSubject(*subject); | 363 | message->setSubject(*subject); |
| 355 | } | 364 | } |
| @@ -369,7 +378,8 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( | |||
| 369 | "self\n" | 378 | "self\n" |
| 370 | "body the text of the presence. Can alternatively be specified using the `status` option\n", | 379 | "body the text of the presence. Can alternatively be specified using the `status` option\n", |
| 371 | 380 | ||
| 372 | "to the JID to send the message to\n" | 381 | "to the JID to send the presence to\n" |
| 382 | "id the id to set on the stanza\n" | ||
| 373 | "status the text of the presence\n" | 383 | "status the text of the presence\n" |
| 374 | "show the availability of the presence (`online`, `ffc`, `away`, `xa`, `dnd`)\n" | 384 | "show the availability of the presence (`online`, `ffc`, `away`, `xa`, `dnd`)\n" |
| 375 | "priority the priority of the presence\n" | 385 | "priority the priority of the presence\n" |
| @@ -388,6 +398,9 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( | |||
| 388 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "to")) { | 398 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "to")) { |
| 389 | presence->setTo(*value); | 399 | presence->setTo(*value); |
| 390 | } | 400 | } |
| 401 | if (boost::optional<std::string> id = Lua::getStringField(L, index, "id")) { | ||
| 402 | presence->setID(*id); | ||
| 403 | } | ||
| 391 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "status")) { | 404 | if (boost::optional<std::string> value = Lua::getStringField(L, index, "status")) { |
| 392 | presence->setStatus(*value); | 405 | presence->setStatus(*value); |
| 393 | } | 406 | } |
Swift