diff options
author | louiz’ <louiz@louiz.org> | 2018-04-24 19:13:10 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-04-24 20:25:39 +0200 |
commit | a90f196a1ce779d502baf0aadff6e6917fec8a02 (patch) | |
tree | ecd826fcb245083ce75d6cd5d6c0bc5836d4b2a7 /src/database | |
parent | b70136b96e579e8d38a30a298f885899cb80514c (diff) | |
download | biboumi-a90f196a1ce779d502baf0aadff6e6917fec8a02.tar.gz biboumi-a90f196a1ce779d502baf0aadff6e6917fec8a02.tar.bz2 biboumi-a90f196a1ce779d502baf0aadff6e6917fec8a02.tar.xz biboumi-a90f196a1ce779d502baf0aadff6e6917fec8a02.zip |
Revert "Use the Date to find a next page in RSM, not the id"
This reverts commit 5ef7ba08028065b03d51d1dc70bb35aeb41ae19d.
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/database.cpp | 9 | ||||
-rw-r--r-- | src/database/database.hpp | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp index fb24ad3..c935139 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 std::string& reference_uuid, Database::Paging paging) + int limit, const std::string& start, const std::string& end, const Id::real_type reference_record_id, Database::Paging paging) { if (limit == 0) return {}; @@ -222,15 +222,14 @@ std::vector<Database::MucLogLine> Database::get_muc_logs(const std::string& owne request << " and " << Database::Date{} << "<=" << writer; } } - if (!reference_uuid.empty()) + if (reference_record_id != Id::unset_value) { - request << " and " << Database::Date{}; + request << " and " << Id{}; if (paging == Database::Paging::first) request << ">"; else request << "<"; - request << "(SELECT " << Database::Date{} << " FROM " << Database::muc_log_lines.get_name().data() - << " WHERE " << Database::Uuid{} << " = " << reference_uuid << ")"; + request << reference_record_id; } if (paging == Database::Paging::first) diff --git a/src/database/database.hpp b/src/database/database.hpp index b4c4fa0..75ff8f3 100644 --- a/src/database/database.hpp +++ b/src/database/database.hpp @@ -135,7 +135,7 @@ class Database */ static std::vector<MucLogLine> get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server, int limit=-1, const std::string& start="", const std::string& end="", - const std::string& reference_record_id={}, Paging=Paging::first); + const Id::real_type reference_record_id=Id::unset_value, Paging=Paging::first); /** * Get just one single record matching the given uuid, between (optional) end and start. |