# HG changeset patch # User Waqas Hussain # Date 1276441842 -18000 # Node ID f2f9fe088f6e52546a8932f3cf0880472ffdffbf # Parent 38402e874b451a6c4a137e3af8b8f90e15d221b4 MUC: Updated room:get_default_role() to assign unaffiliated occupants a "visitor" role in moderated rooms. diff -r 38402e874b45 -r f2f9fe088f6e plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Sun Jun 13 20:08:51 2010 +0500 +++ b/plugins/muc/muc.lib.lua Sun Jun 13 20:10:42 2010 +0500 @@ -88,8 +88,10 @@ 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