Comparison

plugins/muc/subject.lib.lua @ 10411:db2a06b9ff98

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 16 Nov 2019 16:52:31 +0100
parent 9684:b2d6b79c9513
child 11141:a5acd6354845
comparison
equal deleted inserted replaced
10410:659b577f280c 10411:db2a06b9ff98
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