# HG changeset patch # User Kim Alvefur # Date 1476810475 -7200 # Node ID 5022e61811938f857c8f6a7134d1aa660ae2c6ed # Parent bd854e762875338096599249c49681a89515ab99# Parent 74e755674e0f644f9b8f1f66314dd624cab86dad Merge 0.10->trunk diff -r bd854e762875 -r 5022e6181193 plugins/mod_carbons.lua --- 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 diff -r bd854e762875 -r 5022e6181193 util/array.lua --- 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 diff -r bd854e762875 -r 5022e6181193 util/cache.lua --- 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) diff -r bd854e762875 -r 5022e6181193 util/pubsub.lua --- 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 diff -r bd854e762875 -r 5022e6181193 util/statsd.lua --- 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;