# HG changeset patch # User Kim Alvefur # Date 1376164289 -7200 # Node ID 27b41ee61601c50f96b63d4c6593532d6acbae34 # Parent 9fa89dc7a86f335d45757b0b21068a287306f7b8 mod_mam_adhoc: Use the new adhoc permission level for local users diff -r 9fa89dc7a86f -r 27b41ee61601 mod_mam_adhoc/mod_mam_adhoc.lua --- a/mod_mam_adhoc/mod_mam_adhoc.lua Sat Aug 10 21:37:35 2013 +0200 +++ b/mod_mam_adhoc/mod_mam_adhoc.lua Sat Aug 10 21:51:29 2013 +0200 @@ -39,17 +39,12 @@ } local function mam_prefs_handler(self, data, state) - local username, hostname = jid_split(data.from); + local username = jid_split(data.from); if state then -- the second return value if data.action == "cancel" then return { status = "canceled" }; end - if not username or not hostname or hostname ~= module.host then - return { status = "error", error = { type = "cancel", - condition = "forbidden", message = "Invalid user or hostname." } }; - end - local fields = mam_prefs_form:data(data.form); local default, always, never = fields.default, fields.always, fields.never; @@ -99,4 +94,4 @@ end end -module:provides("adhoc", module:require"adhoc".new("Archive settings", "urn:xmpp:mam#configure", mam_prefs_handler)); +module:provides("adhoc", module:require"adhoc".new("Archive settings", "urn:xmpp:mam#configure", mam_prefs_handler, "local_user"));