Sun, 20 May 2018 03:13:23 +0200
riddim.plugins.pubsub2room: Return early in case of unconfigured pubsub event
plugins/pubsub2room.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/pubsub2room.lua Sun May 20 02:16:48 2018 +0200 +++ b/plugins/pubsub2room.lua Sun May 20 03:13:23 2018 +0200 @@ -50,6 +50,7 @@ local config = bot.config.pubsub2room; bot.stream:hook("pubsub/event", function(event) local conf = config[event.from .. "#" .. event.node]; + if not conf then return end local room = bot.rooms[conf.room]; local data = st.stanza(""):tag("id"):text(event.item.attr.id); local entry = event.item and new_extractor(event.item.tags[1], data)