aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-06-11 14:59:59 -0400
committerdaurnimator <quae@daurnimator.com>2014-06-11 14:59:59 -0400
commitbe47daf8e124b7f96a7081d9873a277bf1403858 (patch)
tree3f17cc93865aed9752581893a4c04f46d3d4eeb6 /plugins/muc/muc.lib.lua
parent473c08dc107419c8f0df2bb8a8c23a28369a5312 (diff)
downloadprosody-be47daf8e124b7f96a7081d9873a277bf1403858.tar.gz
prosody-be47daf8e124b7f96a7081d9873a277bf1403858.zip
plugins/muc/muc.lib: Deliver declines to in-room jids correctly
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 57cc3721..85c256a2 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -895,7 +895,11 @@ function room_mt:handle_mediated_decline(origin, stanza)
:up()
:up();
if not module:fire_event("muc-decline", {room = self, stanza = decline, origin = origin, incoming = stanza}) then
- local occupant = self:get_occupant_by_real_jid(decline.attr.to);
+ local declinee = decline.attr.to; -- re-fetch, in case event modified it
+ local occupant
+ if jid_bare(declinee) == self.jid then -- declinee jid is already an in-room jid
+ occupant = self:get_occupant_by_nick(declinee);
+ end
if occupant then
self:route_to_occupant(occupant, decline);
else