summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-05-13 14:48:10 (GMT)
committerSwift Review <review@swift.im>2014-05-27 19:53:49 (GMT)
commit058719296f496b14b906fdee3d74d72a78d9f6a2 (patch)
treee15b5e0032b48c924f7f69e20e0b721172a5691d /Sluift/client.cpp
parente5975a6d4809bf05f8c9df724c926bd26fc4a9df (diff)
downloadswift-058719296f496b14b906fdee3d74d72a78d9f6a2.zip
swift-058719296f496b14b906fdee3d74d72a78d9f6a2.tar.bz2
Added Sluift MAM examples. send_mam_query becomes set_mam_query.
Change-Id: I5d81e2476c83a16a8e478656d11d91137b009f3a
Diffstat (limited to 'Sluift/client.cpp')
-rw-r--r--Sluift/client.cpp29
1 files changed, 1 insertions, 28 deletions
diff --git a/Sluift/client.cpp b/Sluift/client.cpp
index 8dcd9ae..4b065ab 100644
--- a/Sluift/client.cpp
+++ b/Sluift/client.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Remko Tronçon
+ * Copyright (c) 2013-2014 Remko Tronçon
* Licensed under the GNU General Public License.
* See the COPYING file for more information.
*/
@@ -452,33 +452,6 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
return 0;
}
-SLUIFT_LUA_FUNCTION_WITH_HELP(
- Client, send_mam_query,
-
- "Builds and sends a MAM query.\n",
-
- "self\n"
- "mam_query parameters for the query\n"
- "jid optional jid to set in the 'to' field of the IQ stanza",
-
- "See help('MAMQuery') for details."
-) {
- Lua::checkType(L, 2, LUA_TTABLE);
- boost::shared_ptr<MAMQuery> mamQuery = boost::make_shared<MAMQuery>();
- lua_getfield(L, 2, "mam_query");
- if (lua_istable(L, -1)) {
- mamQuery = boost::dynamic_pointer_cast<MAMQuery>(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, -1, "mam_query"));
- }
- JID jid;
- lua_getfield(L, 2, "jid");
- if (!lua_isnil(L, -1)) {
- jid = JID(lua_tostring(L, -1));
- }
- IQRouter *router = getClient(L)->getClient()->getIQRouter();
- router->sendIQ(IQ::createRequest(IQ::Set, jid, IDGenerator().generateID(), mamQuery));
- return 0;
-}
-
static void pushEvent(lua_State* L, const SluiftClient::Event& event) {
switch (event.type) {
case SluiftClient::Event::MessageType: {