512 end |
512 end |
513 end |
513 end |
514 if not item.attr.jid and item.attr.nick then -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation |
514 if not item.attr.jid and item.attr.nick then -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation |
515 local occupant = self._occupants[self.jid.."/"..item.attr.nick]; |
515 local occupant = self._occupants[self.jid.."/"..item.attr.nick]; |
516 if occupant then item.attr.jid = occupant.jid; end |
516 if occupant then item.attr.jid = occupant.jid; end |
|
517 elseif not item.attr.nick and item.attr.jid then |
|
518 local nick = self._jid_nick[item.attr.jid]; |
|
519 if nick then item.attr.nick = select(3, jid_split(nick)); end |
517 end |
520 end |
518 local reason = item.tags[1] and item.tags[1].name == "reason" and #item.tags[1] == 1 and item.tags[1][1]; |
521 local reason = item.tags[1] and item.tags[1].name == "reason" and #item.tags[1] == 1 and item.tags[1][1]; |
519 if item.attr.affiliation and item.attr.jid and not item.attr.role then |
522 if item.attr.affiliation and item.attr.jid and not item.attr.role then |
520 local success, errtype, err = self:set_affiliation(actor, item.attr.jid, item.attr.affiliation, callback, reason); |
523 local success, errtype, err = self:set_affiliation(actor, item.attr.jid, item.attr.affiliation, callback, reason); |
521 if not success then origin.send(st.error_reply(stanza, errtype, err)); end |
524 if not success then origin.send(st.error_reply(stanza, errtype, err)); end |