Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1263:7797354dc9b5
Merge backout with following commits
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 01 Jun 2009 02:06:02 +0100 |
parent | 1258:01b69efffb1c |
parent | 1262:0d94c57555d9 |
child | 1269:b06d6674477b |
comparison
equal
deleted
inserted
replaced
1261:497178e0ddbe | 1263:7797354dc9b5 |
---|---|
125 event = "stanza/"..stanza.name; | 125 event = "stanza/"..stanza.name; |
126 end | 126 end |
127 else | 127 else |
128 event = "stanza/"..stanza.attr.xmlns..":"..stanza.name; | 128 event = "stanza/"..stanza.attr.xmlns..":"..stanza.name; |
129 end | 129 end |
130 if (h.events or prosody.events).fire_event(event, {origin = origin, stanza = stanza}) then return; end | 130 if h.events.fire_event(event, {origin = origin, stanza = stanza}) then return; end |
131 end | 131 end |
132 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); | 132 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); |
133 end | 133 end |
134 end | 134 end |
135 | 135 |
153 end | 153 end |
154 end | 154 end |
155 | 155 |
156 local event_data = {origin=origin, stanza=stanza}; | 156 local event_data = {origin=origin, stanza=stanza}; |
157 if origin.full_jid then -- c2s connection | 157 if origin.full_jid then -- c2s connection |
158 if (hosts[origin.host].events or prosody.events).fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing | 158 if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing |
159 end | 159 end |
160 local h = hosts[to_bare] or hosts[host or origin.host]; | 160 local h = hosts[to_bare] or hosts[host or origin.host]; |
161 if h then | 161 if h then |
162 if h.type == "component" then | 162 if h.type == "component" then |
163 component_handle_stanza(origin, stanza); | 163 component_handle_stanza(origin, stanza); |
164 return; | 164 return; |
165 else | 165 else |
166 if (h.events or prosody.events).fire_event(stanza.name..to_type, event_data) then return; end -- do processing | 166 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing |
167 end | 167 end |
168 end | 168 end |
169 | 169 |
170 if host and fire_event(host.."/"..stanza.name, event_data) then | 170 if host and fire_event(host.."/"..stanza.name, event_data) then |
171 -- event handled | 171 -- event handled |