diff options
author | Kim Alvefur <zash@zash.se> | 2018-12-30 14:26:58 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-12-30 14:26:58 +0100 |
commit | 7799a8a7bf9f29c6d34bdcd3ded42fc6387c0fe5 (patch) | |
tree | c97f97e92b64c877c7096da9d7da258807b999da /core | |
parent | 38462e35420ca9e93af018210be940353b32d508 (diff) | |
download | prosody-7799a8a7bf9f29c6d34bdcd3ded42fc6387c0fe5.tar.gz prosody-7799a8a7bf9f29c6d34bdcd3ded42fc6387c0fe5.zip |
core.moduleapi: Move util imports to top
Diffstat (limited to 'core')
-rw-r--r-- | core/moduleapi.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index f7aa7216..c7fff11f 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -14,6 +14,8 @@ local pluginloader = require "util.pluginloader"; local timer = require "util.timer"; local resolve_relative_path = require"util.paths".resolve_relative_path; local st = require "util.stanza"; +local cache = require "util.cache"; +local promise = require "util.promise"; local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; local error, setmetatable, type = error, setmetatable, type; @@ -364,14 +366,14 @@ end function api:send_iq(stanza, origin, timeout) local iq_cache = self._iq_cache; if not iq_cache then - iq_cache = require "util.cache".new(256, function (_, iq) + iq_cache = cache.new(256, function (_, iq) iq.reject("evicted"); self:unhook(iq.result_event, iq.result_handler); self:unhook(iq.error_event, iq.error_handler); end); self._iq_cache = iq_cache; end - return require "util.promise".new(function (resolve, reject) + return promise.new(function (resolve, reject) local event_type; if stanza.attr.from == self.host then event_type = "host"; |