163 session.version = tonumber(attr.version) or 0; |
163 session.version = tonumber(attr.version) or 0; |
164 session.streamid = m_random(1000000, 99999999); |
164 session.streamid = m_random(1000000, 99999999); |
165 (session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host); |
165 (session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host); |
166 |
166 |
167 send("<?xml version='1.0'?>"); |
167 send("<?xml version='1.0'?>"); |
168 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)); |
168 send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0' xml:lang='en'>", session.streamid, session.host)); |
169 |
169 |
170 if not hosts[session.host] then |
170 if not hosts[session.host] then |
171 -- We don't serve this host... |
171 -- We don't serve this host... |
172 session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)}; |
172 session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)}; |
173 return; |
173 return; |