Comparison

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
comparison
equal deleted inserted replaced
3677:90f88a643973 3678:7575399ae544
1 local mm = require "core.modulemanager";
2 if mm.get_modules_for_host(module.host):contains("bookmarks") then
3 error("mod_bookmarks2 and mod_bookmarks are conflicting, please disable one of them.", 0);
4 end
5
1 local st = require "util.stanza"; 6 local st = require "util.stanza";
2 local jid_split = require "util.jid".split; 7 local jid_split = require "util.jid".split;
3 8
4 local mod_pep = module:depends "pep"; 9 local mod_pep = module:depends "pep";
5 local private_storage = module:open_store("private", "map"); 10 local private_storage = module:open_store("private", "map");
7 local legacy_ns = "storage:bookmarks"; 12 local legacy_ns = "storage:bookmarks";
8 local ns = "urn:xmpp:bookmarks:0"; 13 local ns = "urn:xmpp:bookmarks:0";
9 14
10 local default_options = { 15 local default_options = {
11 ["persist_items"] = true; 16 ["persist_items"] = true;
17 -- This should be much higher, the XEP recommends 10000 but mod_pep rejects that.
12 ["max_items"] = 255; 18 ["max_items"] = 255;
13 ["send_last_published_item"] = "never"; 19 ["send_last_published_item"] = "never";
14 ["access_model"] = "whitelist"; 20 ["access_model"] = "whitelist";
15 }; 21 };
16 22