Changeset

1876:6d33e0521667

mod_dialback: Initiate dialback on incoming stream:features
author Matthew Wild <mwild1@gmail.com>
date Sun, 04 Oct 2009 14:10:24 +0100 (2009-10-04)
parents 1875:334383faf77b
children 1877:23c39f66406f
files plugins/mod_dialback.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_dialback.lua	Sun Oct 04 14:06:45 2009 +0100
+++ b/plugins/mod_dialback.lua	Sun Oct 04 14:10:24 2009 +0100
@@ -10,6 +10,7 @@
 local hosts = _G.hosts;
 local send_s2s = require "core.s2smanager".send_to_host;
 local s2s_make_authenticated = require "core.s2smanager".make_authenticated;
+local s2s_initiate_dialback = require "core.s2smanager".initiate_dialback;
 local s2s_verify_dialback = require "core.s2smanager".verify_dialback;
 local s2s_destroy_session = require "core.s2smanager".destroy_session;
 
@@ -17,6 +18,7 @@
 
 local st = require "util.stanza";
 
+local xmlns_stream = "http://etherx.jabber.org/streams";
 local xmlns_dialback = "jabber:server:dialback";
 
 local dialback_requests = setmetatable({}, { __mode = 'v' });
@@ -113,3 +115,8 @@
 			s2s_destroy_session(origin)
 		end
 	end);
+
+module:hook_stanza(xmlns_stream, "features", function (origin, stanza)
+		s2s_initiate_dialback(origin);
+		return true;
+	end, 100);