summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-02-16 00:56:07 +0100
committerlouiz’ <louiz@louiz.org>2018-02-16 00:56:07 +0100
commitd3e07eee1335822643d7086b95590b60a4e002c3 (patch)
treed592cafc7dc7ba1f4b6e4c7f86ba63658aec0ded
parentdbb86bcc12921576c270009537b81b951d2ed84f (diff)
downloadbiboumi-d3e07eee1335822643d7086b95590b60a4e002c3.tar.gz
biboumi-d3e07eee1335822643d7086b95590b60a4e002c3.tar.bz2
biboumi-d3e07eee1335822643d7086b95590b60a4e002c3.tar.xz
biboumi-d3e07eee1335822643d7086b95590b60a4e002c3.zip
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).
-rw-r--r--src/database/database.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp
index b2413d0..d19ed7a 100644
--- a/src/database/database.cpp
+++ b/src/database/database.cpp
@@ -197,11 +197,10 @@ std::vector<Database::MucLogLine> Database::get_muc_logs(const std::string& owne
request << reference_record_id;
}
- request.order_by() << Id{};
if (paging == Database::Paging::first)
- request << " ASC ";
+ request.order_by() << Database::Date{} << " ASC, " << Id{} << " ASC ";
else
- request << " DESC ";
+ request.order_by() << Database::Date{} << " DESC, " << Id{} << " DESC ";
if (limit >= 0)
request.limit() << limit;