mod_restrict_xmpp: Treat archive query as a read despite using iq-set
XEP-0313 uses iq-set to initiate a query, but unlike many other uses of
iq-set, this does not mutate anything on the server, so it should not be
treated as a write request.
--- a/mod_restrict_xmpp/mod_restrict_xmpp.lua Mon Aug 22 20:03:23 2022 +0100
+++ b/mod_restrict_xmpp/mod_restrict_xmpp.lua Mon Aug 22 23:51:07 2022 +0200
@@ -80,6 +80,8 @@
elseif proto == "carbons" then
-- This allows access to live messages
proto, action = "messages", "read";
+ elseif proto == "history" then
+ action = "read";
end
local permission_name = "xmpp:account:"..(proto and (proto..":") or "")..action;
if not module:may(permission_name, event) then