diff options
author | louiz’ <louiz@louiz.org> | 2018-04-14 19:48:45 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-04-14 19:48:45 +0200 |
commit | 5ef7ba08028065b03d51d1dc70bb35aeb41ae19d (patch) | |
tree | 2f845ce6d11b1a901007a78ad9202b2e90e4771f /src/database/database.cpp | |
parent | d375a9edeb7a2aa21497a2cbc1db0d3f703283a6 (diff) | |
download | biboumi-5ef7ba08028065b03d51d1dc70bb35aeb41ae19d.tar.gz biboumi-5ef7ba08028065b03d51d1dc70bb35aeb41ae19d.tar.bz2 biboumi-5ef7ba08028065b03d51d1dc70bb35aeb41ae19d.tar.xz biboumi-5ef7ba08028065b03d51d1dc70bb35aeb41ae19d.zip |
Use the Date to find a next page in RSM, not the id
This way, it works, whatever the order of insertion in the database was.
fix #3343
Diffstat (limited to 'src/database/database.cpp')
-rw-r--r-- | src/database/database.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp index c935139..fb24ad3 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -192,7 +192,7 @@ std::string Database::store_muc_message(const std::string& owner, const std::str } std::vector<Database::MucLogLine> Database::get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server, - int limit, const std::string& start, const std::string& end, const Id::real_type reference_record_id, Database::Paging paging) + int limit, const std::string& start, const std::string& end, const std::string& reference_uuid, Database::Paging paging) { if (limit == 0) return {}; @@ -222,14 +222,15 @@ std::vector<Database::MucLogLine> Database::get_muc_logs(const std::string& owne request << " and " << Database::Date{} << "<=" << writer; } } - if (reference_record_id != Id::unset_value) + if (!reference_uuid.empty()) { - request << " and " << Id{}; + request << " and " << Database::Date{}; if (paging == Database::Paging::first) request << ">"; else request << "<"; - request << reference_record_id; + request << "(SELECT " << Database::Date{} << " FROM " << Database::muc_log_lines.get_name().data() + << " WHERE " << Database::Uuid{} << " = " << reference_uuid << ")"; } if (paging == Database::Paging::first) |