Mercurial > prosody-modules
comparison mod_muc_restrict_rooms/mod_muc_restrict_rooms.lua @ 1614:79adec50b24d
mod_muc_restrict_rooms: Fixed the way of getting room and user
author | Nicolás Kovac <nkneumann(at)gmail.com> |
---|---|
date | Fri, 20 Feb 2015 22:45:45 +0000 |
parents | ca04f75958f7 |
children |
comparison
equal
deleted
inserted
replaced
1613:ca04f75958f7 | 1614:79adec50b24d |
---|---|
42 if stanza.name == "presence" and stanza.attr.type == "unavailable" then -- Leaving events get discarded | 42 if stanza.name == "presence" and stanza.attr.type == "unavailable" then -- Leaving events get discarded |
43 return; | 43 return; |
44 end | 44 end |
45 | 45 |
46 -- Get the room | 46 -- Get the room |
47 local room = jid.split(stanza.attr.from); | 47 local room = jid.split(stanza.attr.to); |
48 if not room then return; end | 48 if not room then return; end |
49 | 49 |
50 -- Get who has tried to join it | 50 -- Get who has tried to join it |
51 local who = jid.bare(stanza.attr.to) | 51 local who = jid.bare(stanza.attr.from) |
52 | 52 |
53 -- Checking whether room is restricted | 53 -- Checking whether room is restricted |
54 local check_restricted = is_restricted(room, who) | 54 local check_restricted = is_restricted(room, who) |
55 if check_restricted ~= nil then | 55 if check_restricted ~= nil then |
56 event.allowed = false; | 56 event.allowed = false; |