mod_sasl2/mod_sasl2.lua
changeset 5053 e89aad13a52a
parent 5052 3697d19d5fd9
child 5067 53145c6b6b0b
equal deleted inserted replaced
5052:3697d19d5fd9 5053:e89aad13a52a
   156 
   156 
   157 module:hook("sasl2/c2s/success", function (event)
   157 module:hook("sasl2/c2s/success", function (event)
   158 	local session = event.session
   158 	local session = event.session
   159 	event.success:text_tag("authorization-identifier", jid_join(session.username, session.host, session.resource));
   159 	event.success:text_tag("authorization-identifier", jid_join(session.username, session.host, session.resource));
   160 	session.send(event.success);
   160 	session.send(event.success);
       
   161 end, -1000);
       
   162 
       
   163 module:hook("sasl2/c2s/success", function (event)
       
   164 	local session = event.session;
   161 	local features = st.stanza("stream:features");
   165 	local features = st.stanza("stream:features");
   162 	module:fire_event("stream-features", { origin = session, features = features });
   166 	module:fire_event("stream-features", { origin = session, features = features });
   163 	session.send(features);
   167 	session.send(features);
   164 end, -1000);
   168 end, -1500);
   165 
   169 
   166 -- The gap here is to allow modules to do stuff to the stream after the stanza
   170 -- The gap here is to allow modules to do stuff to the stream after the stanza
   167 -- is sent, but before we proceed with anything else. This is expected to be
   171 -- is sent, but before we proceed with anything else. This is expected to be
   168 -- a common pattern with SASL2, which allows atomic negotiation of a bunch of
   172 -- a common pattern with SASL2, which allows atomic negotiation of a bunch of
   169 -- stream features.
   173 -- stream features.