Diff

mod_bookmarks2/mod_bookmarks2.lua @ 3678:7575399ae544

mod_bookmarks, mod_bookmarks2: Refuse to load if the other one is also loaded.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 28 Sep 2019 14:46:18 +0200
parent 3677:90f88a643973
child 3696:310061f6e1df
line wrap: on
line diff
--- a/mod_bookmarks2/mod_bookmarks2.lua	Sat Sep 28 14:27:13 2019 +0200
+++ b/mod_bookmarks2/mod_bookmarks2.lua	Sat Sep 28 14:46:18 2019 +0200
@@ -1,3 +1,8 @@
+local mm = require "core.modulemanager";
+if mm.get_modules_for_host(module.host):contains("bookmarks") then
+	error("mod_bookmarks2 and mod_bookmarks are conflicting, please disable one of them.", 0);
+end
+
 local st = require "util.stanza";
 local jid_split = require "util.jid".split;
 
@@ -9,6 +14,7 @@
 
 local default_options = {
 	["persist_items"] = true;
+	-- This should be much higher, the XEP recommends 10000 but mod_pep rejects that.
 	["max_items"] = 255;
 	["send_last_published_item"] = "never";
 	["access_model"] = "whitelist";