# HG changeset patch # User Matthew Wild # Date 1517599757 0 # Node ID 8d9e2c2095dd10c9673b8a4c55c5aa5805af26fb # Parent 9bf00d0734c8755e491f9f8d40d6ee73b0c08fc3 util.pubsub: Move service methods object creation (just code reorganisation) diff -r 9bf00d0734c8 -r 8d9e2c2095dd util/pubsub.lua --- a/util/pubsub.lua Thu Feb 01 15:09:04 2018 +0000 +++ b/util/pubsub.lua Fri Feb 02 19:29:17 2018 +0000 @@ -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 @@ }, 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);