Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1444:19598161ae22
stanza_router: Don't fire preprocessing events if stanza is not from full JID
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 29 Jun 2009 13:15:09 +0500 |
parent | 1419:1ac8bcc63a9d |
child | 1445:810037988642 |
comparison
equal
deleted
inserted
replaced
1441:9c6c7aa5dc60 | 1444:19598161ae22 |
---|---|
137 to_type = '/bare'; | 137 to_type = '/bare'; |
138 end | 138 end |
139 end | 139 end |
140 | 140 |
141 local event_data = {origin=origin, stanza=stanza}; | 141 local event_data = {origin=origin, stanza=stanza}; |
142 if origin.full_jid then -- c2s connection | 142 if origin.full_jid == stanza.attr.from then -- c2s connection |
143 if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing | 143 if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing |
144 end | 144 end |
145 local h = hosts[to_bare] or hosts[host or origin.host]; | 145 local h = hosts[to_bare] or hosts[host or origin.host]; |
146 if h then | 146 if h then |
147 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing | 147 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing |