2020-10-25 10:36:00 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/Aliases.hpp"
|
2022-12-31 15:41:01 +01:00
|
|
|
#include "common/Singleton.hpp"
|
2021-05-01 13:38:58 +02:00
|
|
|
#include "util/QStringHash.hpp"
|
2020-10-25 10:36:00 +01:00
|
|
|
|
Sort and force grouping of includes (#4172)
This change enforces strict include grouping using IncludeCategories
In addition to adding this to the .clang-format file and applying it in the tests/src and src directories, I also did the following small changes:
In ChatterSet.hpp, I changed lrucache to a <>include
In Irc2.hpp, I change common/SignalVector.hpp to a "project-include"
In AttachedWindow.cpp, NativeMessaging.cpp, WindowsHelper.hpp, BaseWindow.cpp, and StreamerMode.cpp, I disabled clang-format for the windows-includes
In WindowDescriptors.hpp, I added the missing vector include. It was previously not needed because the include was handled by another file that was previously included first.
clang-format minimum version has been bumped, so Ubuntu version used in the check-formatting job has been bumped to 22.04 (which is the latest LTS)
2022-11-27 19:32:53 +01:00
|
|
|
#include <QColor>
|
2022-11-16 11:02:54 +01:00
|
|
|
|
2021-05-23 23:10:29 +02:00
|
|
|
#include <memory>
|
2023-10-08 18:50:48 +02:00
|
|
|
#include <optional>
|
2022-11-16 11:02:54 +01:00
|
|
|
#include <set>
|
2021-05-01 13:38:58 +02:00
|
|
|
#include <shared_mutex>
|
2022-05-17 12:16:33 +02:00
|
|
|
#include <unordered_map>
|
2020-10-25 10:36:00 +01:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
struct Emote;
|
|
|
|
using EmotePtr = std::shared_ptr<const Emote>;
|
|
|
|
|
|
|
|
class FfzBadges : public Singleton
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void initialize(Settings &settings, Paths &paths) override;
|
|
|
|
FfzBadges() = default;
|
|
|
|
|
2022-06-27 20:36:58 +02:00
|
|
|
struct Badge {
|
|
|
|
EmotePtr emote;
|
|
|
|
QColor color;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<Badge> getUserBadges(const UserId &id);
|
2020-10-25 10:36:00 +01:00
|
|
|
|
|
|
|
private:
|
2023-10-08 18:50:48 +02:00
|
|
|
std::optional<Badge> getBadge(int badgeID);
|
2022-06-27 20:36:58 +02:00
|
|
|
|
|
|
|
void load();
|
2021-05-01 13:38:58 +02:00
|
|
|
|
|
|
|
std::shared_mutex mutex_;
|
|
|
|
|
2022-06-27 20:36:58 +02:00
|
|
|
// userBadges points a user ID to the list of badges they have
|
2022-11-16 11:02:54 +01:00
|
|
|
std::unordered_map<QString, std::set<int>> userBadges;
|
2022-06-27 20:36:58 +02:00
|
|
|
|
|
|
|
// badges points a badge ID to the information about the badge
|
|
|
|
std::unordered_map<int, Badge> badges;
|
2020-10-25 10:36:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|