# HG changeset patch # User Kim Alvefur # Date 1302135628 -7200 # Node ID 5cb658e37a37c43c562e3a483fdbffe0cfb9fe06 # Parent 1b934a878e84598447e3c0bf61a7e728e04b561a pubsub2room: Access to attributes in templates diff -r 1b934a878e84 -r 5cb658e37a37 plugins/pubsub2room.lua --- 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