From: Christophe Romain Date: Wed, 27 Sep 2017 09:12:01 +0000 (+0200) Subject: PubSub: add correct order when requesting all items X-Git-Tag: 17.09~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d120e0ad91b5398340d532b4da3f59acd556ff39;p=ejabberd PubSub: add correct order when requesting all items --- diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl index 110e31092..0f9a64731 100644 --- a/src/node_flat_sql.erl +++ b/src/node_flat_sql.erl @@ -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 ->