]> granicus.if.org Git - ejabberd/commitdiff
PubSub: add correct order when requesting all items
authorChristophe Romain <christophe.romain@process-one.net>
Wed, 27 Sep 2017 09:12:01 +0000 (11:12 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Wed, 27 Sep 2017 09:12:01 +0000 (11:12 +0200)
src/node_flat_sql.erl

index 110e310926d78655c6b26f2a6a96f15cd988137a..0f9a647310c5e8ee57a4414588da2fe81063d77c 100644 (file)
@@ -651,7 +651,8 @@ get_items(Nidx, _From, undefined) ->
     SNidx = misc:i2l(Nidx),
     case ejabberd_sql:sql_query_t(
           [<<"select itemid, publisher, creation, modification, payload",
-             " from pubsub_item where nodeid='", SNidx/binary, "'">>]) of
+             " from pubsub_item where nodeid='", SNidx/binary, "'",
+             " order by creation asc">>]) of
        {selected, _, AllItems} ->
            Count = length(AllItems),
            if Count =< ?MAXITEMS ->