Thu, 07 Apr 2011 02:20:28 +0200
pubsub2room: Access to attributes in templates
plugins/pubsub2room.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/pubsub2room.lua Fri Mar 25 19:20:14 2011 +0100 +++ b/plugins/pubsub2room.lua Thu Apr 07 02:20:28 2011 +0200 @@ -23,6 +23,11 @@ n = t.stanza; end for x in k:gmatch("[^.]+") do + local m, a = x:match("^([^@]*)@(.*)$"); + if m and a then + m = n:get_child(m); + return m and m.attr[a] or nil; + end n = n:get_child(x); if not n then return end end