Comparison

mod_muc_require_tos/mod_muc_require_tos.lua @ 4692:37232302dfb9

mod_muc_require_tos: Prevent a traceback when receiving a message with occupant being nil
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 16 Sep 2021 22:47:52 +0200
parent 4691:1f1dbf652b37
child 4693:59f53cf66573
comparison
equal deleted inserted replaced
4691:1f1dbf652b37 4692:37232302dfb9
26 end 26 end
27 end, 19); 27 end, 19);
28 28
29 module:hook("muc-occupant-groupchat", function(event) 29 module:hook("muc-occupant-groupchat", function(event)
30 local occupant = event.occupant; 30 local occupant = event.occupant;
31 if occupant.role ~= "visitor" then 31 if occupant == nil or occupant.role ~= "visitor" then
32 return; 32 return;
33 end 33 end
34 local origin = event.origin; 34 local origin = event.origin;
35 local room = event.room; 35 local room = event.room;
36 local stanza = event.stanza; 36 local stanza = event.stanza;