]> granicus.if.org Git - ejabberd/commitdiff
Fix max_items and don't let PEP depends on item cache
authorChristophe Romain <christophe.romain@process-one.net>
Thu, 18 Jun 2015 10:06:29 +0000 (12:06 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 18 Jun 2015 10:06:29 +0000 (12:06 +0200)
src/mod_pubsub.erl
src/node_pep.erl

index a5e90531caadfa6ea1acf52b12a4489d45ac9822..f127ca12bb671dc2a5c7967bf2773ee95550da07 100644 (file)
@@ -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.
index 8eeb28f0e81d93d7c9164b2b44a9066027b51c43..34a841d3ed14488156d5505216c2981fdc6fa768 100644 (file)
@@ -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},