# HG changeset patch # User Waqas Hussain # Date 1264781076 -18000 # Node ID 298d0ed3f40df024f135ecd6323c798de58b3082 # Parent 7929882435c08882562bebfbd58b93a253e2fcf6 stanza_router: Added third parameter to core_post_stanza, to control pre-events. diff -r 7929882435c0 -r 298d0ed3f40d core/stanza_router.lua --- a/core/stanza_router.lua Fri Jan 29 18:16:39 2010 +0500 +++ b/core/stanza_router.lua Fri Jan 29 21:04:36 2010 +0500 @@ -98,7 +98,7 @@ return; -- FIXME what should we do here? does this work with subdomains? end end - core_post_stanza(origin, stanza); + core_post_stanza(origin, stanza, origin.full_jid); else local h = hosts[stanza.attr.to or origin.host or origin.to_host]; if h then @@ -119,7 +119,7 @@ end end -function core_post_stanza(origin, stanza) +function core_post_stanza(origin, stanza, preevents) local to = stanza.attr.to; local node, host, resource = jid_split(to); local to_bare = node and (node.."@"..host) or host; -- bare JID @@ -143,7 +143,7 @@ end local event_data = {origin=origin, stanza=stanza}; - if origin.full_jid == stanza.attr.from then -- c2s connection + if preevents then -- c2s connection if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing end local h = hosts[to_bare] or hosts[host or origin.host];