aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-30 14:26:58 +0100
committerKim Alvefur <zash@zash.se>2018-12-30 14:26:58 +0100
commit0fe56344ca10575746f969992b63b4173395eed2 (patch)
treec97f97e92b64c877c7096da9d7da258807b999da /core/moduleapi.lua
parent464121c5b7092f2521d21be390b01173e28fbd00 (diff)
downloadprosody-0fe56344ca10575746f969992b63b4173395eed2.tar.gz
prosody-0fe56344ca10575746f969992b63b4173395eed2.zip
core.moduleapi: Move util imports to top
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua6
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";