Increase max number of blocked users loaded from 100 to 1,000 (#4721)

Also includes a little refactor of how the requests are made & how the blocked users are stored
This commit is contained in:
nerix
2023-07-23 13:26:12 +02:00
committed by GitHub
parent a440f0261a
commit fca57696bb
12 changed files with 267 additions and 85 deletions
+19
View File
@@ -1,5 +1,6 @@
#pragma once
#include "util/QStringHash.hpp"
#include "util/RapidjsonHelpers.hpp"
#include <pajlada/serialize.hpp>
@@ -31,6 +32,16 @@ struct TwitchUser {
{
return this->id < rhs.id;
}
bool operator==(const TwitchUser &rhs) const
{
return this->id == rhs.id;
}
bool operator!=(const TwitchUser &rhs) const
{
return !(*this == rhs);
}
};
} // namespace chatterino
@@ -75,3 +86,11 @@ struct Deserialize<chatterino::TwitchUser> {
};
} // namespace pajlada
template <>
struct std::hash<chatterino::TwitchUser> {
inline size_t operator()(const chatterino::TwitchUser &user) const noexcept
{
return std::hash<QString>{}(user.id);
}
};