Software /
code /
prosody
Comparison
plugins/mod_dialback.lua @ 4835:751510cd558d
mod_dialback: COMPAT reset session.send function for servers (e.g. ejabberd) which don't include a from attr when opening the stream.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Wed, 09 May 2012 02:56:22 +0000 |
parent | 4761:178f252c31b0 |
child | 4836:bda0593d3f73 |
child | 4840:82679fad3a36 |
comparison
equal
deleted
inserted
replaced
4821:deec69fc33e5 | 4835:751510cd558d |
---|---|
76 dialback_requests[attr.from.."/"..origin.streamid] = origin; | 76 dialback_requests[attr.from.."/"..origin.streamid] = origin; |
77 | 77 |
78 if not origin.from_host then | 78 if not origin.from_host then |
79 -- Just used for friendlier logging | 79 -- Just used for friendlier logging |
80 origin.from_host = attr.from; | 80 origin.from_host = attr.from; |
81 -- COMPAT: Fix ejabberd chopness by resetting the send function | |
82 origin.log("debug", "Remote server didn't specify a from attr, resetting session.send now that we know where to knock to."); | |
83 origin.send = function(stanza) hosts[attr.to].events.fire_event("route/remote", { from_host = origin.to_host, to_host = origin.from_host, stanza = stanza}); end | |
81 end | 84 end |
82 if not origin.to_host then | 85 if not origin.to_host then |
83 -- Just used for friendlier logging | 86 -- Just used for friendlier logging |
84 origin.to_host = attr.to; | 87 origin.to_host = attr.to; |
85 end | 88 end |