Sort archive messages by date (and only then by id)
fix #3337 Because apparently the IDs are not always incrementing. We still use them to know the order of two messages that were received at the same second (in this case, the ID will always be incrementing).
This commit is contained in:
@@ -197,11 +197,10 @@ std::vector<Database::MucLogLine> Database::get_muc_logs(const std::string& owne
|
|||||||
request << reference_record_id;
|
request << reference_record_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
request.order_by() << Id{};
|
|
||||||
if (paging == Database::Paging::first)
|
if (paging == Database::Paging::first)
|
||||||
request << " ASC ";
|
request.order_by() << Database::Date{} << " ASC, " << Id{} << " ASC ";
|
||||||
else
|
else
|
||||||
request << " DESC ";
|
request.order_by() << Database::Date{} << " DESC, " << Id{} << " DESC ";
|
||||||
|
|
||||||
if (limit >= 0)
|
if (limit >= 0)
|
||||||
request.limit() << limit;
|
request.limit() << limit;
|
||||||
|
|||||||
Reference in New Issue
Block a user