# HG changeset patch # User daurnimator # Date 1395260891 14400 # Node ID 7f82bbd249feb75baa268c1cd93ad03e834a65ae # Parent 44a84674481461c7e386dfea6a4f7613e7e7438f plugins/muc/muc.lib: Remove `payload` argument from `handle_mediated_*`; extract it from inside. diff -r 44a846744814 -r 7f82bbd249fe plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Wed Mar 19 16:24:17 2014 -0400 +++ b/plugins/muc/muc.lib.lua Wed Mar 19 16:28:11 2014 -0400 @@ -983,7 +983,8 @@ return handled; end -function room_mt:handle_mediated_invite(origin, stanza, payload) +function room_mt:handle_mediated_invite(origin, stanza) + local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("invite") local _from, _to = stanza.attr.from, stanza.attr.to; local current_nick = self:get_occupant_jid(_from) if not current_nick then -- Should be in room to send invite TODO: allow admins to send at any time @@ -1030,7 +1031,8 @@ end end) -function room_mt:handle_mediated_decline(origin, stanza, payload) +function room_mt:handle_mediated_decline(origin, stanza) + local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("decline") local declinee = jid_prep(payload.attr.to); if declinee then local from, to = stanza.attr.from, stanza.attr.to; @@ -1066,9 +1068,9 @@ if payload == nil then -- fallthrough elseif payload.name == "invite" and payload.attr.to then - return self:handle_mediated_invite(origin, stanza, payload) + return self:handle_mediated_invite(origin, stanza) elseif payload.name == "decline" and payload.attr.to then - return self:handle_mediated_decline(origin, stanza, payload) + return self:handle_mediated_decline(origin, stanza) end origin.send(st.error_reply(stanza, "cancel", "bad-request")); return true;