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
commit79b2d37386a35b6f3184cb5fdaada94efa9a5a4d (patch)
tree3f17cc93865aed9752581893a4c04f46d3d4eeb6 /plugins/muc/muc.lib.lua
parent2399b7c676168a3dad3555f8c3be2e0e1c9d58cc (diff)
downloadprosody-79b2d37386a35b6f3184cb5fdaada94efa9a5a4d.tar.gz
prosody-79b2d37386a35b6f3184cb5fdaada94efa9a5a4d.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