From e98d142830919dbd1c817e249f363e9879d2d930 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 2 Feb 2018 19:29:17 +0000 Subject: util.pubsub: Move service methods object creation (just code reorganisation) --- util/pubsub.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/pubsub.lua b/util/pubsub.lua index f606bdd8..ef905767 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -1,8 +1,7 @@ local events = require "util.events"; local cache = require "util.cache"; -local service = {}; -local service_mt = { __index = service }; +local service_mt = {}; local default_config = { itemstore = function (config, _) return cache.new(config["max_items"]) end; @@ -31,6 +30,11 @@ local function new(config) }, service_mt); end +--- Service methods + +local service = {}; +service_mt.__index = service; + function service:jids_equal(jid1, jid2) local normalize = self.config.normalize_jid; return normalize(jid1) == normalize(jid2); -- cgit v1.2.3