diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-01-23 02:15:28 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-01-23 02:15:28 +0000 |
commit | c366bf57d997088226d0f9307dfbc8b5e7d7de48 (patch) | |
tree | eb49e3c067ac3da0d293321f16afdc64492762d3 | |
parent | 38859b26f93776a9f105953b4b05312194202b4d (diff) | |
download | prosody-c366bf57d997088226d0f9307dfbc8b5e7d7de48.tar.gz prosody-c366bf57d997088226d0f9307dfbc8b5e7d7de48.zip |
mod_c2s: Code reduction
-rw-r--r-- | plugins/mod_c2s.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 4d7318a5..682c4e3b 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -39,13 +39,12 @@ local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/strea function stream_callbacks.streamopened(session, attr) local send = session.send; - session.host = attr.to; + session.host = nameprep(attr.to); if not session.host then session:close{ condition = "improper-addressing", - text = "A 'to' attribute is required on stream headers" }; + text = "A valid 'to' attribute is required on stream headers" }; return; end - session.host = nameprep(session.host); session.version = tonumber(attr.version) or 0; session.streamid = uuid_generate(); (session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host); |