Comparison

plugins/mod_component.lua @ 6063:e626ee2fe106

mod_c2s, mod_s2s, mod_component, util.xmppstream: Move all session:open_stream() functions to util.xmppstream
author Kim Alvefur <zash@zash.se>
date Thu, 10 Apr 2014 13:13:07 +0200
parent 5954:6dc73be95213
child 6382:57d23c26039b
comparison
equal deleted inserted replaced
6062:6cc6b4d407df 6063:e626ee2fe106
175 end 175 end
176 session.host = attr.to; 176 session.host = attr.to;
177 session.streamid = uuid_gen(); 177 session.streamid = uuid_gen();
178 session.notopen = nil; 178 session.notopen = nil;
179 -- Return stream header 179 -- Return stream header
180 session.send("<?xml version='1.0'?>"); 180 session:open_stream();
181 session.send(st.stanza("stream:stream", { xmlns=xmlns_component,
182 ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.host }):top_tag());
183 end 181 end
184 182
185 function stream_callbacks.streamclosed(session) 183 function stream_callbacks.streamclosed(session)
186 session.log("debug", "Received </stream:stream>"); 184 session.log("debug", "Received </stream:stream>");
187 session:close(); 185 session:close();