core/xmlhandlers.lua

changeset 7
dcc5ac721c20
parent 1
b8787e859fd2
child 20
6885fd2cf51f
equal deleted inserted replaced
6:7ad47ce20394 7:dcc5ac721c20
40 session.host = attr.to or error("Client failed to specify destination hostname"); 40 session.host = attr.to or error("Client failed to specify destination hostname");
41 session.version = attr.version or 0; 41 session.version = attr.version or 0;
42 session.streamid = m_random(1000000, 99999999); 42 session.streamid = m_random(1000000, 99999999);
43 print(session, session.host, "Client opened stream"); 43 print(session, session.host, "Client opened stream");
44 send("<?xml version='1.0'?>"); 44 send("<?xml version='1.0'?>");
45 send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' >", session.streamid, session.host)); 45 send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0'>", session.streamid, session.host));
46 --send("<stream:features>"); 46 --send("<stream:features>");
47 --send("<mechanism>PLAIN</mechanism>"); 47 --send("<mechanism>PLAIN</mechanism>");
48 --send [[<register xmlns="http://jabber.org/features/iq-register"/> ]] 48 --send [[<register xmlns="http://jabber.org/features/iq-register"/> ]]
49 --send("</stream:features>"); 49 --send("</stream:features>");
50 log("info", "core", "Stream opened successfully"); 50 log("info", "core", "Stream opened successfully");

mercurial