mod_muc_block_pm: Advertise that Moderators are allowed to send PMs
authorKim Alvefur <zash@zash.se>
Wed, 19 Jul 2023 17:01:40 +0200
changeset 5614 67f7df9892bb
parent 5613 e469642e6a6c
child 5615 06fad22672e1
mod_muc_block_pm: Advertise that Moderators are allowed to send PMs But there appears to be no way in XEP-0045 to advertise that Anyone can send PMs *to* Moderators.
mod_muc_block_pm/mod_muc_block_pm.lua
--- a/mod_muc_block_pm/mod_muc_block_pm.lua	Wed Jul 19 16:59:16 2023 +0200
+++ b/mod_muc_block_pm/mod_muc_block_pm.lua	Wed Jul 19 17:01:40 2023 +0200
@@ -1,5 +1,9 @@
 local st = require "util.stanza";
 
+module:hook("muc-disco#info", function(event)
+	table.insert(event.form, { name = "muc#roomconfig_allowpm"; value = "moderators" });
+end);
+
 module:hook("muc-private-message", function(event)
 	local stanza, room = event.stanza, event.room;
 	local from_occupant = room:get_occupant_by_nick(stanza.attr.from);