Software /
code /
prosody
Comparison
plugins/mod_component.lua @ 1405:19269d278c38
mod_component: Rewrite jabber:client stanzas to jabber:component:accept, thanks JaredH!
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 25 Jun 2009 01:38:53 +0100 |
parent | 1108:368754c54045 |
child | 1523:841d61be198f |
comparison
equal
deleted
inserted
replaced
1404:12abd2da8885 | 1405:19269d278c38 |
---|---|
62 log("info", "Component authenticated: %s", session.host); | 62 log("info", "Component authenticated: %s", session.host); |
63 | 63 |
64 -- If component not already created for this host, create one now | 64 -- If component not already created for this host, create one now |
65 if not hosts[session.host].connected then | 65 if not hosts[session.host].connected then |
66 local send = session.send; | 66 local send = session.send; |
67 session.component_session = cm_register_component(session.host, function (_, data) return send(data); end); | 67 session.component_session = cm_register_component(session.host, function (_, data) |
68 if data.attr and data.attr.xmlns == "jabber:client" then | |
69 data.attr.xmlns = nil; | |
70 end | |
71 return send(data); | |
72 end); | |
68 hosts[session.host].connected = true; | 73 hosts[session.host].connected = true; |
69 log("info", "Component successfully registered"); | 74 log("info", "Component successfully registered"); |
70 else | 75 else |
71 log("error", "Multiple components bound to the same address, first one wins (TODO: Implement stanza distribution)"); | 76 log("error", "Multiple components bound to the same address, first one wins (TODO: Implement stanza distribution)"); |
72 end | 77 end |