changeset 4014:1b68954a743a

mod_csi_muc_priorities: Report reason for importance decision
author Kim Alvefur <zash@zash.se>
date Sat, 09 May 2020 21:14:59 +0200 (2020-05-09)
parents e1e337dc05b6
children 001c756ead7d
files mod_csi_muc_priorities/mod_csi_muc_priorities.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_csi_muc_priorities/mod_csi_muc_priorities.lua	Sat May 09 21:14:36 2020 +0200
+++ b/mod_csi_muc_priorities/mod_csi_muc_priorities.lua	Sat May 09 21:14:59 2020 +0200
@@ -15,6 +15,7 @@
 			if priorities then
 				local priority = priorities[room_jid];
 				if priority ~= nil then
+					event.reason = "muc priority";
 					return priority;
 				end
 			end
@@ -27,10 +28,12 @@
 				local room_nick = rooms[room_jid];
 				if room_nick then
 					if body:find(room_nick, 1, true) then
+						event.reason = "muc mention";
 						return true;
 					end
 					-- Your own messages
 					if stanza.attr.from == (room_jid .. "/" .. room_nick) then
+					event.reason = "muc own message";
 						return true;
 					end
 				end