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

index 52134c0a6f99fed5d9a4fa933b9e5f5ab573fd2f..2337c26d382757063664ebd3bc7b0adad7dc7236 100644 (file)
@@ -1841,7 +1841,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