diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-09-07 20:36:29 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-09-07 20:36:29 +0500 |
commit | b9cc8c267d3170f7796a7410e038578c2834d475 (patch) | |
tree | 053a395b45baa77fd8fcad5afa24138a9bd7d9bd /plugins/muc | |
parent | a786afa14d3eadc24e91cd7b60eb82784e7740d3 (diff) | |
download | prosody-b9cc8c267d3170f7796a7410e038578c2834d475.tar.gz prosody-b9cc8c267d3170f7796a7410e038578c2834d475.zip |
MUC: Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation.
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/muc.lib.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 8538d01a..bc38ae9c 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -327,7 +327,11 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha 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 |