Comparison

plugins/muc/muc.lib.lua @ 2864:1ce0e2ceb419

MUC: Allow role changes based on JIDs. (transplanted from a4879b1e6cde5aedb6bd5827d710b6dba5e8a736)
author Waqas Hussain <waqas20@gmail.com>
date Thu, 18 Feb 2010 14:28:52 +0500
parent 2845:f76139aa7cd5
child 2923:b7049746bd29
comparison
equal deleted inserted replaced
2863:b5924a017849 2864:1ce0e2ceb419
461 end 461 end
462 end 462 end
463 if not item.attr.jid and item.attr.nick then -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation 463 if not item.attr.jid and item.attr.nick then -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation
464 local occupant = self._occupants[self.jid.."/"..item.attr.nick]; 464 local occupant = self._occupants[self.jid.."/"..item.attr.nick];
465 if occupant then item.attr.jid = occupant.jid; end 465 if occupant then item.attr.jid = occupant.jid; end
466 elseif not item.attr.nick and item.attr.jid then
467 local nick = self._jid_nick[item.attr.jid];
468 if nick then item.attr.nick = select(3, jid_split(nick)); end
466 end 469 end
467 local reason = item.tags[1] and item.tags[1].name == "reason" and #item.tags[1] == 1 and item.tags[1][1]; 470 local reason = item.tags[1] and item.tags[1].name == "reason" and #item.tags[1] == 1 and item.tags[1][1];
468 if item.attr.affiliation and item.attr.jid and not item.attr.role then 471 if item.attr.affiliation and item.attr.jid and not item.attr.role then
469 local success, errtype, err = self:set_affiliation(actor, item.attr.jid, item.attr.affiliation, callback, reason); 472 local success, errtype, err = self:set_affiliation(actor, item.attr.jid, item.attr.affiliation, callback, reason);
470 if not success then origin.send(st.error_reply(stanza, errtype, err)); end 473 if not success then origin.send(st.error_reply(stanza, errtype, err)); end