Software /
code /
prosody
Changeset
4852:9cc934f49df0
mod_c2s: Another lurking string.format squashed.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 11 May 2012 14:57:29 +0100 |
parents | 4851:8e3992ae7bf5 |
children | 4853:4ca9328e37d5 |
files | plugins/mod_c2s.lua |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_c2s.lua Fri May 11 14:24:05 2012 +0100 +++ b/plugins/mod_c2s.lua Fri May 11 14:57:29 2012 +0100 @@ -17,7 +17,6 @@ local uuid_generate = require "util.uuid".generate; local xpcall, tostring, type = xpcall, tostring, type; -local format = string.format; local traceback = debug.traceback; local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams"; @@ -54,8 +53,9 @@ return; end - send("<?xml version='1.0'?>"); - 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)); + send("<?xml version='1.0'?>"..st.stanza("stream:stream", { + xmlns = 'jabber:client', ["xmlns:stream"] = 'http://etherx.jabber.org/streams'; + id = session.streamid, from = session.host, version = '1.0', ["xml:lang"] = 'en' }):top_tag()); (session.log or log)("debug", "Sent reply <stream:stream> to client"); session.notopen = nil;