diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index a5e90531c..f127ca12b 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -3636,9 +3636,9 @@ max_items(Host, Options) -> case get_option(Options, persist_items) of true -> case get_option(Options, max_items) of - false -> unlimited; - Result when Result < 0 -> 0; - Result -> Result + I when is_integer(I), I < 0 -> 0; + I when is_integer(I) -> I; + _ -> ?MAXITEMS end; false -> case get_option(Options, send_last_published_item) of @@ -3646,8 +3646,8 @@ max_items(Host, Options) -> 0; _ -> case is_last_item_cache_enabled(Host) of - true -> 0; - false -> 1 + true -> 1; + false -> 0 end end end. diff --git a/src/node_pep.erl b/src/node_pep.erl index 8eeb28f0e..34a841d3e 100644 --- a/src/node_pep.erl +++ b/src/node_pep.erl @@ -62,7 +62,7 @@ options() -> {notify_delete, false}, {notify_retract, false}, {purge_offline, false}, - {persist_items, false}, + {persist_items, true}, {max_items, 1}, {subscribe, true}, {access_model, presence},