Software /
code /
verse
Diff
plugins/pubsub.lua @ 193:fa6e1e65cb3c
plugins.pubsub: Fix to use :childtags() for iterating through items in a pubsub notification (:matching_tags() was removed from Prosody)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 14 Mar 2011 15:17:32 +0000 |
parent | 165:8c67ea868c06 |
child | 221:efb4f60ba36e |
line wrap: on
line diff
--- 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;