Software / code / prosody
Comparison
plugins/muc/register.lib.lua @ 9262:37b7cf3470f1
MUC: Move comment for clarity
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 04 Sep 2018 11:57:41 +0100 |
| parent | 9240:f9a83aca4421 |
| child | 9298:2d71040a959f |
comparison
equal
deleted
inserted
replaced
| 9261:9db9e37610b7 | 9262:37b7cf3470f1 |
|---|---|
| 159 if reserved_by and reserved_by ~= user_jid then | 159 if reserved_by and reserved_by ~= user_jid then |
| 160 origin.send(st.error_reply(stanza, "cancel", "conflict")); | 160 origin.send(st.error_reply(stanza, "cancel", "conflict")); |
| 161 return true; | 161 return true; |
| 162 end | 162 end |
| 163 | 163 |
| 164 -- Kick any sessions that are not using this nick before we register it | |
| 165 if enforce_nick then | 164 if enforce_nick then |
| 165 -- Kick any sessions that are not using this nick before we register it | |
| 166 local required_room_nick = room.jid.."/"..desired_nick; | 166 local required_room_nick = room.jid.."/"..desired_nick; |
| 167 for room_nick, occupant in room:each_occupant() do | 167 for room_nick, occupant in room:each_occupant() do |
| 168 if occupant.bare_jid == user_jid and room_nick ~= required_room_nick then | 168 if occupant.bare_jid == user_jid and room_nick ~= required_room_nick then |
| 169 room:set_role(true, room_nick, nil); -- Kick (TODO: would be nice to use 333 code) | 169 room:set_role(true, room_nick, nil); -- Kick (TODO: would be nice to use 333 code) |
| 170 end | 170 end |