Diff

util/pubsub.lua @ 8501:8d9e2c2095dd

util.pubsub: Move service methods object creation (just code reorganisation)
author Matthew Wild <mwild1@gmail.com>
date Fri, 02 Feb 2018 19:29:17 +0000
parent 8500:9bf00d0734c8
child 8502:6c2c2fc4b8dd
line wrap: on
line diff
--- 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);