summaryrefslogtreecommitdiff
path: root/xmpp/xml.lua
diff options
context:
space:
mode:
authorolive <olive@olive.ooo>2026-09-27 01:29:02 +0100
committerolive <olive@olive.ooo>2026-09-27 01:29:02 +0100
commit59d210c7139358f769441db8c5c0d92db17065f1 (patch)
treec9abd266f4285c641943c9f4436c3171fd3a0ad4 /xmpp/xml.lua
parente18625310d9e71a1297634e46ea60bde8a782d44 (diff)
Pylon Message IDsolive
Not stored. Not IRC.
Diffstat (limited to 'xmpp/xml.lua')
-rw-r--r--xmpp/xml.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/xmpp/xml.lua b/xmpp/xml.lua
index e54f27f..93186f6 100644
--- a/xmpp/xml.lua
+++ b/xmpp/xml.lua
@@ -26,17 +26,15 @@ local function parseargs(s)
return arg
end
-local function tag(x)
- return setmetatable(x, {__call=function(x, label)
- -- search for child with given label
- for _,c in ipairs(x) do
- if c.label == label then
- return c
- end
+local tag_mt = {
+ __call = function(self, label)
+ for _,child in ipairs(self) do
+ if child.label == label then return child end
end
return nil
- end})
-end
+ end,
+}
+local function tag(x) return setmetatable(x, tag_mt) end
local psingle