mod_bookmarks2/mod_bookmarks2.lua
changeset 4723 5a06c711649c
parent 4692 05725276fac0
child 4742 5aee8d86629a
equal deleted inserted replaced
4722:6e3254e13fb7 4723:5a06c711649c
    12 local namespace = "urn:xmpp:bookmarks:1";
    12 local namespace = "urn:xmpp:bookmarks:1";
    13 
    13 
    14 local default_options = {
    14 local default_options = {
    15 	["persist_items"] = true;
    15 	["persist_items"] = true;
    16 	-- This should be much higher, the XEP recommends 10000 but mod_pep rejects that.
    16 	-- This should be much higher, the XEP recommends 10000 but mod_pep rejects that.
    17 	["max_items"] = module:get_option_number("pep_max_items", 256);
    17 	["max_items"] = "max";
    18 	["send_last_published_item"] = "never";
    18 	["send_last_published_item"] = "never";
    19 	["access_model"] = "whitelist";
    19 	["access_model"] = "whitelist";
    20 };
    20 };
       
    21 
       
    22 if not pcall(mod_pep.check_node_config, nil, nil, default_options) then
       
    23 	-- 0.11 or earlier not supporting max_items="max" trows an error here
       
    24 	module:log("debug", "Setting max_items=pep_max_items because 'max' is not supported in this version");
       
    25 	default_options["max_items"] = module:get_option_number("pep_max_items", 256);
       
    26 end
    21 
    27 
    22 module:hook("account-disco-info", function (event)
    28 module:hook("account-disco-info", function (event)
    23 	-- This Time it’s Serious!
    29 	-- This Time it’s Serious!
    24 	event.reply:tag("feature", { var = namespace.."#compat" }):up();
    30 	event.reply:tag("feature", { var = namespace.."#compat" }):up();
    25 end);
    31 end);