MUC: Assign occupants unavailable presence on room destruction, fixes destruction...
[prosody.git] / core / moduleapi.lua
index ff68a15ce420dce6e25dd07e6616cd97e6fe41aa..9b773f89c5314ba7e9a0771722869cf69d79d8c3 100644 (file)
@@ -23,7 +23,7 @@ local ipairs, pairs, select = ipairs, pairs, select;
 local tonumber, tostring = tonumber, tostring;
 local require = require;
 local pack = table.pack or function(...) return {n=select("#",...), ...}; end -- table.pack is only in 5.2
-local unpack = table.unpack or unpack; -- renamed in 5.2
+local unpack = table.unpack or unpack; --luacheck: ignore 113 -- renamed in 5.2
 
 local prosody = prosody;
 local hosts = prosody.hosts;
@@ -375,8 +375,8 @@ function api:provides(name, item)
        self:add_item(name.."-provider", item);
 end
 
-function api:send(stanza)
-       return core_post_stanza(hosts[self.host], stanza);
+function api:send(stanza, origin)
+       return core_post_stanza(origin or hosts[self.host], stanza);
 end
 
 function api:broadcast(jids, stanza, iter)
@@ -399,7 +399,7 @@ function timer_methods:reschedule(delay)
        timer.reschedule(self.id, delay)
 end
 
-local function timer_callback(now, id, t)
+local function timer_callback(now, id, t) --luacheck: ignore 212/id
        if t.module_env.loaded == false then return; end
        return t.callback(now, unpack(t, 1, t.n));
 end