Software /
code /
prosody-modules
Changeset
3270:7776c9dc5f37
mod_readonly: Simplify iq handling by hooking on iq-set/ instead of iq/.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 24 Aug 2018 21:35:47 +0200 |
parents | 3269:b0628bc93acf |
children | 3271:7504f765e767 |
files | mod_readonly/mod_readonly.lua |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_readonly/mod_readonly.lua Fri Aug 24 21:15:38 2018 +0200 +++ b/mod_readonly/mod_readonly.lua Fri Aug 24 21:35:47 2018 +0200 @@ -9,9 +9,8 @@ namespaces[table.concat(namespace, ":")] = name; end -function prevent_write(event) +local function prevent_write(event) local stanza = event.stanza; - if stanza.attr.type ~= "set" then return; end local xmlns_and_tag = stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name; local store_name = namespaces[xmlns_and_tag]; if store_name then @@ -22,5 +21,5 @@ end for namespace in pairs(namespaces) do - module:hook("iq/bare/"..namespace, prevent_write, 200); + module:hook("iq-set/bare/"..namespace, prevent_write, 200); end