diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/datamanager.lua | 2 | ||||
-rw-r--r-- | util/datetime.lua | 2 | ||||
-rw-r--r-- | util/dependencies.lua | 2 | ||||
-rw-r--r-- | util/discohelper.lua | 2 | ||||
-rw-r--r-- | util/import.lua | 2 | ||||
-rw-r--r-- | util/jid.lua | 2 | ||||
-rw-r--r-- | util/logger.lua | 2 | ||||
-rw-r--r-- | util/multitable.lua | 2 | ||||
-rw-r--r-- | util/sasl.lua | 2 | ||||
-rw-r--r-- | util/serialization.lua | 2 | ||||
-rw-r--r-- | util/stanza.lua | 28 | ||||
-rw-r--r-- | util/termcolours.lua | 2 | ||||
-rw-r--r-- | util/uuid.lua | 2 | ||||
-rw-r--r-- | util/ztact.lua | 24 |
14 files changed, 29 insertions, 47 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index a5e478c8..e229de1c 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/datetime.lua b/util/datetime.lua index 1c730e30..53b1700b 100644 --- a/util/datetime.lua +++ b/util/datetime.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/dependencies.lua b/util/dependencies.lua index d841b30d..6e78a138 100644 --- a/util/dependencies.lua +++ b/util/dependencies.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/discohelper.lua b/util/discohelper.lua index 7966ac55..56dfd5d0 100644 --- a/util/discohelper.lua +++ b/util/discohelper.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/import.lua b/util/import.lua index c7484d35..2f36ac99 100644 --- a/util/import.lua +++ b/util/import.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/jid.lua b/util/jid.lua index 6c387868..537735be 100644 --- a/util/jid.lua +++ b/util/jid.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/logger.lua b/util/logger.lua index f7ea187b..5115bbda 100644 --- a/util/logger.lua +++ b/util/logger.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/multitable.lua b/util/multitable.lua index 1e22c4dd..ce38e04d 100644 --- a/util/multitable.lua +++ b/util/multitable.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/sasl.lua b/util/sasl.lua index 311c3aff..dd8c2002 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -1,4 +1,4 @@ --- sasl.lua v0.1 +-- sasl.lua v0.2 -- Copyright (C) 2008 Tobias Markmann -- -- All rights reserved. diff --git a/util/serialization.lua b/util/serialization.lua index a3147fd8..7a377c98 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/stanza.lua b/util/stanza.lua index a4a89191..6af7e2b2 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- @@ -21,6 +21,7 @@ local t_insert = table.insert; local t_concat = table.concat; local t_remove = table.remove; +local t_concat = table.concat; local s_format = string.format; local tostring = tostring; local setmetatable = setmetatable; @@ -31,7 +32,7 @@ local next = next; local print = print; local unpack = unpack; local s_gsub = string.gsub; -local os = os; +local os = os; local do_pretty_printing = not os.getenv("WINDIR"); local getstyle, getstring = require "util.termcolours".getstyle, require "util.termcolours".getstring; @@ -117,22 +118,20 @@ end local xml_escape = xml_escape; -local function dostring(t, buf, self) +local function dostring(t, buf, self, xml_escape) t_insert(buf, "<"); t_insert(buf, t.name); - if t.attr then - for k, v in pairs(t.attr) do if type(k) == "string" then - t_insert(buf, " "); - t_insert(buf, k); - t_insert(buf, "='"); - t_insert(buf, (xml_escape(tostring(v)))); - t_insert(buf, "'"); - end end - end + for k, v in pairs(t.attr) do if type(k) == "string" then + t_insert(buf, " "); + t_insert(buf, k); + t_insert(buf, "='"); + t_insert(buf, (xml_escape(tostring(v)))); + t_insert(buf, "'"); + end end t_insert(buf, ">"); for n, child in ipairs(t) do if child.name then - self(child, buf, self); + self(child, buf, self, xml_escape); else t_insert(buf, (xml_escape(child))); end @@ -144,10 +143,11 @@ end function stanza_mt.__tostring(t) local buf = {}; - dostring(t, buf, dostring); + dostring(t, buf, dostring, xml_escape); return t_concat(buf); end + function stanza_mt.top_tag(t) local attr_string = ""; if t.attr then diff --git a/util/termcolours.lua b/util/termcolours.lua index 24cb0cbd..6ab1b1fd 100644 --- a/util/termcolours.lua +++ b/util/termcolours.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/uuid.lua b/util/uuid.lua index 0039664f..0b8526f9 100644 --- a/util/uuid.lua +++ b/util/uuid.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.1 +-- Prosody IM v0.2 -- Copyright (C) 2008 Matthew Wild -- Copyright (C) 2008 Waqas Hussain -- diff --git a/util/ztact.lua b/util/ztact.lua index 55e40211..c329a685 100644 --- a/util/ztact.lua +++ b/util/ztact.lua @@ -1,24 +1,6 @@ --- Prosody IM v0.1 --- Copyright (C) 2008 Matthew Wild --- Copyright (C) 2008 Waqas Hussain --- --- This program is free software; you can redistribute it and/or --- modify it under the terms of the GNU General Public License --- as published by the Free Software Foundation; either version 2 --- of the License, or (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- - - - +-- Prosody IM v0.2 +-- This file is included with Prosody IM. It has modifications, +-- which are hereby placed in the public domain. -- public domain 20080410 lua@ztact.com |