comparison plugins/muc/subject.lib.lua @ 11200:bf8f2da84007

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 05 Nov 2020 22:31:25 +0100
parents a5acd6354845
children 74b9e05af71e
comparison
equal deleted inserted replaced
11199:6c7c50a4de32 11200:bf8f2da84007
92 -- e.g. body will be ignored; even if the subject change was not allowed 92 -- e.g. body will be ignored; even if the subject change was not allowed
93 module:hook("muc-occupant-groupchat", function(event) 93 module:hook("muc-occupant-groupchat", function(event)
94 local stanza = event.stanza; 94 local stanza = event.stanza;
95 local subject = stanza:get_child("subject"); 95 local subject = stanza:get_child("subject");
96 if subject then 96 if subject then
97 if stanza:get_child("body") or stanza:get_child("thread") then
98 -- Note: A message with a <subject/> and a <body/> or a <subject/> and
99 -- a <thread/> is a legitimate message, but it SHALL NOT be interpreted
100 -- as a subject change.
101 return;
102 end
97 local room = event.room; 103 local room = event.room;
98 local occupant = event.occupant; 104 local occupant = event.occupant;
99 -- Role check for subject changes 105 -- Role check for subject changes
100 local role_rank = valid_roles[occupant and occupant.role or "none"]; 106 local role_rank = valid_roles[occupant and occupant.role or "none"];
101 if role_rank >= valid_roles.moderator or 107 if role_rank >= valid_roles.moderator or