Comparison

plugins/muc/muc.lib.lua @ 5024:d25e1b9332cc

Merge with Florob
author Matthew Wild <mwild1@gmail.com>
date Sat, 28 Jul 2012 01:14:31 +0100
parent 4999:d5a3c5c1873c
child 5061:186f34d88073
comparison
equal deleted inserted replaced
5023:dcc8e789df36 5024:d25e1b9332cc
854 local current_nick = self._jid_nick[from]; 854 local current_nick = self._jid_nick[from];
855 local occupant = self._occupants[current_nick]; 855 local occupant = self._occupants[current_nick];
856 if not occupant then -- not in room 856 if not occupant then -- not in room
857 origin.send(st.error_reply(stanza, "cancel", "not-acceptable")); 857 origin.send(st.error_reply(stanza, "cancel", "not-acceptable"));
858 elseif occupant.role == "visitor" then 858 elseif occupant.role == "visitor" then
859 origin.send(st.error_reply(stanza, "cancel", "forbidden")); 859 origin.send(st.error_reply(stanza, "auth", "forbidden"));
860 else 860 else
861 local from = stanza.attr.from; 861 local from = stanza.attr.from;
862 stanza.attr.from = current_nick; 862 stanza.attr.from = current_nick;
863 local subject = getText(stanza, {"subject"}); 863 local subject = getText(stanza, {"subject"});
864 if subject then 864 if subject then
865 if occupant.role == "moderator" or 865 if occupant.role == "moderator" or
866 ( self._data.changesubject and occupant.role == "participant" ) then -- and participant 866 ( self._data.changesubject and occupant.role == "participant" ) then -- and participant
867 self:set_subject(current_nick, subject); -- TODO use broadcast_message_stanza 867 self:set_subject(current_nick, subject); -- TODO use broadcast_message_stanza
868 else 868 else
869 stanza.attr.from = from; 869 stanza.attr.from = from;
870 origin.send(st.error_reply(stanza, "cancel", "forbidden")); 870 origin.send(st.error_reply(stanza, "auth", "forbidden"));
871 end 871 end
872 else 872 else
873 self:broadcast_message(stanza, self:get_historylength() > 0); 873 self:broadcast_message(stanza, self:get_historylength() > 0);
874 end 874 end
875 stanza.attr.from = from; 875 stanza.attr.from = from;