PubSub: add correct order when requesting all items

This commit is contained in:
Christophe Romain 2017-09-27 11:12:01 +02:00
parent 07a193d4dc
commit d120e0ad91
1 changed files with 2 additions and 1 deletions

View 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 ->