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 | 0fc08db387ae02f3b9c659401c4bf8fd25658ea8 (patch) | |
tree | 89497fc5d161abc4d2de09c04b05ea4fcd6119ad | |
parent | 38d1a05fee92a320301db02dfc189f5138fccfc7 (diff) | |
download | prosody-0fc08db387ae02f3b9c659401c4bf8fd25658ea8.tar.gz prosody-0fc08db387ae02f3b9c659401c4bf8fd25658ea8.zip |
plugins/muc/muc.lib: In `_route_stanza` access occupant data less often
-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 |