aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-12-02 11:13:05 +0100
committerKim Alvefur <zash@zash.se>2016-12-02 11:13:05 +0100
commit2a9484a488a5878e27b5d749b5bbb0d54f497e86 (patch)
treeb8d5008111c5708e9ee236f6139e5100ccd683d2 /util
parentd83f4d63b00b4cf561ad1c81f31f43b560bd7bd1 (diff)
parent738528509c19ea443b4066e49b7a93fd2317b0ee (diff)
downloadprosody-2a9484a488a5878e27b5d749b5bbb0d54f497e86.tar.gz
prosody-2a9484a488a5878e27b5d749b5bbb0d54f497e86.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/stanza.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index a598a81e..651c1973 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -14,6 +14,7 @@ local s_format = string.format;
local s_match = string.match;
local tostring = tostring;
local setmetatable = setmetatable;
+local getmetatable = getmetatable;
local pairs = pairs;
local ipairs = ipairs;
local type = type;
@@ -45,6 +46,10 @@ local function new_stanza(name, attr, namespaces)
return setmetatable(stanza, stanza_mt);
end
+local function is_stanza(s)
+ return getmetatable(s) == stanza_mt;
+end
+
function stanza_mt:query(xmlns)
return self:tag("query", { xmlns = xmlns });
end
@@ -422,6 +427,7 @@ end
return {
stanza_mt = stanza_mt;
stanza = new_stanza;
+ is_stanza = is_stanza;
new_id = new_id;
preserialize = preserialize;
deserialize = deserialize;