Mercurial > prosody-hg
comparison core/sessionmanager.lua @ 49:1cd2a8db392d
New "import" module to help tidy up all the local declarations at the top of modules
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 04 Oct 2008 02:43:23 +0100 |
| parents | 80d2ade0fd69 |
| children | 14ea0fe6ca86 |
comparison
equal
deleted
inserted
replaced
| 48:d0505310aec5 | 49:1cd2a8db392d |
|---|---|
| 1 | 1 |
| 2 local tonumber, tostring = tonumber, tostring; | 2 local tonumber, tostring = tonumber, tostring; |
| 3 local ipairs = ipairs; | 3 local ipairs, print= ipairs, print; |
| 4 | 4 |
| 5 local m_random = math.random; | 5 local m_random = import("math", "random"); |
| 6 local format = string.format; | 6 local format = import("string", "format"); |
| 7 | |
| 8 local print = print; | |
| 9 | 7 |
| 10 local hosts = hosts; | 8 local hosts = hosts; |
| 11 | 9 |
| 12 local modulemanager = require "core.modulemanager"; | 10 local modulemanager = require "core.modulemanager"; |
| 13 local log = require "util.logger".init("sessionmanager"); | 11 local log = require "util.logger".init("sessionmanager"); |
| 77 for _, feature in ipairs(features) do | 75 for _, feature in ipairs(features) do |
| 78 send_to_session(session, tostring(feature)); | 76 send_to_session(session, tostring(feature)); |
| 79 end | 77 end |
| 80 | 78 |
| 81 send("</stream:features>"); | 79 send("</stream:features>"); |
| 82 log("info", "core", "Stream opened successfully"); | 80 log("info", "Stream opened successfully"); |
| 83 session.notopen = nil; | 81 session.notopen = nil; |
| 84 end | 82 end |
| 85 | 83 |
| 86 return _M; | 84 return _M; |
