diff options
author | daurnimator <quae@daurnimator.com> | 2014-03-19 14:35:17 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-03-19 14:35:17 -0400 |
commit | eb0de6b20278678f98b948f971a3c4a1a6958ff7 (patch) | |
tree | 89497fc5d161abc4d2de09c04b05ea4fcd6119ad /plugins/muc | |
parent | bd65d4b2a15b57bd65f1167261825325d0917708 (diff) | |
download | prosody-eb0de6b20278678f98b948f971a3c4a1a6958ff7.tar.gz prosody-eb0de6b20278678f98b948f971a3c4a1a6958ff7.zip |
plugins/muc/muc.lib: In `_route_stanza` access occupant data less often
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/muc.lib.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 2fb1a34e..1a5bc976 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1210,9 +1210,9 @@ end function room_mt:_route_stanza(stanza) local muc_child; - local to_occupant = self._occupants[self._jid_nick[stanza.attr.to]]; - local from_occupant = self._occupants[stanza.attr.from]; if stanza.name == "presence" then + local to_occupant = self._occupants[self._jid_nick[stanza.attr.to]]; + local from_occupant = self._occupants[stanza.attr.from]; if to_occupant and from_occupant then if self._data.whois == 'anyone' then muc_child = stanza:get_child("x", "http://jabber.org/protocol/muc#user"); @@ -1222,13 +1222,13 @@ function room_mt:_route_stanza(stanza) end end end - end - if muc_child then - for item in muc_child:childtags("item") do - if from_occupant == to_occupant then - item.attr.jid = stanza.attr.to; - else - item.attr.jid = from_occupant.jid; + if muc_child then + for item in muc_child:childtags("item") do + if from_occupant == to_occupant then + item.attr.jid = stanza.attr.to; + else + item.attr.jid = from_occupant.jid; + end end end end |