aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-01-23 02:15:28 +0000
committerMatthew Wild <mwild1@gmail.com>2012-01-23 02:15:28 +0000
commitc366bf57d997088226d0f9307dfbc8b5e7d7de48 (patch)
treeeb49e3c067ac3da0d293321f16afdc64492762d3 /plugins/mod_c2s.lua
parent38859b26f93776a9f105953b4b05312194202b4d (diff)
downloadprosody-c366bf57d997088226d0f9307dfbc8b5e7d7de48.tar.gz
prosody-c366bf57d997088226d0f9307dfbc8b5e7d7de48.zip
mod_c2s: Code reduction
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua5
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);