mod_restrict_xmpp: Treat archive query as a read despite using iq-set
authorKim Alvefur <zash@zash.se>
Mon, 22 Aug 2022 23:51:07 +0200
changeset 5014 a1f49586d28a
parent 5013 459a4001c1d9
child 5015 55cf7f063af6
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.
mod_restrict_xmpp/mod_restrict_xmpp.lua
--- 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