# HG changeset patch # User Waqas Hussain # Date 1252337789 -18000 # Node ID 3c60081ca10a81f08f7a5fa525629e836477c1ad # Parent 15039fac3693b5a1ee75154839448a15a1da8987 MUC: Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation. diff -r 15039fac3693 -r 3c60081ca10a plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Mon Sep 07 20:35:09 2009 +0500 +++ b/plugins/muc/muc.lib.lua Mon Sep 07 20:36:29 2009 +0500 @@ -327,7 +327,11 @@ if item and item.name == "item" then if type == "set" then local callback = function() origin.send(st.reply(stanza)); end - if item.attr.affiliation and item.attr.jid and not item.attr.role and not item.attr.nick then + if not item.attr.jid and item.attr.nick then -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation + local occupant = self._occupants[self.jid.."/"..item.attr.nick]; + if occupant then item.attr.jid = occupant.jid; end + end + if item.attr.affiliation and item.attr.jid and not item.attr.role then local success, errtype, err = self:set_affiliation(actor, item.attr.jid, item.attr.affiliation, callback); if not success then origin.send(st.error_reply(stanza, errtype, err)); end elseif item.attr.role and item.attr.nick and not item.attr.affiliation then