Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 6259:36f611624987
mod_s2s: Fire a 's2s-created' event when new s2s connections are initialized
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 24 May 2014 11:17:26 +0200 |
parent | 6257:9dace3a712f0 |
child | 6301:2fdd71b08126 |
comparison
equal
deleted
inserted
replaced
6257:9dace3a712f0 | 6259:36f611624987 |
---|---|
574 local handlestanza = stream_callbacks.handlestanza; | 574 local handlestanza = stream_callbacks.handlestanza; |
575 function session.dispatch_stanza(session, stanza) | 575 function session.dispatch_stanza(session, stanza) |
576 return handlestanza(session, stanza); | 576 return handlestanza(session, stanza); |
577 end | 577 end |
578 | 578 |
579 module:fire_event("s2s-created", { session = session }); | |
580 | |
579 add_task(connect_timeout, function () | 581 add_task(connect_timeout, function () |
580 if session.type == "s2sin" or session.type == "s2sout" then | 582 if session.type == "s2sin" or session.type == "s2sout" then |
581 return; -- Ok, we're connected | 583 return; -- Ok, we're connected |
582 elseif session.type == "s2s_destroyed" then | 584 elseif session.type == "s2s_destroyed" then |
583 return; -- Session already destroyed | 585 return; -- Session already destroyed |