portmanager: Add luacheck annotations
[prosody.git] / core / sessionmanager.lua
index 8767e869e9d8c93b1e320b3677b934ef382b5b47..33cc3d21f6ec4c11d55e8e2198288f78e43fcdb4 100644 (file)
@@ -54,11 +54,11 @@ local resting_session = { -- Resting, not dead
                close = function (session)
                        session.log("debug", "Attempt to close already-closed session");
                end;
-               filter = function (type, data) return data; end;
+               filter = function (type, data) return data; end; --luacheck: ignore 212/type
        }; resting_session.__index = resting_session;
 
 function retire_session(session)
-       local log = session.log or log;
+       local log = session.log or log; --luacheck: ignore 431/log
        for k in pairs(session) do
                if k ~= "log" and k ~= "id" then
                        session[k] = nil;
@@ -193,12 +193,12 @@ function bind_resource(session, resource)
        return true;
 end
 
-function send_to_available_resources(user, host, stanza)
-       local jid = user.."@"..host;
+function send_to_available_resources(username, host, stanza)
+       local jid = username.."@"..host;
        local count = 0;
        local user = bare_sessions[jid];
        if user then
-               for k, session in pairs(user.sessions) do
+               for _, session in pairs(user.sessions) do
                        if session.presence then
                                session.send(stanza);
                                count = count + 1;
@@ -208,12 +208,12 @@ function send_to_available_resources(user, host, stanza)
        return count;
 end
 
-function send_to_interested_resources(user, host, stanza)
-       local jid = user.."@"..host;
+function send_to_interested_resources(username, host, stanza)
+       local jid = username.."@"..host;
        local count = 0;
        local user = bare_sessions[jid];
        if user then
-               for k, session in pairs(user.sessions) do
+               for _, session in pairs(user.sessions) do
                        if session.interested then
                                session.send(stanza);
                                count = count + 1;