mod_smacks: Bounce unhandled stanzas from local origin (fix #1759)
Sending stanzas with a remote session as origin when the stanzas have a
local JID in the from attribute trips validation in core.stanza_router,
leading to warnings:
> Received a stanza claiming to be from remote.example, over a stream authed for localhost.example
Using module:send() uses the local host as origin, which is fine here.
-- Only the operators needed by net.websocket.frames are provided at this point
return {
band = function (a, b, ...)
local ret = a & b;
if ... then
for i = 1, select("#", ...) do
ret = ret & (select(i, ...));
end
end
return ret;
end;
bor = function (a, b, ...)
local ret = a | b;
if ... then
for i = 1, select("#", ...) do
ret = ret | (select(i, ...));
end
end
return ret;
end;
bxor = function (a, b, ...)
local ret = a ~ b;
if ... then
for i = 1, select("#", ...) do
ret = ret ~ (select(i, ...));
end
end
return ret;
end;
rshift = function (a, n) return a >> n end;
lshift = function (a, n) return a << n end;
};