Changeset

9684:b2d6b79c9513

MUC/subject: Don't consider messages with <body> or <subject> (fixes #667)
author Kim Alvefur <zash@zash.se>
date Tue, 04 Dec 2018 19:49:31 +0100
parents 9683:bf32f2282b18
children 9685:e98b901446d0
files plugins/muc/subject.lib.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/subject.lib.lua	Tue Dec 04 16:19:58 2018 +0000
+++ b/plugins/muc/subject.lib.lua	Tue Dec 04 19:49:31 2018 +0100
@@ -94,6 +94,12 @@
 	local stanza = event.stanza;
 	local subject = stanza:get_child("subject");
 	if subject then
+		if stanza:get_child("body") or stanza:get_child("thread") then
+			-- Note: A message with a <subject/> and a <body/> or a <subject/> and
+			-- a <thread/> is a legitimate message, but it SHALL NOT be interpreted
+			-- as a subject change.
+			return;
+		end
 		local room = event.room;
 		local occupant = event.occupant;
 		-- Role check for subject changes