--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
local jid_bare = require "util.jid".bare;
local jid_split = require "util.jid".split;
local user_exists = require "core.usermanager".user_exists;
local jid_bare = require "util.jid".bare;
local jid_split = require "util.jid".split;
local user_exists = require "core.usermanager".user_exists;
local t_insert = table.insert;
local function process_to_bare(bare, origin, stanza)
local t_insert = table.insert;
local function process_to_bare(bare, origin, stanza)
elseif t == "groupchat" then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
elseif t == "headline" then
elseif t == "groupchat" then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
elseif t == "headline" then
for _, session in pairs(user.sessions) do
if session.presence and session.priority >= 0 then
session.send(stanza);
for _, session in pairs(user.sessions) do
if session.presence and session.priority >= 0 then
session.send(stanza);
end
-- no resources are online
local node, host = jid_split(bare);
end
-- no resources are online
local node, host = jid_split(bare);
if user_exists(node, host) then
-- TODO apply the default privacy list
if user_exists(node, host) then
-- TODO apply the default privacy list