aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-01-13 15:29:00 +0000
committerMatthew Wild <mwild1@gmail.com>2009-01-13 15:29:00 +0000
commit4dc4d175d135e293f48ed6a15f61b19c4dafe8d7 (patch)
treec4a1aeb92f7ccaccc8fd919d065d3add4c71c12d /util
parentbb7d8604f252ce84bdea1cb791114dfc40c5a958 (diff)
parent8b979ccaf40ae38dbeaa5e7a4edb2e6d760fdffa (diff)
downloadprosody-4dc4d175d135e293f48ed6a15f61b19c4dafe8d7.tar.gz
prosody-4dc4d175d135e293f48ed6a15f61b19c4dafe8d7.zip
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'util')
-rw-r--r--util/stanza.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 6af7e2b2..14a8f395 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -87,11 +87,17 @@ function stanza_mt:add_child(child)
end
function stanza_mt:child_with_name(name)
- for _, child in ipairs(self) do
+ for _, child in ipairs(self.tags) do
if child.name == name then return child; end
end
end
+function stanza_mt:child_with_ns(ns)
+ for _, child in ipairs(self.tags) do
+ if child.attr.xmlns == ns then return child; end
+ end
+end
+
function stanza_mt:children()
local i = 0;
return function (a)
@@ -199,6 +205,9 @@ function deserialize(stanza)
end
end
stanza.tags = tags;
+ if not stanza.last_add then
+ stanza.last_add = {};
+ end
end
end