Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6275:d891fa02e5e5
plugins/muc/muc.lib: Deliver declines to in-room jids correctly
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Wed, 11 Jun 2014 14:59:59 -0400 |
| parents | 77bdbaec3b7f |
| children | f2c9c36979b3 |
comparison
equal
deleted
inserted
replaced
| 6274:77bdbaec3b7f | 6275:d891fa02e5e5 |
|---|---|
| 893 :tag("decline", {from = stanza.attr.from}) | 893 :tag("decline", {from = stanza.attr.from}) |
| 894 :tag("reason"):text(payload:get_child_text("reason")):up() | 894 :tag("reason"):text(payload:get_child_text("reason")):up() |
| 895 :up() | 895 :up() |
| 896 :up(); | 896 :up(); |
| 897 if not module:fire_event("muc-decline", {room = self, stanza = decline, origin = origin, incoming = stanza}) then | 897 if not module:fire_event("muc-decline", {room = self, stanza = decline, origin = origin, incoming = stanza}) then |
| 898 local occupant = self:get_occupant_by_real_jid(decline.attr.to); | 898 local declinee = decline.attr.to; -- re-fetch, in case event modified it |
| 899 local occupant | |
| 900 if jid_bare(declinee) == self.jid then -- declinee jid is already an in-room jid | |
| 901 occupant = self:get_occupant_by_nick(declinee); | |
| 902 end | |
| 899 if occupant then | 903 if occupant then |
| 900 self:route_to_occupant(occupant, decline); | 904 self:route_to_occupant(occupant, decline); |
| 901 else | 905 else |
| 902 self:route_stanza(decline); | 906 self:route_stanza(decline); |
| 903 end | 907 end |
