comparison mod_muc_block_pm/mod_muc_block_pm.lua @ 5610:67f7df9892bb

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.
author Kim Alvefur <zash@zash.se>
date Wed, 19 Jul 2023 17:01:40 +0200
parents e469642e6a6c
children
comparison
equal deleted inserted replaced
5609:e469642e6a6c 5610:67f7df9892bb
1 local st = require "util.stanza"; 1 local st = require "util.stanza";
2
3 module:hook("muc-disco#info", function(event)
4 table.insert(event.form, { name = "muc#roomconfig_allowpm"; value = "moderators" });
5 end);
2 6
3 module:hook("muc-private-message", function(event) 7 module:hook("muc-private-message", function(event)
4 local stanza, room = event.stanza, event.room; 8 local stanza, room = event.stanza, event.room;
5 local from_occupant = room:get_occupant_by_nick(stanza.attr.from); 9 local from_occupant = room:get_occupant_by_nick(stanza.attr.from);
6 10