util/pubsub.lua
changeset 8697 059183e5571e
parent 8505 6c2c2fc4b8dd
child 8812 6cba2df3817c
--- a/util/pubsub.lua	Sun Mar 25 17:02:39 2018 +0200
+++ b/util/pubsub.lua	Wed Mar 21 23:40:45 2018 +0100
@@ -6,6 +6,7 @@
 local default_config = {
 	itemstore = function (config, _) return cache.new(config["max_items"]) end;
 	broadcaster = function () end;
+	itemcheck = function () return true; end;
 	get_affiliation = function () end;
 	capabilities = {};
 };
@@ -306,6 +307,9 @@
 		end
 		node_obj = self.nodes[node];
 	end
+	if not self.config.itemcheck(item) then
+		return nil, "internal-server-error";
+	end
 	local node_data = self.data[node];
 	local ok = node_data:set(id, item);
 	if not ok then