diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-06-13 20:10:42 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-06-13 20:10:42 +0500 |
commit | 55a682f29bf8540ddaf5bd04284c91e04046973d (patch) | |
tree | 053b3c7683c8b522242d72afc43b2c71f416e9c2 /plugins/muc | |
parent | a209d3f9d650e690ec1e51441a4b8ed2f9630e68 (diff) | |
download | prosody-55a682f29bf8540ddaf5bd04284c91e04046973d.tar.gz prosody-55a682f29bf8540ddaf5bd04284c91e04046973d.zip |
MUC: Updated room:get_default_role() to assign unaffiliated occupants a "visitor" role in moderated rooms.
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/muc.lib.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 6e50a9b3..50100557 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -88,8 +88,10 @@ room_mt.__index = room_mt; function room_mt:get_default_role(affiliation) if affiliation == "owner" or affiliation == "admin" then return "moderator"; - elseif affiliation == "member" or not affiliation then + elseif affiliation == "member" then return "participant"; + elseif not affiliation then + return self:is_moderated() and "visitor" or "participant"; end end |