25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

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

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