# HG changeset patch # User Kim Alvefur # Date 1476797363 -7200 # Node ID 74e755674e0f644f9b8f1f66314dd624cab86dad # Parent 9385c367e920bf84e15234683d2809e00314c94f util.pubsub: Rename loop variable to avoid name clash [luacheck] diff -r 9385c367e920 -r 74e755674e0f util/pubsub.lua --- a/util/pubsub.lua Tue Oct 18 15:19:01 2016 +0200 +++ b/util/pubsub.lua Tue Oct 18 15:29:23 2016 +0200 @@ -371,13 +371,13 @@ -- a get_subscription() call for each node. local ret = {}; if subs then - for jid, subscribed_nodes in pairs(subs) do + for subscribed_jid, subscribed_nodes in pairs(subs) do if node then -- Return only subscriptions to this node if subscribed_nodes[node] then ret[#ret+1] = { node = node; - jid = jid; - subscription = node_obj.subscribers[jid]; + jid = subscribed_jid; + subscription = node_obj.subscribers[subscribed_jid]; }; end else -- Return subscriptions to all nodes @@ -385,8 +385,8 @@ for subscribed_node in pairs(subscribed_nodes) do ret[#ret+1] = { node = subscribed_node; - jid = jid; - subscription = nodes[subscribed_node].subscribers[jid]; + jid = subscribed_jid; + subscription = nodes[subscribed_node].subscribers[subscribed_jid]; }; end end