]> granicus.if.org Git - ejabberd/commitdiff
fix empty pubsub payload check
authorChristophe Romain <christophe.romain@process-one.net>
Mon, 14 Feb 2011 15:41:32 +0000 (16:41 +0100)
committerChristophe Romain <christophe.romain@process-one.net>
Mon, 14 Feb 2011 15:41:32 +0000 (16:41 +0100)
src/mod_pubsub/mod_pubsub.erl

index 44ba5071448c7e5550231276dc8d82f480bbc449..aa6d5053913066af51fdfddea0f231190ec2ae71 100644 (file)
@@ -2025,7 +2025,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
                    DeliverPayloads = get_option(Options, deliver_payloads),
                    PersistItems = get_option(Options, persist_items),
                    PayloadCount = payload_xmlelements(Payload),
-                   PayloadSize = size(term_to_binary(Payload)),
+                   PayloadSize = size(term_to_binary(Payload))-2, % size(term_to_binary([])) == 2
                    PayloadMaxSize = get_option(Options, max_payload_size),
                    % pubsub#deliver_payloads true 
                    % pubsub#persist_items true -> 1 item; false -> 0 item