aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-19 17:46:25 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-19 17:46:25 -0400
commit35a820aba5a9017d350fe907bf4fe7b463e0f185 (patch)
treec745ad1d855c6a9f045a9cbb21604b939363bb1b /plugins/muc
parent0fc61fbaad4abf9d600c731e50bb9a414d6345d8 (diff)
downloadprosody-35a820aba5a9017d350fe907bf4fe7b463e0f185.tar.gz
prosody-35a820aba5a9017d350fe907bf4fe7b463e0f185.zip
plugins/muc/muc.lib: Use `get_role` in `handle_admin_item_get_command`. Removed a TODO that's already done
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 7cc1beb4..fe8aee72 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -862,8 +862,6 @@ end
function room_mt:handle_admin_item_get_command(origin, stanza)
local actor = stanza.attr.from;
local affiliation = self:get_affiliation(actor);
- local current_nick = self:get_occupant_jid(actor);
- local role = current_nick and self._occupants[current_nick].role or self:get_default_role(affiliation);
local item = stanza.tags[1].tags[1];
local _aff = item.attr.affiliation;
local _rol = item.attr.role;
@@ -882,8 +880,8 @@ function room_mt:handle_admin_item_get_command(origin, stanza)
return true;
end
elseif _rol and not _aff then
+ local role = self:get_role(self:get_occupant_jid(actor)) or self:get_default_role(affiliation);
if role == "moderator" then
- -- TODO allow admins and owners not in room? Provide read-only access to everyone who can see the participants anyway?
if _rol == "none" then _rol = nil; end
local reply = st.reply(stanza):query("http://jabber.org/protocol/muc#admin");
for occupant_jid, occupant in pairs(self._occupants) do