Software /
code /
prosody
Changeset
3710:59fbe4536c69
tools/xep227toprosody.lua: Rename ns_xep227 to xmlns_xep227 for consistency with main Prosody code
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 07 Dec 2010 19:22:08 +0000 |
parents | 3709:db1c1ddc79e8 |
children | 3711:2a1cfaf3ee61 |
files | tools/xep227toprosody.lua |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/xep227toprosody.lua Tue Dec 07 19:20:33 2010 +0000 +++ b/tools/xep227toprosody.lua Tue Dec 07 19:22:08 2010 +0000 @@ -41,10 +41,11 @@ local dm = require "util.datamanager" dm.set_data_path("data"); -local ns_xep227 = "http://www.xmpp.org/extensions/xep-0227.html#ns"; local ns_separator = xmppstream.ns_separator; local ns_pattern = xmppstream.ns_pattern; +local xmlns_xep227 = "http://www.xmpp.org/extensions/xep-0227.html#ns"; + ----------------------------------------------------------------------- function store_vcard(username, host, stanza) @@ -147,7 +148,7 @@ local cb = { stream_tag = "user", - stream_ns = ns_xep227, + stream_ns = xmlns_xep227, }; function cb.streamopened(session, attr) session.notopen = false; @@ -196,10 +197,10 @@ if curr_host ~= "" then -- forward to xmlhandlers user_handlers:StartElement(elementname, attributes); - elseif (curr_ns == ns_xep227) and (name == "host") then + elseif (curr_ns == xmlns_xep227) and (name == "host") then curr_host = attributes["jid"]; -- start of host element print("Begin parsing host "..curr_host); - elseif (curr_ns ~= ns_xep227) or (name ~= "server-data") then + elseif (curr_ns ~= xmlns_xep227) or (name ~= "server-data") then io.stderr:write("Unhandled XML element: ", name, "\n"); os.exit(1); end @@ -214,14 +215,14 @@ --count = count - 1; --io.write("- ", string.rep(" ", count), name, " (", curr_ns, ")", "\n") if curr_host ~= "" then - if (curr_ns == ns_xep227) and (name == "host") then + if (curr_ns == xmlns_xep227) and (name == "host") then print("End parsing host "..curr_host); curr_host = "" -- end of host element else -- forward to xmlhandlers user_handlers:EndElement(elementname); end - elseif (curr_ns ~= ns_xep227) or (name ~= "server-data") then + elseif (curr_ns ~= xmlns_xep227) or (name ~= "server-data") then io.stderr:write("Unhandled XML element: ", name, "\n"); os.exit(1); end