Changeset

5616:e469642e6a6c

mod_muc_block_pm: Allow private messages to yourself No harm in it. Beagle apparently uses it for XEP-0333 in public channels
author Kim Alvefur <zash@zash.se>
date Wed, 19 Jul 2023 16:59:16 +0200
parents 5615:1893ae742f66
children 5617:67f7df9892bb
files mod_muc_block_pm/mod_muc_block_pm.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_block_pm/mod_muc_block_pm.lua	Wed Jul 19 13:05:47 2023 +0200
+++ b/mod_muc_block_pm/mod_muc_block_pm.lua	Wed Jul 19 16:59:16 2023 +0200
@@ -13,6 +13,10 @@
 		return -- messaging moderators is ok
 	end
 
+	if to_occupant.bare_jid == from_occupant.bare_jid then
+		return -- to yourself is okay, used by some clients to sync read state in public channels
+	end
+
 	room:route_to_occupant(from_occupant, st.error_reply(stanza, "cancel", "policy-violation", "Private messages are disabled", room.jid))
 	return false;
 end, 1);