plugins.pubsub: Fix to use :childtags() for iterating through items in a pubsub notification (:matching_tags() was removed from Prosody)

Mon, 14 Mar 2011 15:17:32 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 14 Mar 2011 15:17:32 +0000
changeset 193
fa6e1e65cb3c
parent 192
d20feb8034f5
child 194
651c696e0b21

plugins.pubsub: Fix to use :childtags() for iterating through items in a pubsub notification (:matching_tags() was removed from Prosody)

plugins/pubsub.lua file | annotate | diff | comparison | revisions
--- a/plugins/pubsub.lua	Wed Mar 09 18:38:24 2011 +0100
+++ b/plugins/pubsub.lua	Mon Mar 14 15:17:32 2011 +0000
@@ -10,11 +10,11 @@
 function verse.plugins.pubsub(stream)
 	stream.pubsub = setmetatable({ stream = stream }, pubsub_mt);
 	stream:hook("message", function (message)
-		for pubsub_event in message:matching_tags("event", xmlns_pubsub_event) do
+		for pubsub_event in message:childtags("event", xmlns_pubsub_event) do
 			local items = pubsub_event:get_child("items");
 			if items then
 				local node = items.attr.node;
-				for item in items:matching_tags("item") do
+				for item in items:childtags("item") do
 					stream:event("pubsub/event", {
 						from = message.attr.from;
 						node = node;

mercurial