Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 3251:f2f9fe088f6e
MUC: Updated room:get_default_role() to assign unaffiliated occupants a "visitor" role in moderated rooms.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sun, 13 Jun 2010 20:10:42 +0500 |
| parents | 38402e874b45 |
| children | 22062c50eabe |
comparison
equal
deleted
inserted
replaced
| 3250:38402e874b45 | 3251:f2f9fe088f6e |
|---|---|
| 86 room_mt.__index = room_mt; | 86 room_mt.__index = room_mt; |
| 87 | 87 |
| 88 function room_mt:get_default_role(affiliation) | 88 function room_mt:get_default_role(affiliation) |
| 89 if affiliation == "owner" or affiliation == "admin" then | 89 if affiliation == "owner" or affiliation == "admin" then |
| 90 return "moderator"; | 90 return "moderator"; |
| 91 elseif affiliation == "member" or not affiliation then | 91 elseif affiliation == "member" then |
| 92 return "participant"; | 92 return "participant"; |
| 93 elseif not affiliation then | |
| 94 return self:is_moderated() and "visitor" or "participant"; | |
| 93 end | 95 end |
| 94 end | 96 end |
| 95 | 97 |
| 96 function room_mt:broadcast_presence(stanza, sid, code, nick) | 98 function room_mt:broadcast_presence(stanza, sid, code, nick) |
| 97 stanza = get_filtered_presence(stanza); | 99 stanza = get_filtered_presence(stanza); |
