perf: query fewer historical messages on reconnects (#5001)

Co-authored-by: Ruben Anders <ruben.anders@robotty.de>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2023-12-09 10:46:30 -08:00
committed by GitHub
parent 401e097d62
commit 13dc306506
10 changed files with 171 additions and 77 deletions
+6 -1
View File
@@ -8,7 +8,9 @@
#include <QString>
#include <QUrl>
#include <chrono>
#include <memory>
#include <optional>
#include <vector>
namespace chatterino::recentmessages::detail {
@@ -24,6 +26,9 @@ std::vector<MessagePtr> buildRecentMessages(
// Returns the URL to be used for querying the Recent Messages API for the
// given channel.
QUrl constructRecentMessagesUrl(const QString &name);
QUrl constructRecentMessagesUrl(
const QString &name, int limit,
std::optional<std::chrono::time_point<std::chrono::system_clock>> after,
std::optional<std::chrono::time_point<std::chrono::system_clock>> before);
} // namespace chatterino::recentmessages::detail