Merge

Thu, 07 Apr 2011 02:20:48 +0200

author
Kim Alvefur <zash@zash.se>
date
Thu, 07 Apr 2011 02:20:48 +0200
changeset 81
f86c79cabc75
parent 80
5cb658e37a37 (diff)
parent 79
43ae29f2c69b (current diff)
child 82
ec22d6deb6c0

Merge

--- a/plugins/pubsub2room.lua	Sun Mar 20 21:49:22 2011 +0100
+++ b/plugins/pubsub2room.lua	Thu Apr 07 02:20:48 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
--- a/plugins/xeps.lua	Sun Mar 20 21:49:22 2011 +0100
+++ b/plugins/xeps.lua	Thu Apr 07 02:20:48 2011 +0200
@@ -30,7 +30,7 @@
 		local xepnum = command.param;
 		if not xepnum then return "Please supply an XEP number or a search string :)"; end
 			if not tonumber(xepnum) then -- Search for an XEP
-				if xepnum:match("^%d+ ex") then
+				if xepnum:match("^(%d+) ex%S* (%d+)$") then
 					local num, example = xepnum:match("^(%d+) ex%S* (%d+)$");
 					return "http://xmpp.org/extensions/xep-"..string.rep("0", 4-num:len())..num..".html#example-"..tostring(example);
 				end

mercurial