diff options
author | Roger Planas <roger.planas@isode.com> | 2014-07-03 13:09:06 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-07-18 14:20:54 (GMT) |
commit | e3ff5f241bf6e41829d36502e75f585d9620737e (patch) | |
tree | bff095606e0e18c63f2d2f7b6404de580addd793 /Sluift/component.cpp | |
parent | 00375bb2ac48dae174889ed9cea8dc8de55e1efd (diff) | |
download | swift-contrib-e3ff5f241bf6e41829d36502e75f585d9620737e.zip swift-contrib-e3ff5f241bf6e41829d36502e75f585d9620737e.tar.bz2 |
Sluift: Add 'show' parameter option to send_presence methods
Change-Id: I9fbd4514f6bc0d46738154abce495519e43ad46b
Diffstat (limited to 'Sluift/component.cpp')
-rw-r--r-- | Sluift/component.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Sluift/component.cpp b/Sluift/component.cpp index 0c400b3..6ae78ec 100644 --- a/Sluift/component.cpp +++ b/Sluift/component.cpp @@ -40,4 +40,5 @@ #include <Sluift/ElementConvertors/PresenceConvertor.h> #include <Sluift/ElementConvertors/MessageConvertor.h> +#include <Sluift/ElementConvertors/StatusShowConvertor.h> using namespace Swift; @@ -260,4 +261,5 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( "from the JID to send the message from\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" "type the type of message to send (`available`, `error`, `probe`, `subscribe`, `subscribed`, `unavailable`, `unsubscribe`, `unsubscribed`)\n" @@ -288,4 +290,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( presence->setType(PresenceConvertor::convertPresenceTypeFromString(*value)); } + if (boost::optional<std::string> value = Lua::getStringField(L, index, "show")) { + presence->setShow(StatusShowConvertor::convertStatusShowTypeFromString(*value)); + } std::vector< boost::shared_ptr<Payload> > payloads = getPayloadsFromTable(L, index); presence->addPayloads(payloads.begin(), payloads.end()); |