Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1254:c199be608546
stanza_router: Fire events for non-jabber:client and pre-auth stanzas
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 31 May 2009 02:20:30 +0500 |
parent | 1244:3df7417225fe |
child | 1256:98f0e9eadf3b |
comparison
equal
deleted
inserted
replaced
1253:60156584c442 | 1254:c199be608546 |
---|---|
113 return; -- FIXME what should we do here? does this work with subdomains? | 113 return; -- FIXME what should we do here? does this work with subdomains? |
114 end | 114 end |
115 end | 115 end |
116 core_post_stanza(origin, stanza); | 116 core_post_stanza(origin, stanza); |
117 else | 117 else |
118 local h = hosts[stanza.attr.to or origin.host or origin.to_host]; | |
119 if h then | |
120 local event; | |
121 if stanza.attr.xmlns == "jabber:client" then | |
122 if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get") then | |
123 event = "stanza/iq/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name; | |
124 else | |
125 event = "stanza/"..stanza.name; | |
126 end | |
127 else | |
128 event = "stanza/"..stanza.attr.xmlns..":"..stanza.name; | |
129 end | |
130 if h.events.fire_event(event, {origin = origin, stanza = stanza}) then return; end | |
131 end | |
118 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); |
119 end | 133 end |
120 end | 134 end |
121 | 135 |
122 function core_post_stanza(origin, stanza) | 136 function core_post_stanza(origin, stanza) |