aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-01-19 03:52:41 +0000
committerMatthew Wild <mwild1@gmail.com>2010-01-19 03:52:41 +0000
commita1ca8f3d8a1cd6cbf85817ec06441aa8a57d649a (patch)
treeae88505632e0a18da6ad0c09ec2b49e1408259bb
parent0f8fb8c50feb46c932ac46faf254cb74fc28ddf9 (diff)
downloadprosody-a1ca8f3d8a1cd6cbf85817ec06441aa8a57d649a.tar.gz
prosody-a1ca8f3d8a1cd6cbf85817ec06441aa8a57d649a.zip
xmlhandlers: More refactoring, split up stream_ns and stream_tag, add stream_error_tag so that callers don't need to be so worried about the separator we use
-rw-r--r--core/xmlhandlers.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua
index c59f9df8..6e693d86 100644
--- a/core/xmlhandlers.lua
+++ b/core/xmlhandlers.lua
@@ -26,6 +26,9 @@ module "xmlhandlers"
local ns_prefixes = {
["http://www.w3.org/XML/1998/namespace"] = "xml";
}
+
+local xmlns_streams = "http://etherx.jabber.org/streams";
+
local ns_separator = "\1";
local ns_pattern = "^([^"..ns_separator.."]*)"..ns_separator.."?(.*)$";
@@ -41,7 +44,10 @@ function init_xmlhandlers(session, stream_callbacks)
local cb_error = stream_callbacks.error or function (session, e) error("XML stream error: "..tostring(e)); end;
local cb_handlestanza = stream_callbacks.handlestanza;
- local stream_tag = stream_callbacks.stream_tag;
+ local stream_ns = stream_callbacks.stream_ns or xmlns_streams;
+ local stream_tag = stream_ns..ns_separator..(stream_callbacks.stream_tag or "stream");
+ local stream_error_tag = stream_ns..ns_separator..(stream_callbacks.error_tag or "error");
+
local stream_default_ns = stream_callbacks.default_ns;
local stanza