Comparison

plugins/muc/muc.lib.lua @ 12026:f3b09b8445b3

MUC: Return a friendly textual error when trying to speak without voice I spend several minutes confused over where the bug was until I remembered I had set myself as visitor in the previous debug session. This would have helped.
author Kim Alvefur <zash@zash.se>
date Wed, 08 Dec 2021 16:40:51 +0100
parent 12010:f995d62044fa
child 12027:5fb16f41f861
comparison
equal deleted inserted replaced
12025:6ed7fd28f5e3 12026:f3b09b8445b3
1216 local role_rank = valid_roles[event.occupant and event.occupant.role or "none"]; 1216 local role_rank = valid_roles[event.occupant and event.occupant.role or "none"];
1217 if role_rank <= valid_roles.none then 1217 if role_rank <= valid_roles.none then
1218 event.origin.send(st.error_reply(event.stanza, "cancel", "not-acceptable", "You are not currently connected to this chat")); 1218 event.origin.send(st.error_reply(event.stanza, "cancel", "not-acceptable", "You are not currently connected to this chat"));
1219 return true; 1219 return true;
1220 elseif role_rank <= valid_roles.visitor then 1220 elseif role_rank <= valid_roles.visitor then
1221 event.origin.send(st.error_reply(event.stanza, "auth", "forbidden")); 1221 event.origin.send(st.error_reply(event.stanza, "auth", "forbidden",
1222 "You do not currently have permission to speak in this chat"));
1222 return true; 1223 return true;
1223 end 1224 end
1224 end, 50); 1225 end, 50);
1225 1226
1226 -- hack - some buggy clients send presence updates to the room rather than their nick 1227 -- hack - some buggy clients send presence updates to the room rather than their nick