aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_muc.lua4
-rw-r--r--plugins/mod_roster.lua9
2 files changed, 5 insertions, 8 deletions
diff --git a/plugins/mod_muc.lua b/plugins/mod_muc.lua
index 38f21b4a..a7b8db5f 100644
--- a/plugins/mod_muc.lua
+++ b/plugins/mod_muc.lua
@@ -321,7 +321,7 @@ function handle_to_occupant(origin, stanza) -- PM, vCards, etc
elseif type ~= 'result' then -- bad type
origin.send(st.error_reply(stanza, "modify", "bad-request")); -- FIXME correct error?
end
- elseif not current_nick and type ~= "error" then -- not in room
+ elseif not current_nick and type ~= "error" and type ~= "result" then -- not in room
origin.send(st.error_reply(stanza, "cancel", "not-acceptable"));
elseif stanza.name == "message" and type == "groupchat" then -- groupchat messages not allowed in PM
origin.send(st.error_reply(stanza, "modify", "bad-request"));
@@ -333,7 +333,7 @@ function handle_to_occupant(origin, stanza) -- PM, vCards, etc
if o_data then
log("debug", "%s sent private stanza to %s (%s)", from, to, o_data.jid);
local jid = o_data.jid;
- if stanza.name=='iq' and type=='get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then jid = jid_bare(jid); end
+ -- TODO if stanza.name=='iq' and type=='get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then jid = jid_bare(jid); end
stanza.attr.to, stanza.attr.from = jid, current_nick;
core_route_stanza(component, stanza);
elseif type ~= "error" and type ~= "result" then -- recipient not in room
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua
index bdc9a233..7ffaa89f 100644
--- a/plugins/mod_roster.lua
+++ b/plugins/mod_roster.lua
@@ -15,11 +15,10 @@ local jid_prep = require "util.jid".prep;
local t_concat = table.concat;
local tostring = tostring;
-local handle_presence = require "core.presencemanager".handle_presence;
local rm_remove_from_roster = require "core.rostermanager".remove_from_roster;
local rm_add_to_roster = require "core.rostermanager".add_to_roster;
local rm_roster_push = require "core.rostermanager".roster_push;
-local core_route_stanza = core_route_stanza;
+local core_post_stanza = core_post_stanza;
module:add_feature("jabber:iq:roster");
@@ -83,11 +82,9 @@ module:add_iq_handler("c2s", "jabber:iq:roster",
rm_roster_push(from_node, from_host, jid);
local to_bare = node and (node.."@"..host) or host; -- bare JID
if r_item.subscription == "both" or r_item.subscription == "from" then
- handle_presence(session, st.presence({type="unsubscribed"}), from_bare, to_bare,
- core_route_stanza, false);
+ core_post_stanza(session, st.presence({type="unsubscribed", from=session.full_jid, to=to_bare}));
elseif r_item.subscription == "both" or r_item.subscription == "to" then
- handle_presence(session, st.presence({type="unsubscribe"}), from_bare, to_bare,
- core_route_stanza, false);
+ core_post_stanza(session, st.presence({type="unsubscribe", from=session.full_jid, to=to_bare}));
end
else
session.send(st.error_reply(stanza, err_type, err_cond, err_msg));