plugins.pubsub2room: Hook pubsub events directly on the stream.

Sun, 21 Aug 2011 02:50:10 +0200

author
Kim Alvefur <zash@zash.se>
date
Sun, 21 Aug 2011 02:50:10 +0200
changeset 86
2fa4d58349c8
parent 85
7ec6df0e0ed0
child 87
5fac50efb183

plugins.pubsub2room: Hook pubsub events directly on the stream.

plugins/pubsub2room.lua file | annotate | diff | comparison | revisions
--- a/plugins/pubsub2room.lua	Wed Jul 20 01:16:34 2011 +0200
+++ b/plugins/pubsub2room.lua	Sun Aug 21 02:50:10 2011 +0200
@@ -43,10 +43,10 @@
 
 function riddim.plugins.pubsub2room(bot)
 	local bare_jid = require "util.jid".bare;
-	bot:add_plugin("pubsub");
+	bot.stream:add_plugin("pubsub");
 
 	local config = bot.config.pubsub2room;
-	bot:hook("pubsub/event", function(event)
+	bot.stream:hook("pubsub/event", function(event)
 		local conf = config[event.from .. "#" .. event.node];
 		local room = bot.rooms[conf.room];
 		local data = st.stanza(""):tag("id"):text(event.item.attr.id);

mercurial