aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_blocklist.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-17 22:15:26 +0200
committerKim Alvefur <zash@zash.se>2015-09-17 22:15:26 +0200
commitca680c0562f7ad2b3754a65481f2a3196825f62e (patch)
treeaae43eb039122cfd152c9a26e2f40154cad08440 /plugins/mod_blocklist.lua
parent9b46c7aba5e4d842fffbfc4a1e96371ad06e63a1 (diff)
parent7774f56dfc98b7192e9f9c0b32b070a2949f3113 (diff)
downloadprosody-ca680c0562f7ad2b3754a65481f2a3196825f62e.tar.gz
prosody-ca680c0562f7ad2b3754a65481f2a3196825f62e.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_blocklist.lua')
-rw-r--r--plugins/mod_blocklist.lua18
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index baed6709..8589c1e9 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -95,7 +95,8 @@ module:hook("iq-get/self/urn:xmpp:blocking:blocklist", function (event)
end
end
origin.interested_blocklist = true; -- Gets notified about changes
- return origin.send(reply);
+ origin.send(reply);
+ return true;
end);
-- Add or remove some jid(s) from the blocklist
@@ -109,7 +110,8 @@ local function edit_blocklist(event)
for item in action:childtags("item") do
local jid = jid_prep(item.attr.jid);
if not jid then
- return origin.send(st_error_reply(stanza, "modify", "jid-malformed"));
+ origin.send(st_error_reply(stanza, "modify", "jid-malformed"));
+ return true;
end
item.attr.jid = jid; -- echo back prepped
new[jid] = is_contact_subscribed(username, module.host, jid) or false;
@@ -119,7 +121,8 @@ local function edit_blocklist(event)
if mode and not next(new) then
-- <block/> element does not contain at least one <item/> child element
- return origin.send(st_error_reply(stanza, "modify", "bad-request"));
+ origin.send(st_error_reply(stanza, "modify", "bad-request"));
+ return true;
end
local blocklist = get_blocklist(username);
@@ -141,7 +144,8 @@ local function edit_blocklist(event)
if ok then
origin.send(st.reply(stanza));
else
- return origin.send(st_error_reply(stanza, "wait", "internal-server-error", err));
+ origin.send(st_error_reply(stanza, "wait", "internal-server-error", err));
+ return true;
end
if mode then
@@ -208,7 +212,8 @@ end
local function bounce_stanza(event)
local origin, stanza = event.origin, event.stanza;
if drop_stanza(event) then
- return origin.send(st_error_reply(stanza, "cancel", "service-unavailable"));
+ origin.send(st_error_reply(stanza, "cancel", "service-unavailable"));
+ return true;
end
end
@@ -244,8 +249,9 @@ local function bounce_outgoing(event)
return drop_outgoing(event);
end
if drop_outgoing(event) then
- return origin.send(st_error_reply(stanza, "cancel", "not-acceptable", "You have blocked this JID")
+ origin.send(st_error_reply(stanza, "cancel", "not-acceptable", "You have blocked this JID")
:tag("blocked", { xmlns = "urn:xmpp:blocking:errors" }));
+ return true;
end
end