diff options
-rw-r--r-- | Sluift/core.lua | 7 | ||||
-rw-r--r-- | Sluift/sluift.cpp | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Sluift/core.lua b/Sluift/core.lua index 1969690..9e81575 100644 --- a/Sluift/core.lua +++ b/Sluift/core.lua @@ -5,4 +5,5 @@ --]] +local sluift = select(1, ...) local _G = _G local pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, unpack = pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, unpack @@ -892,5 +893,6 @@ end function PubSubNode:subscribe(...) - local options = parse_options(...) + local options = parse_options({}, ...) + tprint(options) local jid = options.jid or sluift.jid.to_bare(self.client:jid()) return self.client:query_pubsub(merge_tables( @@ -904,5 +906,6 @@ function PubSubNode:unsubscribe(options) return self.client:query_pubsub(merge_tables( { type = 'set', to = self.jid, query = { - _type = 'pubsub_unsubscribe', node = self.node, jid = options['jid'] } + _type = 'pubsub_unsubscribe', node = self.node, jid = options['jid'], + subscription_id = 'subscription_id'} }, options)) end diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp index 17990e8..50b287b 100644 --- a/Sluift/sluift.cpp +++ b/Sluift/sluift.cpp @@ -322,5 +322,6 @@ SLUIFT_API int luaopen_sluift(lua_State* L) { lua_error(L); } - lua_call(L, 0, 1); + lua_pushvalue(L, -2); + lua_call(L, 1, 1); Sluift::globals.coreLibIndex = luaL_ref(L, LUA_REGISTRYINDEX); |