Software /
code /
prosody
Changeset
7704:5022e6181193
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 18 Oct 2016 19:07:55 +0200 |
parents | 7697:bd854e762875 (current diff) 7703:74e755674e0f (diff) |
children | 7705:0a29a5e64f1d |
files | util/pubsub.lua |
diffstat | 5 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_carbons.lua Sun Oct 16 00:39:10 2016 +0200 +++ b/plugins/mod_carbons.lua Tue Oct 18 19:07:55 2016 +0200 @@ -26,7 +26,7 @@ local orig_from = stanza.attr.from; local orig_to = stanza.attr.to; - if not(orig_type == "chat" or orig_type == "normal" and stanza:get_child("body")) then + if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body"))) then return -- Only chat type messages end
--- a/util/array.lua Sun Oct 16 00:39:10 2016 +0200 +++ b/util/array.lua Tue Oct 18 19:07:55 2016 +0200 @@ -19,7 +19,7 @@ local array = {}; local array_base = {}; local array_methods = {}; -local array_mt = { __index = array_methods, __tostring = function (array) return "{"..array:concat(", ").."}"; end }; +local array_mt = { __index = array_methods, __tostring = function (self) return "{"..self:concat(", ").."}"; end }; local function new_array(self, t, _s, _var) if type(t) == "function" then -- Assume iterator @@ -106,7 +106,7 @@ end --- These methods only mutate the array -function array_methods:shuffle(outa, ina) +function array_methods:shuffle() local len = #self; for i = 1, #self do local r = math_random(i, len); @@ -115,10 +115,10 @@ return self; end -function array_methods:append(array) - local len, len2 = #self, #array; +function array_methods:append(ina) + local len, len2 = #self, #ina; for i = 1, len2 do - self[len+i] = array[i]; + self[len+i] = ina[i]; end return self; end
--- a/util/cache.lua Sun Oct 16 00:39:10 2016 +0200 +++ b/util/cache.lua Tue Oct 18 19:07:55 2016 +0200 @@ -117,6 +117,7 @@ end function cache_methods:table() + --luacheck: ignore 212/t if not self.proxy_table then self.proxy_table = setmetatable({}, { __index = function (t, k)
--- a/util/pubsub.lua Sun Oct 16 00:39:10 2016 +0200 +++ b/util/pubsub.lua Tue Oct 18 19:07:55 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
--- a/util/statsd.lua Sun Oct 16 00:39:10 2016 +0200 +++ b/util/statsd.lua Tue Oct 18 19:07:55 2016 +0200 @@ -44,7 +44,7 @@ end return function (new_v) send_gauge(name, new_v); end end; - counter = function (name, initial) + counter = function (name, initial) --luacheck: ignore 212/initial return function (delta) send_gauge(name, delta, true); end;