]> granicus.if.org Git - ejabberd/commitdiff
Pubsub node maxitem forced to 0 if non persistent node (thanks to Karim Gemayel)...
authorChristophe Romain <christophe.romain@process-one.net>
Tue, 31 May 2011 14:09:27 +0000 (16:09 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Tue, 31 May 2011 14:09:27 +0000 (16:09 +0200)
src/mod_pubsub/mod_pubsub.erl

index 802294b4a12154358193bdab825b2989690065a5..14b774837e9dada09c1b5c2f314304ee14afedf0 100644 (file)
@@ -2417,9 +2417,12 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
                     Features = features(Type),
                     PublishFeature = lists:member("publish", Features),
                     PublishModel = get_option(Options, publish_model),
-                    MaxItems = max_items(Host, Options),
                     DeliverPayloads = get_option(Options, deliver_payloads),
                     PersistItems = get_option(Options, persist_items),
+                    MaxItems = case PersistItems of
+                       0 -> 0;
+                       1 -> max_items(Host, Options)
+                    end,
                     {PayloadCount, PayloadNS} = payload_els_ns(Payload),
                     PayloadSize = size(term_to_binary(Payload))-2, % size(term_to_binary([])) == 2
                     PayloadMaxSize = get_option(Options, max_payload_size),