diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c75671d88..b5e6e3a232d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ - Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198) - Dev: Migrated to C++ 20 (#4252, #4257) - Dev: Enable LTO for main branch builds. (#4258, #4260) -- Dev: Removed unused include directives. (#4266) +- Dev: Removed unused include directives. (#4266, #4275) - Dev: Removed TooltipPreviewImage. (#4268) - Dev: Removed unused operators in `Image` (#4267) diff --git a/src/Application.cpp b/src/Application.cpp index fa2fdd50578..c1bdf2c9aac 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -4,6 +4,7 @@ #include "common/QLogging.hpp" #include "common/Version.hpp" #include "controllers/accounts/AccountController.hpp" +#include "controllers/commands/Command.hpp" #include "controllers/commands/CommandController.hpp" #include "controllers/highlights/HighlightController.hpp" #include "controllers/hotkeys/HotkeyController.hpp" @@ -11,24 +12,27 @@ #include "controllers/notifications/NotificationController.hpp" #include "controllers/userdata/UserDataController.hpp" #include "debug/AssertInGuiThread.hpp" +#include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" -#include "providers/bttv/BttvEmotes.hpp" #include "providers/chatterino/ChatterinoBadges.hpp" #include "providers/ffz/FfzBadges.hpp" -#include "providers/ffz/FfzEmotes.hpp" #include "providers/irc/Irc2.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" +#include "providers/seventv/eventapi/SeventvEventAPISubscription.hpp" #include "providers/seventv/SeventvBadges.hpp" -#include "providers/seventv/SeventvEmotes.hpp" #include "providers/seventv/SeventvEventAPI.hpp" +#include "providers/twitch/ChannelPointReward.hpp" +#include "providers/twitch/PubSubActions.hpp" #include "providers/twitch/PubSubManager.hpp" +#include "providers/twitch/PubSubMessages.hpp" +#include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" #include "singletons/Emotes.hpp" #include "singletons/Fonts.hpp" +#include "singletons/helper/LoggingChannel.hpp" #include "singletons/Logging.hpp" -#include "singletons/NativeMessaging.hpp" #include "singletons/Paths.hpp" -#include "singletons/Resources.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "singletons/Toasts.hpp" @@ -36,7 +40,6 @@ #include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" #include "util/PostToThread.hpp" -#include "util/RapidjsonHelpers.hpp" #include "widgets/Notebook.hpp" #include "widgets/splits/Split.hpp" #include "widgets/Window.hpp" diff --git a/src/Application.hpp b/src/Application.hpp index 6f6bc995b5c..edb571f16b7 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -1,6 +1,5 @@ #pragma once -#include "common/SignalVector.hpp" #include "common/Singleton.hpp" #include "singletons/NativeMessaging.hpp" @@ -25,7 +24,6 @@ class Theme; class WindowManager; class Logging; class Paths; -class AccountManager; class Emotes; class IEmotes; class Settings; diff --git a/src/BaseSettings.hpp b/src/BaseSettings.hpp index f70fa29ca8a..89ce45d06cf 100644 --- a/src/BaseSettings.hpp +++ b/src/BaseSettings.hpp @@ -1,5 +1,4 @@ -#ifndef AB_SETTINGS_H -#define AB_SETTINGS_H +#pragma once #include "common/ChatterinoSetting.hpp" @@ -46,8 +45,3 @@ Settings *getSettings(); AB_SETTINGS_CLASS *getABSettings(); } // namespace chatterino - -#ifdef CHATTERINO -# include "singletons/Settings.hpp" -#endif -#endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 56e0f0aea01..eebd4c246e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,6 +70,10 @@ set(SOURCE_FILES controllers/filters/FilterModel.cpp controllers/filters/FilterModel.hpp + controllers/filters/FilterRecord.cpp + controllers/filters/FilterRecord.hpp + controllers/filters/FilterSet.cpp + controllers/filters/FilterSet.hpp controllers/filters/parser/FilterParser.cpp controllers/filters/parser/FilterParser.hpp controllers/filters/parser/Tokenizer.cpp @@ -188,8 +192,6 @@ set(SOURCE_FILES providers/bttv/BttvEmotes.cpp providers/bttv/BttvEmotes.hpp - providers/bttv/LoadBttvChannelEmote.cpp - providers/bttv/LoadBttvChannelEmote.hpp providers/chatterino/ChatterinoBadges.cpp providers/chatterino/ChatterinoBadges.hpp @@ -330,6 +332,7 @@ set(SOURCE_FILES util/AttachToConsole.hpp util/Clipboard.cpp util/Clipboard.hpp + util/ConcurrentMap.hpp util/DebugCount.cpp util/DebugCount.hpp util/DisplayBadge.cpp @@ -356,6 +359,7 @@ set(SOURCE_FILES util/RatelimitBucket.hpp util/SampleData.cpp util/SampleData.hpp + util/SharedPtrElementLess.hpp util/SplitCommand.cpp util/SplitCommand.hpp util/StreamLink.cpp diff --git a/src/common/ChannelChatters.cpp b/src/common/ChannelChatters.cpp index 3f4f10420f1..d65ae931b32 100644 --- a/src/common/ChannelChatters.cpp +++ b/src/common/ChannelChatters.cpp @@ -1,9 +1,12 @@ #include "ChannelChatters.hpp" +#include "common/Channel.hpp" #include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" +#include + namespace chatterino { ChannelChatters::ChannelChatters(Channel &channel) diff --git a/src/common/ChannelChatters.hpp b/src/common/ChannelChatters.hpp index 96d4810d1cb..b15717dc9d5 100644 --- a/src/common/ChannelChatters.hpp +++ b/src/common/ChannelChatters.hpp @@ -1,15 +1,18 @@ #pragma once -#include "common/Channel.hpp" #include "common/ChatterSet.hpp" #include "common/UniqueAccess.hpp" #include "lrucache/lrucache.hpp" #include "util/QStringHash.hpp" +#include +#include #include namespace chatterino { +class Channel; + class ChannelChatters { public: diff --git a/src/common/Common.hpp b/src/common/Common.hpp index 6dcfccaf7ce..353b52d7e0e 100644 --- a/src/common/Common.hpp +++ b/src/common/Common.hpp @@ -1,9 +1,5 @@ #pragma once -#include "common/Aliases.hpp" -#include "common/Outcome.hpp" -#include "common/ProviderId.hpp" - #include #include #include @@ -20,11 +16,6 @@ enum class HighlightState { NewMessage, }; -inline QString qS(const std::string &string) -{ - return QString::fromStdString(string); -} - const Qt::KeyboardModifiers showSplitOverlayModifiers = Qt::ControlModifier | Qt::AltModifier; const Qt::KeyboardModifiers showAddSplitRegions = diff --git a/src/common/CompletionModel.cpp b/src/common/CompletionModel.cpp index 0c76dc91d86..08bddf2e8b7 100644 --- a/src/common/CompletionModel.cpp +++ b/src/common/CompletionModel.cpp @@ -3,6 +3,7 @@ #include "Application.hpp" #include "common/ChatterSet.hpp" #include "controllers/accounts/AccountController.hpp" +#include "controllers/commands/Command.hpp" #include "controllers/commands/CommandController.hpp" #include "messages/Emote.hpp" #include "providers/twitch/TwitchAccount.hpp" diff --git a/src/common/DownloadManager.hpp b/src/common/DownloadManager.hpp index c41cae9c8d7..b1f6b6fb565 100644 --- a/src/common/DownloadManager.hpp +++ b/src/common/DownloadManager.hpp @@ -3,9 +3,7 @@ #include #include #include -#include #include -#include namespace chatterino { diff --git a/src/common/LinkParser.hpp b/src/common/LinkParser.hpp index 907d22a80c4..8350f466858 100644 --- a/src/common/LinkParser.hpp +++ b/src/common/LinkParser.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include namespace chatterino { diff --git a/src/common/NetworkRequest.hpp b/src/common/NetworkRequest.hpp index 3d1140c3f32..384c49f31ad 100644 --- a/src/common/NetworkRequest.hpp +++ b/src/common/NetworkRequest.hpp @@ -1,7 +1,6 @@ #pragma once #include "common/NetworkCommon.hpp" -#include "common/NetworkResult.hpp" #include diff --git a/src/common/SignalVectorModel.hpp b/src/common/SignalVectorModel.hpp index 8a9a8f37777..8cd5eaf6214 100644 --- a/src/common/SignalVectorModel.hpp +++ b/src/common/SignalVectorModel.hpp @@ -10,6 +10,12 @@ namespace chatterino { +template +class SignalVector; + +template +struct SignalVectorItemEvent; + template class SignalVectorModel : public QAbstractTableModel, pajlada::Signals::SignalHolder diff --git a/src/controllers/accounts/AccountController.cpp b/src/controllers/accounts/AccountController.cpp index 2692b05a95a..0ba3bc95974 100644 --- a/src/controllers/accounts/AccountController.cpp +++ b/src/controllers/accounts/AccountController.cpp @@ -3,6 +3,7 @@ #include "controllers/accounts/Account.hpp" #include "controllers/accounts/AccountModel.hpp" #include "providers/twitch/TwitchAccount.hpp" +#include "util/SharedPtrElementLess.hpp" namespace chatterino { diff --git a/src/controllers/accounts/AccountController.hpp b/src/controllers/accounts/AccountController.hpp index 1cf6ae931ff..a19af9692c1 100644 --- a/src/controllers/accounts/AccountController.hpp +++ b/src/controllers/accounts/AccountController.hpp @@ -3,7 +3,6 @@ #include "common/SignalVector.hpp" #include "common/Singleton.hpp" #include "providers/twitch/TwitchAccountManager.hpp" -#include "util/SharedPtrElementLess.hpp" #include diff --git a/src/controllers/accounts/AccountModel.hpp b/src/controllers/accounts/AccountModel.hpp index e5aea0641c1..2552a00b752 100644 --- a/src/controllers/accounts/AccountModel.hpp +++ b/src/controllers/accounts/AccountModel.hpp @@ -1,7 +1,6 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/accounts/Account.hpp" #include "util/QStringHash.hpp" #include diff --git a/src/controllers/commands/CommandContext.hpp b/src/controllers/commands/CommandContext.hpp index ced3b36b359..4ed526645d0 100644 --- a/src/controllers/commands/CommandContext.hpp +++ b/src/controllers/commands/CommandContext.hpp @@ -1,12 +1,15 @@ #pragma once -#include "common/Channel.hpp" -#include "providers/twitch/TwitchChannel.hpp" - #include +#include + namespace chatterino { +class Channel; +using ChannelPtr = std::shared_ptr; +class TwitchChannel; + struct CommandContext { QStringList words; diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index 6d698438ee9..7268d335674 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -1,21 +1,25 @@ -#include "CommandController.hpp" +#include "controllers/commands/CommandController.hpp" #include "Application.hpp" #include "common/Env.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" #include "common/SignalVector.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/commands/builtin/twitch/ChatSettings.hpp" #include "controllers/commands/Command.hpp" +#include "controllers/commands/CommandContext.hpp" #include "controllers/commands/CommandModel.hpp" #include "controllers/userdata/UserDataController.hpp" #include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" #include "messages/MessageElement.hpp" +#include "messages/MessageThread.hpp" #include "providers/irc/IrcChannel2.hpp" #include "providers/irc/IrcServer.hpp" #include "providers/twitch/api/Helix.hpp" #include "providers/twitch/TwitchAccount.hpp" +#include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchCommon.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" @@ -35,6 +39,7 @@ #include "util/Twitch.hpp" #include "widgets/dialogs/ReplyThreadPopup.hpp" #include "widgets/dialogs/UserInfoPopup.hpp" +#include "widgets/helper/ChannelView.hpp" #include "widgets/splits/Split.hpp" #include "widgets/splits/SplitContainer.hpp" #include "widgets/Window.hpp" diff --git a/src/controllers/commands/CommandController.hpp b/src/controllers/commands/CommandController.hpp index f05e6c4ede9..fcae24249f7 100644 --- a/src/controllers/commands/CommandController.hpp +++ b/src/controllers/commands/CommandController.hpp @@ -1,11 +1,8 @@ #pragma once -#include "common/ChatterinoSetting.hpp" #include "common/SignalVector.hpp" #include "common/Singleton.hpp" -#include "controllers/commands/Command.hpp" -#include "controllers/commands/CommandContext.hpp" -#include "providers/twitch/TwitchChannel.hpp" +#include "util/QStringHash.hpp" #include #include @@ -20,8 +17,12 @@ namespace chatterino { class Settings; class Paths; class Channel; +using ChannelPtr = std::shared_ptr; +struct Message; +struct Command; class CommandModel; +struct CommandContext; class CommandController final : public Singleton { diff --git a/src/controllers/commands/CommandModel.cpp b/src/controllers/commands/CommandModel.cpp index a3117d3ab21..1bee92be218 100644 --- a/src/controllers/commands/CommandModel.cpp +++ b/src/controllers/commands/CommandModel.cpp @@ -1,5 +1,7 @@ -#include "CommandModel.hpp" +#include "controllers/commands/CommandModel.hpp" +#include "common/SignalVector.hpp" +#include "controllers/commands/Command.hpp" #include "util/StandardItemHelper.hpp" namespace chatterino { diff --git a/src/controllers/commands/CommandModel.hpp b/src/controllers/commands/CommandModel.hpp index 30bf0f5ee41..628a6085902 100644 --- a/src/controllers/commands/CommandModel.hpp +++ b/src/controllers/commands/CommandModel.hpp @@ -1,13 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/commands/Command.hpp" #include namespace chatterino { class CommandController; +struct Command; class CommandModel : public SignalVectorModel { diff --git a/src/controllers/commands/builtin/twitch/ChatSettings.cpp b/src/controllers/commands/builtin/twitch/ChatSettings.cpp index 40387d4ae31..ed687261561 100644 --- a/src/controllers/commands/builtin/twitch/ChatSettings.cpp +++ b/src/controllers/commands/builtin/twitch/ChatSettings.cpp @@ -2,6 +2,7 @@ #include "Application.hpp" #include "controllers/accounts/AccountController.hpp" +#include "controllers/commands/CommandContext.hpp" #include "messages/MessageBuilder.hpp" #include "providers/twitch/api/Helix.hpp" #include "providers/twitch/TwitchAccount.hpp" diff --git a/src/controllers/commands/builtin/twitch/ChatSettings.hpp b/src/controllers/commands/builtin/twitch/ChatSettings.hpp index 08932160e50..9362de12ce7 100644 --- a/src/controllers/commands/builtin/twitch/ChatSettings.hpp +++ b/src/controllers/commands/builtin/twitch/ChatSettings.hpp @@ -1,24 +1,28 @@ #pragma once -#include "controllers/commands/CommandContext.hpp" - #include -namespace chatterino::commands { +namespace chatterino { + +struct CommandContext; + +namespace commands { + + QString emoteOnly(const CommandContext &ctx); + QString emoteOnlyOff(const CommandContext &ctx); -QString emoteOnly(const CommandContext &ctx); -QString emoteOnlyOff(const CommandContext &ctx); + QString subscribers(const CommandContext &ctx); + QString subscribersOff(const CommandContext &ctx); -QString subscribers(const CommandContext &ctx); -QString subscribersOff(const CommandContext &ctx); + QString slow(const CommandContext &ctx); + QString slowOff(const CommandContext &ctx); -QString slow(const CommandContext &ctx); -QString slowOff(const CommandContext &ctx); + QString followers(const CommandContext &ctx); + QString followersOff(const CommandContext &ctx); -QString followers(const CommandContext &ctx); -QString followersOff(const CommandContext &ctx); + QString uniqueChat(const CommandContext &ctx); + QString uniqueChatOff(const CommandContext &ctx); -QString uniqueChat(const CommandContext &ctx); -QString uniqueChatOff(const CommandContext &ctx); +} // namespace commands -} // namespace chatterino::commands +} // namespace chatterino diff --git a/src/controllers/filters/FilterModel.cpp b/src/controllers/filters/FilterModel.cpp index 68d91ec4f02..5ce793eb640 100644 --- a/src/controllers/filters/FilterModel.cpp +++ b/src/controllers/filters/FilterModel.cpp @@ -1,6 +1,7 @@ -#include "FilterModel.hpp" +#include "controllers/filters/FilterModel.hpp" #include "Application.hpp" +#include "controllers/filters/FilterRecord.hpp" #include "singletons/Settings.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/filters/FilterModel.hpp b/src/controllers/filters/FilterModel.hpp index ffa4a1060a0..14c0fd66bcf 100644 --- a/src/controllers/filters/FilterModel.hpp +++ b/src/controllers/filters/FilterModel.hpp @@ -1,12 +1,14 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/filters/FilterRecord.hpp" #include namespace chatterino { +class FilterRecord; +using FilterRecordPtr = std::shared_ptr; + class FilterModel : public SignalVectorModel { public: diff --git a/src/controllers/filters/FilterRecord.cpp b/src/controllers/filters/FilterRecord.cpp new file mode 100644 index 00000000000..24bd22f6212 --- /dev/null +++ b/src/controllers/filters/FilterRecord.cpp @@ -0,0 +1,53 @@ +#include "controllers/filters/FilterRecord.hpp" + +namespace chatterino { + +FilterRecord::FilterRecord(const QString &name, const QString &filter) + : name_(name) + , filter_(filter) + , id_(QUuid::createUuid()) + , parser_(std::make_unique(filter)) +{ +} + +FilterRecord::FilterRecord(const QString &name, const QString &filter, + const QUuid &id) + : name_(name) + , filter_(filter) + , id_(id) + , parser_(std::make_unique(filter)) +{ +} + +const QString &FilterRecord::getName() const +{ + return this->name_; +} + +const QString &FilterRecord::getFilter() const +{ + return this->filter_; +} + +const QUuid &FilterRecord::getId() const +{ + return this->id_; +} + +bool FilterRecord::valid() const +{ + return this->parser_->valid(); +} + +bool FilterRecord::filter(const filterparser::ContextMap &context) const +{ + return this->parser_->execute(context); +} + +bool FilterRecord::operator==(const FilterRecord &other) const +{ + return std::tie(this->name_, this->filter_, this->id_) == + std::tie(other.name_, other.filter_, other.id_); +} + +} // namespace chatterino diff --git a/src/controllers/filters/FilterRecord.hpp b/src/controllers/filters/FilterRecord.hpp index e18a1d48bf4..bb6eeeff327 100644 --- a/src/controllers/filters/FilterRecord.hpp +++ b/src/controllers/filters/FilterRecord.hpp @@ -1,7 +1,6 @@ #pragma once #include "controllers/filters/parser/FilterParser.hpp" -#include "controllers/filters/parser/Types.hpp" #include "util/RapidjsonHelpers.hpp" #include "util/RapidJsonSerializeQString.hpp" @@ -17,52 +16,21 @@ namespace chatterino { class FilterRecord { public: - bool operator==(const FilterRecord &other) const - { - return std::tie(this->name_, this->filter_, this->id_) == - std::tie(other.name_, other.filter_, other.id_); - } + FilterRecord(const QString &name, const QString &filter); - FilterRecord(const QString &name, const QString &filter) - : name_(name) - , filter_(filter) - , id_(QUuid::createUuid()) - , parser_(std::make_unique(filter)) - { - } + FilterRecord(const QString &name, const QString &filter, const QUuid &id); - FilterRecord(const QString &name, const QString &filter, const QUuid &id) - : name_(name) - , filter_(filter) - , id_(id) - , parser_(std::make_unique(filter)) - { - } + const QString &getName() const; - const QString &getName() const - { - return this->name_; - } + const QString &getFilter() const; - const QString &getFilter() const - { - return this->filter_; - } + const QUuid &getId() const; - const QUuid &getId() const - { - return this->id_; - } + bool valid() const; - bool valid() const - { - return this->parser_->valid(); - } + bool filter(const filterparser::ContextMap &context) const; - bool filter(const filterparser::ContextMap &context) const - { - return this->parser_->execute(context); - } + bool operator==(const FilterRecord &other) const; private: QString name_; diff --git a/src/controllers/filters/FilterSet.cpp b/src/controllers/filters/FilterSet.cpp new file mode 100644 index 00000000000..8bd20414cf5 --- /dev/null +++ b/src/controllers/filters/FilterSet.cpp @@ -0,0 +1,78 @@ +#include "controllers/filters/FilterSet.hpp" + +#include "controllers/filters/FilterRecord.hpp" +#include "singletons/Settings.hpp" + +namespace chatterino { + +FilterSet::FilterSet() +{ + this->listener_ = + getCSettings().filterRecords.delayedItemsChanged.connect([this] { + this->reloadFilters(); + }); +} + +FilterSet::FilterSet(const QList &filterIds) +{ + auto filters = getCSettings().filterRecords.readOnly(); + for (const auto &f : *filters) + { + if (filterIds.contains(f->getId())) + this->filters_.insert(f->getId(), f); + } + + this->listener_ = + getCSettings().filterRecords.delayedItemsChanged.connect([this] { + this->reloadFilters(); + }); +} + +FilterSet::~FilterSet() +{ + this->listener_.disconnect(); +} + +bool FilterSet::filter(const MessagePtr &m, ChannelPtr channel) const +{ + if (this->filters_.size() == 0) + return true; + + filterparser::ContextMap context = + filterparser::buildContextMap(m, channel.get()); + for (const auto &f : this->filters_.values()) + { + if (!f->valid() || !f->filter(context)) + return false; + } + + return true; +} + +const QList FilterSet::filterIds() const +{ + return this->filters_.keys(); +} + +void FilterSet::reloadFilters() +{ + auto filters = getCSettings().filterRecords.readOnly(); + for (const auto &key : this->filters_.keys()) + { + bool found = false; + for (const auto &f : *filters) + { + if (f->getId() == key) + { + found = true; + this->filters_.insert(key, f); + } + } + if (!found) + { + this->filters_.remove(key); + } + } +} + +} // namespace chatterino diff --git a/src/controllers/filters/FilterSet.hpp b/src/controllers/filters/FilterSet.hpp index 687f79964da..dd1501664b6 100644 --- a/src/controllers/filters/FilterSet.hpp +++ b/src/controllers/filters/FilterSet.hpp @@ -1,86 +1,37 @@ #pragma once -#include "controllers/filters/FilterRecord.hpp" -#include "singletons/Settings.hpp" +#include +#include +#include +#include + +#include namespace chatterino { +class FilterRecord; +using FilterRecordPtr = std::shared_ptr; +struct Message; +class Channel; +using MessagePtr = std::shared_ptr; +using ChannelPtr = std::shared_ptr; + class FilterSet { public: - FilterSet() - { - this->listener_ = - getCSettings().filterRecords.delayedItemsChanged.connect([this] { - this->reloadFilters(); - }); - } - - FilterSet(const QList &filterIds) - { - auto filters = getCSettings().filterRecords.readOnly(); - for (const auto &f : *filters) - { - if (filterIds.contains(f->getId())) - this->filters_.insert(f->getId(), f); - } - - this->listener_ = - getCSettings().filterRecords.delayedItemsChanged.connect([this] { - this->reloadFilters(); - }); - } - - ~FilterSet() - { - this->listener_.disconnect(); - } - - bool filter(const MessagePtr &m, ChannelPtr channel) const - { - if (this->filters_.size() == 0) - return true; - - filterparser::ContextMap context = - filterparser::buildContextMap(m, channel.get()); - for (const auto &f : this->filters_.values()) - { - if (!f->valid() || !f->filter(context)) - return false; - } + FilterSet(); + FilterSet(const QList &filterIds); - return true; - } + ~FilterSet(); - const QList filterIds() const - { - return this->filters_.keys(); - } + bool filter(const MessagePtr &m, ChannelPtr channel) const; + const QList filterIds() const; private: QMap filters_; pajlada::Signals::Connection listener_; - void reloadFilters() - { - auto filters = getCSettings().filterRecords.readOnly(); - for (const auto &key : this->filters_.keys()) - { - bool found = false; - for (const auto &f : *filters) - { - if (f->getId() == key) - { - found = true; - this->filters_.insert(key, f); - } - } - if (!found) - { - this->filters_.remove(key); - } - } - } + void reloadFilters(); }; using FilterSetPtr = std::shared_ptr; diff --git a/src/controllers/filters/parser/FilterParser.cpp b/src/controllers/filters/parser/FilterParser.cpp index 9e71a365b6e..00c5bd6b76c 100644 --- a/src/controllers/filters/parser/FilterParser.cpp +++ b/src/controllers/filters/parser/FilterParser.cpp @@ -3,6 +3,9 @@ #include "Application.hpp" #include "common/Channel.hpp" #include "controllers/filters/parser/Types.hpp" +#include "messages/Message.hpp" +#include "providers/twitch/TwitchBadge.hpp" +#include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" namespace filterparser { diff --git a/src/controllers/filters/parser/Types.hpp b/src/controllers/filters/parser/Types.hpp index 0d8c7a5b23c..d6fcd7c9ecb 100644 --- a/src/controllers/filters/parser/Types.hpp +++ b/src/controllers/filters/parser/Types.hpp @@ -1,9 +1,15 @@ #pragma once -#include "messages/Message.hpp" - #include +#include + +namespace chatterino { + +struct Message; + +} + namespace filterparser { using MessagePtr = std::shared_ptr; diff --git a/src/controllers/highlights/BadgeHighlightModel.cpp b/src/controllers/highlights/BadgeHighlightModel.cpp index 3e1c10a2051..ffca5b28914 100644 --- a/src/controllers/highlights/BadgeHighlightModel.cpp +++ b/src/controllers/highlights/BadgeHighlightModel.cpp @@ -1,7 +1,11 @@ -#include "BadgeHighlightModel.hpp" +#include "controllers/highlights/BadgeHighlightModel.hpp" #include "Application.hpp" +#include "common/SignalVectorModel.hpp" +#include "controllers/highlights/HighlightBadge.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" #include "messages/Emote.hpp" +#include "providers/twitch/TwitchBadges.hpp" #include "singletons/Settings.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/highlights/BadgeHighlightModel.hpp b/src/controllers/highlights/BadgeHighlightModel.hpp index 0103dcb2c93..cf3b8501c76 100644 --- a/src/controllers/highlights/BadgeHighlightModel.hpp +++ b/src/controllers/highlights/BadgeHighlightModel.hpp @@ -1,14 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/highlights/HighlightBadge.hpp" -#include "providers/twitch/TwitchBadges.hpp" #include namespace chatterino { class HighlightController; +class HighlightBadge; class BadgeHighlightModel : public SignalVectorModel { diff --git a/src/controllers/highlights/HighlightBadge.cpp b/src/controllers/highlights/HighlightBadge.cpp index 899b59c3964..b4452a22b14 100644 --- a/src/controllers/highlights/HighlightBadge.cpp +++ b/src/controllers/highlights/HighlightBadge.cpp @@ -1,6 +1,7 @@ #include "HighlightBadge.hpp" #include "messages/SharedMessageBuilder.hpp" +#include "providers/twitch/TwitchBadge.hpp" #include "singletons/Resources.hpp" namespace chatterino { diff --git a/src/controllers/highlights/HighlightBadge.hpp b/src/controllers/highlights/HighlightBadge.hpp index 0605fd8da90..d1013c3f045 100644 --- a/src/controllers/highlights/HighlightBadge.hpp +++ b/src/controllers/highlights/HighlightBadge.hpp @@ -1,14 +1,19 @@ #pragma once -#include "providers/twitch/TwitchBadge.hpp" #include "util/RapidjsonHelpers.hpp" #include "util/RapidJsonSerializeQString.hpp" #include +#include #include #include +#include + namespace chatterino { + +class Badge; + class HighlightBadge { public: diff --git a/src/controllers/highlights/HighlightBlacklistModel.cpp b/src/controllers/highlights/HighlightBlacklistModel.cpp index 0ff68bc0ba3..8bfc09867d8 100644 --- a/src/controllers/highlights/HighlightBlacklistModel.cpp +++ b/src/controllers/highlights/HighlightBlacklistModel.cpp @@ -1,6 +1,7 @@ #include "controllers/highlights/HighlightBlacklistModel.hpp" #include "Application.hpp" +#include "controllers/highlights/HighlightBlacklistUser.hpp" #include "singletons/Settings.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/highlights/HighlightBlacklistModel.hpp b/src/controllers/highlights/HighlightBlacklistModel.hpp index d18963ccb4f..414af461a65 100644 --- a/src/controllers/highlights/HighlightBlacklistModel.hpp +++ b/src/controllers/highlights/HighlightBlacklistModel.hpp @@ -1,12 +1,12 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/highlights/HighlightBlacklistUser.hpp" #include namespace chatterino { +class HighlightBlacklistUser; class HighlightController; class HighlightBlacklistModel : public SignalVectorModel diff --git a/src/controllers/highlights/HighlightController.cpp b/src/controllers/highlights/HighlightController.cpp index 785eb047dd5..58eee196efb 100644 --- a/src/controllers/highlights/HighlightController.cpp +++ b/src/controllers/highlights/HighlightController.cpp @@ -1,7 +1,17 @@ #include "controllers/highlights/HighlightController.hpp" +#include "Application.hpp" #include "common/QLogging.hpp" +#include "controllers/accounts/AccountController.hpp" +#include "controllers/highlights/HighlightBadge.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" +#include "messages/Message.hpp" +#include "messages/MessageBuilder.hpp" +#include "providers/colors/ColorProvider.hpp" #include "providers/twitch/TwitchAccount.hpp" +#include "providers/twitch/TwitchBadge.hpp" +#include "singletons/Paths.hpp" +#include "singletons/Settings.hpp" namespace { @@ -282,6 +292,89 @@ void rebuildBadgeHighlights(Settings &settings, namespace chatterino { +HighlightResult::HighlightResult(bool _alert, bool _playSound, + boost::optional _customSoundUrl, + std::shared_ptr _color, + bool _showInMentions) + : alert(_alert) + , playSound(_playSound) + , customSoundUrl(std::move(_customSoundUrl)) + , color(std::move(_color)) + , showInMentions(_showInMentions) +{ +} + +HighlightResult HighlightResult::emptyResult() +{ + return { + false, false, boost::none, nullptr, false, + }; +} + +bool HighlightResult::operator==(const HighlightResult &other) const +{ + if (this->alert != other.alert) + { + return false; + } + if (this->playSound != other.playSound) + { + return false; + } + if (this->customSoundUrl != other.customSoundUrl) + { + return false; + } + + if (this->color && other.color) + { + if (*this->color != *other.color) + { + return false; + } + } + + if (this->showInMentions != other.showInMentions) + { + return false; + } + + return true; +} + +bool HighlightResult::operator!=(const HighlightResult &other) const +{ + return !(*this == other); +} + +bool HighlightResult::empty() const +{ + return !this->alert && !this->playSound && + !this->customSoundUrl.has_value() && !this->color && + !this->showInMentions; +} + +bool HighlightResult::full() const +{ + return this->alert && this->playSound && this->customSoundUrl.has_value() && + this->color && this->showInMentions; +} + +std::ostream &operator<<(std::ostream &os, const HighlightResult &result) +{ + os << "Alert: " << (result.alert ? "Yes" : "No") << ", " + << "Play sound: " << (result.playSound ? "Yes" : "No") << " (" + << (result.customSoundUrl + ? result.customSoundUrl.get().toString().toStdString() + : "") + << ")" + << ", " + << "Color: " << (result.color ? result.color->name().toStdString() : "") + << ", " + << "Show in mentions: " << (result.showInMentions ? "Yes" : "No"); + return os; +} + void HighlightController::initialize(Settings &settings, Paths & /*paths*/) { this->rebuildListener_.addSetting(settings.enableSelfHighlight); diff --git a/src/controllers/highlights/HighlightController.hpp b/src/controllers/highlights/HighlightController.hpp index 3f4b37e579f..7e238d81737 100644 --- a/src/controllers/highlights/HighlightController.hpp +++ b/src/controllers/highlights/HighlightController.hpp @@ -1,13 +1,12 @@ #pragma once +#include "common/FlagsEnum.hpp" #include "common/Singleton.hpp" #include "common/UniqueAccess.hpp" -#include "messages/MessageBuilder.hpp" -#include "providers/twitch/TwitchBadge.hpp" -#include "singletons/Paths.hpp" -#include "singletons/Settings.hpp" #include +#include +#include #include #include @@ -17,27 +16,20 @@ namespace chatterino { +class Badge; +struct MessageParseArgs; +enum class MessageFlag : int64_t; +using MessageFlags = FlagsEnum; + struct HighlightResult { HighlightResult(bool _alert, bool _playSound, boost::optional _customSoundUrl, - std::shared_ptr _color, bool _showInMentions) - : alert(_alert) - , playSound(_playSound) - , customSoundUrl(std::move(_customSoundUrl)) - , color(std::move(_color)) - , showInMentions(_showInMentions) - { - } + std::shared_ptr _color, bool _showInMentions); /** * @brief Construct an empty HighlightResult with all side-effects disabled **/ - static HighlightResult emptyResult() - { - return { - false, false, boost::none, nullptr, false, - }; - } + static HighlightResult emptyResult(); /** * @brief true if highlight should trigger the taskbar to flash @@ -66,77 +58,21 @@ struct HighlightResult { **/ bool showInMentions{false}; - bool operator==(const HighlightResult &other) const - { - if (this->alert != other.alert) - { - return false; - } - if (this->playSound != other.playSound) - { - return false; - } - if (this->customSoundUrl != other.customSoundUrl) - { - return false; - } - - if (this->color && other.color) - { - if (*this->color != *other.color) - { - return false; - } - } - - if (this->showInMentions != other.showInMentions) - { - return false; - } - - return true; - } - - bool operator!=(const HighlightResult &other) const - { - return !(*this == other); - } + bool operator==(const HighlightResult &other) const; + bool operator!=(const HighlightResult &other) const; /** * @brief Returns true if no side-effect has been enabled **/ - [[nodiscard]] bool empty() const - { - return !this->alert && !this->playSound && - !this->customSoundUrl.has_value() && !this->color && - !this->showInMentions; - } + [[nodiscard]] bool empty() const; /** * @brief Returns true if all side-effects have been enabled **/ - [[nodiscard]] bool full() const - { - return this->alert && this->playSound && - this->customSoundUrl.has_value() && this->color && - this->showInMentions; - } + [[nodiscard]] bool full() const; friend std::ostream &operator<<(std::ostream &os, - const HighlightResult &result) - { - os << "Alert: " << (result.alert ? "Yes" : "No") << ", " - << "Play sound: " << (result.playSound ? "Yes" : "No") << " (" - << (result.customSoundUrl - ? result.customSoundUrl.get().toString().toStdString() - : "") - << ")" - << ", " - << "Color: " - << (result.color ? result.color->name().toStdString() : "") << ", " - << "Show in mentions: " << (result.showInMentions ? "Yes" : "No"); - return os; - } + const HighlightResult &result); }; struct HighlightCheck { diff --git a/src/controllers/highlights/HighlightModel.cpp b/src/controllers/highlights/HighlightModel.cpp index 19f052649da..13ff5ec6b71 100644 --- a/src/controllers/highlights/HighlightModel.cpp +++ b/src/controllers/highlights/HighlightModel.cpp @@ -1,6 +1,9 @@ -#include "HighlightModel.hpp" +#include "controllers/highlights/HighlightModel.hpp" #include "Application.hpp" +#include "common/SignalVectorModel.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" +#include "providers/colors/ColorProvider.hpp" #include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/highlights/HighlightModel.hpp b/src/controllers/highlights/HighlightModel.hpp index 98fa78e00d9..7f20a9c6c39 100644 --- a/src/controllers/highlights/HighlightModel.hpp +++ b/src/controllers/highlights/HighlightModel.hpp @@ -1,12 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/highlights/HighlightPhrase.hpp" #include namespace chatterino { +class HighlightPhrase; + class HighlightModel : public SignalVectorModel { public: diff --git a/src/controllers/highlights/HighlightPhrase.hpp b/src/controllers/highlights/HighlightPhrase.hpp index 4cf9faff089..392f13e285f 100644 --- a/src/controllers/highlights/HighlightPhrase.hpp +++ b/src/controllers/highlights/HighlightPhrase.hpp @@ -1,6 +1,5 @@ #pragma once -#include "providers/colors/ColorProvider.hpp" #include "util/RapidjsonHelpers.hpp" #include "util/RapidJsonSerializeQString.hpp" diff --git a/src/controllers/highlights/UserHighlightModel.cpp b/src/controllers/highlights/UserHighlightModel.cpp index 8a6596a7489..42aeb819fdb 100644 --- a/src/controllers/highlights/UserHighlightModel.cpp +++ b/src/controllers/highlights/UserHighlightModel.cpp @@ -2,6 +2,7 @@ #include "Application.hpp" #include "controllers/highlights/HighlightModel.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" #include "singletons/Settings.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/highlights/UserHighlightModel.hpp b/src/controllers/highlights/UserHighlightModel.hpp index 11edd2c47b5..fa2811ddcb6 100644 --- a/src/controllers/highlights/UserHighlightModel.hpp +++ b/src/controllers/highlights/UserHighlightModel.hpp @@ -1,13 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/highlights/HighlightPhrase.hpp" #include namespace chatterino { class HighlightController; +class HighlightPhrase; class UserHighlightModel : public SignalVectorModel { diff --git a/src/controllers/hotkeys/ActionNames.hpp b/src/controllers/hotkeys/ActionNames.hpp index 538fc42e1b7..8d5700ac428 100644 --- a/src/controllers/hotkeys/ActionNames.hpp +++ b/src/controllers/hotkeys/ActionNames.hpp @@ -1,6 +1,6 @@ #pragma once -#include "HotkeyCategory.hpp" +#include "controllers/hotkeys/HotkeyCategory.hpp" #include diff --git a/src/controllers/hotkeys/HotkeyController.cpp b/src/controllers/hotkeys/HotkeyController.cpp index f45b98a61f9..df6639756be 100644 --- a/src/controllers/hotkeys/HotkeyController.cpp +++ b/src/controllers/hotkeys/HotkeyController.cpp @@ -1,6 +1,7 @@ #include "controllers/hotkeys/HotkeyController.hpp" #include "common/QLogging.hpp" +#include "controllers/hotkeys/Hotkey.hpp" #include "controllers/hotkeys/HotkeyCategory.hpp" #include "controllers/hotkeys/HotkeyModel.hpp" #include "singletons/Settings.hpp" diff --git a/src/controllers/hotkeys/HotkeyModel.cpp b/src/controllers/hotkeys/HotkeyModel.cpp index 33fd406434f..2089bab5a26 100644 --- a/src/controllers/hotkeys/HotkeyModel.cpp +++ b/src/controllers/hotkeys/HotkeyModel.cpp @@ -1,6 +1,7 @@ #include "controllers/hotkeys/HotkeyModel.hpp" #include "common/QLogging.hpp" +#include "controllers/hotkeys/Hotkey.hpp" #include "util/StandardItemHelper.hpp" namespace chatterino { diff --git a/src/controllers/hotkeys/HotkeyModel.hpp b/src/controllers/hotkeys/HotkeyModel.hpp index f23b9537314..98c59ca5eac 100644 --- a/src/controllers/hotkeys/HotkeyModel.hpp +++ b/src/controllers/hotkeys/HotkeyModel.hpp @@ -1,7 +1,6 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/hotkeys/Hotkey.hpp" #include "util/QStringHash.hpp" #include @@ -9,6 +8,7 @@ namespace chatterino { class HotkeyController; +class Hotkey; class HotkeyModel : public SignalVectorModel> { diff --git a/src/controllers/ignores/IgnoreController.cpp b/src/controllers/ignores/IgnoreController.cpp index 0e3e0601877..e3df12e4755 100644 --- a/src/controllers/ignores/IgnoreController.cpp +++ b/src/controllers/ignores/IgnoreController.cpp @@ -1,6 +1,8 @@ #include "controllers/ignores/IgnoreController.hpp" +#include "Application.hpp" #include "common/QLogging.hpp" +#include "controllers/accounts/AccountController.hpp" #include "controllers/ignores/IgnorePhrase.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "singletons/Settings.hpp" diff --git a/src/controllers/ignores/IgnoreModel.cpp b/src/controllers/ignores/IgnoreModel.cpp index cbecbb4d9f9..3702a427061 100644 --- a/src/controllers/ignores/IgnoreModel.cpp +++ b/src/controllers/ignores/IgnoreModel.cpp @@ -1,6 +1,7 @@ -#include "IgnoreModel.hpp" +#include "controllers/ignores/IgnoreModel.hpp" #include "Application.hpp" +#include "controllers/ignores/IgnorePhrase.hpp" #include "singletons/Settings.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/ignores/IgnoreModel.hpp b/src/controllers/ignores/IgnoreModel.hpp index 9904d78748a..915a880bdad 100644 --- a/src/controllers/ignores/IgnoreModel.hpp +++ b/src/controllers/ignores/IgnoreModel.hpp @@ -1,12 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/ignores/IgnorePhrase.hpp" #include namespace chatterino { +class IgnorePhrase; + class IgnoreModel : public SignalVectorModel { public: diff --git a/src/controllers/ignores/IgnorePhrase.cpp b/src/controllers/ignores/IgnorePhrase.cpp index a7b8519e92c..d5f7a301e56 100644 --- a/src/controllers/ignores/IgnorePhrase.cpp +++ b/src/controllers/ignores/IgnorePhrase.cpp @@ -3,6 +3,7 @@ #include "Application.hpp" #include "controllers/accounts/AccountController.hpp" #include "providers/twitch/TwitchAccount.hpp" +#include "singletons/Settings.hpp" namespace chatterino { @@ -112,4 +113,10 @@ bool IgnorePhrase::containsEmote() const return !this->emotes_.empty(); } +IgnorePhrase IgnorePhrase::createEmpty() +{ + return IgnorePhrase(QString(), false, false, + getSettings()->ignoredPhraseReplace.getValue(), true); +} + } // namespace chatterino diff --git a/src/controllers/ignores/IgnorePhrase.hpp b/src/controllers/ignores/IgnorePhrase.hpp index 5c311b66978..5ff129fd042 100644 --- a/src/controllers/ignores/IgnorePhrase.hpp +++ b/src/controllers/ignores/IgnorePhrase.hpp @@ -1,7 +1,6 @@ #pragma once -#include "messages/Emote.hpp" -#include "singletons/Settings.hpp" +#include "common/Aliases.hpp" #include "util/RapidjsonHelpers.hpp" #include "util/RapidJsonSerializeQString.hpp" @@ -9,10 +8,14 @@ #include #include +#include #include namespace chatterino { +struct Emote; +using EmotePtr = std::shared_ptr; + class IgnorePhrase { public: @@ -43,6 +46,8 @@ class IgnorePhrase bool containsEmote() const; + static IgnorePhrase createEmpty(); + private: QString pattern_; bool isRegex_; @@ -82,10 +87,7 @@ struct Deserialize { if (!value.IsObject()) { PAJLADA_REPORT_ERROR(error) - return chatterino::IgnorePhrase( - QString(), false, false, - ::chatterino::getSettings()->ignoredPhraseReplace.getValue(), - true); + return chatterino::IgnorePhrase::createEmpty(); } QString _pattern; diff --git a/src/controllers/moderationactions/ModerationAction.cpp b/src/controllers/moderationactions/ModerationAction.cpp index 7f4039f98f8..de26613c2c6 100644 --- a/src/controllers/moderationactions/ModerationAction.cpp +++ b/src/controllers/moderationactions/ModerationAction.cpp @@ -1,6 +1,7 @@ -#include "ModerationAction.hpp" +#include "controllers/moderationactions/ModerationAction.hpp" #include "Application.hpp" +#include "debug/AssertInGuiThread.hpp" #include "messages/Image.hpp" #include "singletons/Resources.hpp" diff --git a/src/controllers/moderationactions/ModerationActionModel.cpp b/src/controllers/moderationactions/ModerationActionModel.cpp index 00c8f6e7a73..d6595556d51 100644 --- a/src/controllers/moderationactions/ModerationActionModel.cpp +++ b/src/controllers/moderationactions/ModerationActionModel.cpp @@ -1,5 +1,6 @@ -#include "ModerationActionModel.hpp" +#include "controllers/moderationactions/ModerationActionModel.hpp" +#include "controllers/moderationactions/ModerationAction.hpp" #include "util/StandardItemHelper.hpp" namespace chatterino { diff --git a/src/controllers/moderationactions/ModerationActionModel.hpp b/src/controllers/moderationactions/ModerationActionModel.hpp index eb62bab9287..065e6f417ad 100644 --- a/src/controllers/moderationactions/ModerationActionModel.hpp +++ b/src/controllers/moderationactions/ModerationActionModel.hpp @@ -1,12 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/moderationactions/ModerationAction.hpp" #include namespace chatterino { +class ModerationAction; + class ModerationActionModel : public SignalVectorModel { public: diff --git a/src/controllers/nicknames/Nickname.hpp b/src/controllers/nicknames/Nickname.hpp index 79cb264264d..529f5fa0db9 100644 --- a/src/controllers/nicknames/Nickname.hpp +++ b/src/controllers/nicknames/Nickname.hpp @@ -1,6 +1,5 @@ #pragma once -#include "controllers/accounts/AccountController.hpp" #include "util/RapidjsonHelpers.hpp" #include "util/RapidJsonSerializeQString.hpp" diff --git a/src/controllers/nicknames/NicknamesModel.cpp b/src/controllers/nicknames/NicknamesModel.cpp index 2028fa3e2d3..4277b128f65 100644 --- a/src/controllers/nicknames/NicknamesModel.cpp +++ b/src/controllers/nicknames/NicknamesModel.cpp @@ -1,6 +1,7 @@ -#include "NicknamesModel.hpp" +#include "controllers/nicknames/NicknamesModel.hpp" #include "Application.hpp" +#include "controllers/nicknames/Nickname.hpp" #include "providers/twitch/api/Helix.hpp" #include "singletons/Settings.hpp" #include "util/StandardItemHelper.hpp" diff --git a/src/controllers/nicknames/NicknamesModel.hpp b/src/controllers/nicknames/NicknamesModel.hpp index 7cd034eacdb..aab622203f3 100644 --- a/src/controllers/nicknames/NicknamesModel.hpp +++ b/src/controllers/nicknames/NicknamesModel.hpp @@ -1,12 +1,13 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/nicknames/Nickname.hpp" #include namespace chatterino { +class Nickname; + class NicknamesModel : public SignalVectorModel { public: diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index 8fd5ea540f2..1205e44b565 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -5,9 +5,11 @@ #include "common/Outcome.hpp" #include "common/QLogging.hpp" #include "controllers/notifications/NotificationModel.hpp" +#include "messages/Message.hpp" #include "providers/twitch/api/Helix.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" +#include "singletons/Settings.hpp" #include "singletons/Toasts.hpp" #include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" diff --git a/src/controllers/notifications/NotificationController.hpp b/src/controllers/notifications/NotificationController.hpp index 6828c3be21d..f6cfce6b852 100644 --- a/src/controllers/notifications/NotificationController.hpp +++ b/src/controllers/notifications/NotificationController.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/ChatterinoSetting.hpp" #include "common/SignalVector.hpp" #include "common/Singleton.hpp" -#include "singletons/Settings.hpp" #include diff --git a/src/controllers/notifications/NotificationModel.hpp b/src/controllers/notifications/NotificationModel.hpp index 6d4856a8d7e..8ac0e39bd23 100644 --- a/src/controllers/notifications/NotificationModel.hpp +++ b/src/controllers/notifications/NotificationModel.hpp @@ -1,7 +1,6 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/notifications/NotificationController.hpp" #include diff --git a/src/controllers/pings/MutedChannelModel.hpp b/src/controllers/pings/MutedChannelModel.hpp index 5cc036ec1c4..1cc78c2c3b8 100644 --- a/src/controllers/pings/MutedChannelModel.hpp +++ b/src/controllers/pings/MutedChannelModel.hpp @@ -1,14 +1,11 @@ #pragma once #include "common/SignalVectorModel.hpp" -#include "controllers/notifications/NotificationController.hpp" #include namespace chatterino { -class MutedChannelController; - class MutedChannelModel : public SignalVectorModel { explicit MutedChannelModel(QObject *parent); diff --git a/src/messages/Emote.hpp b/src/messages/Emote.hpp index 2648c337220..d157abbfcf5 100644 --- a/src/messages/Emote.hpp +++ b/src/messages/Emote.hpp @@ -1,13 +1,13 @@ #pragma once -#include "common/Atomic.hpp" -#include "messages/Image.hpp" +#include "common/Aliases.hpp" #include "messages/ImageSet.hpp" #include #include #include +#include #include namespace chatterino { @@ -55,9 +55,6 @@ class EmoteMap : public std::unordered_map EmoteMap::const_iterator findEmote(const QString &emoteNameHint, const QString &emoteID) const; }; -using EmoteIdMap = std::unordered_map; -using WeakEmoteMap = std::unordered_map>; -using WeakEmoteIdMap = std::unordered_map>; static const std::shared_ptr EMPTY_EMOTE_MAP = std::make_shared< const EmoteMap>(); // NOLINT(cert-err58-cpp) -- assume this doesn't throw an exception diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index f7ef40ad92d..7c6d130862b 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -3,6 +3,8 @@ #include "Application.hpp" #include "common/Common.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" +#include "common/Outcome.hpp" #include "common/QLogging.hpp" #include "debug/AssertInGuiThread.hpp" #include "debug/Benchmark.hpp" @@ -347,6 +349,11 @@ ImagePtr Image::getEmpty() return empty; } +ImagePtr getEmptyImagePtr() +{ + return Image::getEmpty(); +} + Image::Image() : empty_(true) { diff --git a/src/messages/Image.hpp b/src/messages/Image.hpp index eae285c8ab4..6bd20ea3760 100644 --- a/src/messages/Image.hpp +++ b/src/messages/Image.hpp @@ -102,6 +102,9 @@ class Image : public std::enable_shared_from_this, boost::noncopyable friend class ImageExpirationPool; }; +// forward-declarable function that calls Image::getEmpty() under the hood. +ImagePtr getEmptyImagePtr(); + class ImageExpirationPool { private: diff --git a/src/messages/ImageSet.cpp b/src/messages/ImageSet.cpp index 1dccf10e90f..09294f7664e 100644 --- a/src/messages/ImageSet.cpp +++ b/src/messages/ImageSet.cpp @@ -1,5 +1,6 @@ #include "messages/ImageSet.hpp" +#include "messages/Image.hpp" #include "singletons/Settings.hpp" namespace chatterino { diff --git a/src/messages/ImageSet.hpp b/src/messages/ImageSet.hpp index 4e484eedb3e..49c94eed0cb 100644 --- a/src/messages/ImageSet.hpp +++ b/src/messages/ImageSet.hpp @@ -1,15 +1,22 @@ #pragma once -#include "messages/Image.hpp" +#include "common/Aliases.hpp" + +#include namespace chatterino { +class Image; +using ImagePtr = std::shared_ptr; +ImagePtr getEmptyImagePtr(); + class ImageSet { public: ImageSet(); - ImageSet(const ImagePtr &image1, const ImagePtr &image2 = Image::getEmpty(), - const ImagePtr &image3 = Image::getEmpty()); + ImageSet(const ImagePtr &image1, + const ImagePtr &image2 = getEmptyImagePtr(), + const ImagePtr &image3 = getEmptyImagePtr()); ImageSet(const Url &image1, const Url &image2 = {}, const Url &image3 = {}); void setImage1(const ImagePtr &image); diff --git a/src/messages/Message.cpp b/src/messages/Message.cpp index af5417f93a5..cb005a84355 100644 --- a/src/messages/Message.cpp +++ b/src/messages/Message.cpp @@ -2,10 +2,14 @@ #include "Application.hpp" #include "MessageElement.hpp" +#include "providers/colors/ColorProvider.hpp" #include "providers/twitch/PubSubActions.hpp" +#include "providers/twitch/TwitchBadge.hpp" +#include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "util/DebugCount.hpp" #include "util/IrcHelpers.hpp" +#include "widgets/helper/ScrollbarHighlight.hpp" using SBHighlight = chatterino::ScrollbarHighlight; diff --git a/src/messages/Message.hpp b/src/messages/Message.hpp index baba77e5b48..fcecef21190 100644 --- a/src/messages/Message.hpp +++ b/src/messages/Message.hpp @@ -1,11 +1,10 @@ #pragma once #include "common/FlagsEnum.hpp" -#include "providers/twitch/TwitchBadge.hpp" #include "util/QStringHash.hpp" -#include "widgets/helper/ScrollbarHighlight.hpp" #include +#include #include #include @@ -15,6 +14,8 @@ namespace chatterino { class MessageElement; class MessageThread; +class Badge; +class ScrollbarHighlight; enum class MessageFlag : int64_t { None = 0LL, diff --git a/src/messages/MessageBuilder.hpp b/src/messages/MessageBuilder.hpp index 12e21f76e41..96ab6658691 100644 --- a/src/messages/MessageBuilder.hpp +++ b/src/messages/MessageBuilder.hpp @@ -1,10 +1,12 @@ #pragma once -#include "messages/MessageElement.hpp" +#include "messages/MessageColor.hpp" #include +#include #include +#include #include namespace chatterino { @@ -16,6 +18,11 @@ struct AutomodInfoAction; struct Message; using MessagePtr = std::shared_ptr; +class MessageElement; +class TextElement; +struct Emote; +using EmotePtr = std::shared_ptr; + struct SystemMessageTag { }; struct TimeoutMessageTag { diff --git a/src/messages/MessageElement.cpp b/src/messages/MessageElement.cpp index 3dfc12077c3..ea76b591868 100644 --- a/src/messages/MessageElement.cpp +++ b/src/messages/MessageElement.cpp @@ -1,8 +1,10 @@ #include "messages/MessageElement.hpp" #include "Application.hpp" +#include "controllers/moderationactions/ModerationAction.hpp" #include "debug/Benchmark.hpp" #include "messages/Emote.hpp" +#include "messages/Image.hpp" #include "messages/layouts/MessageLayoutContainer.hpp" #include "messages/layouts/MessageLayoutElement.hpp" #include "providers/emoji/Emojis.hpp" diff --git a/src/messages/MessageParseArgs.hpp b/src/messages/MessageParseArgs.hpp deleted file mode 100644 index 471d1d64881..00000000000 --- a/src/messages/MessageParseArgs.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -namespace chatterino { - -} // namespace chatterino diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index 1a0fa9dbeb9..c428375d33d 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -5,7 +5,10 @@ #include "controllers/highlights/HighlightController.hpp" #include "controllers/ignores/IgnoreController.hpp" #include "controllers/ignores/IgnorePhrase.hpp" +#include "controllers/nicknames/Nickname.hpp" +#include "messages/Message.hpp" #include "messages/MessageElement.hpp" +#include "providers/twitch/TwitchBadge.hpp" #include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" diff --git a/src/messages/SharedMessageBuilder.hpp b/src/messages/SharedMessageBuilder.hpp index db055775162..5dce1ad9f95 100644 --- a/src/messages/SharedMessageBuilder.hpp +++ b/src/messages/SharedMessageBuilder.hpp @@ -1,8 +1,8 @@ +#pragma once + #include "common/Aliases.hpp" #include "common/Outcome.hpp" #include "messages/MessageBuilder.hpp" -#include "messages/MessageColor.hpp" -#include "providers/twitch/TwitchBadge.hpp" #include #include @@ -10,6 +10,9 @@ namespace chatterino { +class Badge; +class Channel; + class SharedMessageBuilder : public MessageBuilder { public: diff --git a/src/messages/layouts/MessageLayout.cpp b/src/messages/layouts/MessageLayout.cpp index 902e7ede055..d00d092e409 100644 --- a/src/messages/layouts/MessageLayout.cpp +++ b/src/messages/layouts/MessageLayout.cpp @@ -3,8 +3,11 @@ #include "Application.hpp" #include "debug/Benchmark.hpp" #include "messages/layouts/MessageLayoutContainer.hpp" +#include "messages/layouts/MessageLayoutElement.hpp" #include "messages/Message.hpp" #include "messages/MessageElement.hpp" +#include "messages/Selection.hpp" +#include "providers/colors/ColorProvider.hpp" #include "singletons/Emotes.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" diff --git a/src/messages/layouts/MessageLayoutContainer.hpp b/src/messages/layouts/MessageLayoutContainer.hpp index d9200d8e7b7..41bb0d941c8 100644 --- a/src/messages/layouts/MessageLayoutContainer.hpp +++ b/src/messages/layouts/MessageLayoutContainer.hpp @@ -2,8 +2,6 @@ #include "common/Common.hpp" #include "common/FlagsEnum.hpp" -#include "messages/layouts/MessageLayoutElement.hpp" -#include "messages/Selection.hpp" #include #include @@ -18,6 +16,8 @@ namespace chatterino { enum class MessageFlag : int64_t; enum class FirstWord { Neutral, RTL, LTR }; using MessageFlags = FlagsEnum; +class MessageLayoutElement; +struct Selection; struct Margin { int top; diff --git a/src/messages/layouts/MessageLayoutElement.hpp b/src/messages/layouts/MessageLayoutElement.hpp index 13ea77c0910..86e662e54ad 100644 --- a/src/messages/layouts/MessageLayoutElement.hpp +++ b/src/messages/layouts/MessageLayoutElement.hpp @@ -2,8 +2,6 @@ #include "common/FlagsEnum.hpp" #include "messages/Link.hpp" -#include "messages/MessageColor.hpp" -#include "messages/MessageElement.hpp" #include #include @@ -22,6 +20,7 @@ class MessageElement; class Image; using ImagePtr = std::shared_ptr; enum class FontStyle : uint8_t; +enum class MessageElementFlag : int64_t; class MessageLayoutElement : boost::noncopyable { diff --git a/src/messages/search/AuthorPredicate.cpp b/src/messages/search/AuthorPredicate.cpp index c84b5d2e33e..adc3655778e 100644 --- a/src/messages/search/AuthorPredicate.cpp +++ b/src/messages/search/AuthorPredicate.cpp @@ -1,5 +1,6 @@ #include "messages/search/AuthorPredicate.hpp" +#include "messages/Message.hpp" #include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/AuthorPredicate.hpp b/src/messages/search/AuthorPredicate.hpp index 2fb25c98582..19a2ac8fbef 100644 --- a/src/messages/search/AuthorPredicate.hpp +++ b/src/messages/search/AuthorPredicate.hpp @@ -2,6 +2,9 @@ #include "messages/search/MessagePredicate.hpp" +#include +#include + namespace chatterino { /** diff --git a/src/messages/search/BadgePredicate.cpp b/src/messages/search/BadgePredicate.cpp index 555a2b36cf7..dc3fbafa8cd 100644 --- a/src/messages/search/BadgePredicate.cpp +++ b/src/messages/search/BadgePredicate.cpp @@ -1,5 +1,7 @@ #include "messages/search/BadgePredicate.hpp" +#include "messages/Message.hpp" +#include "providers/twitch/TwitchBadge.hpp" #include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/BadgePredicate.hpp b/src/messages/search/BadgePredicate.hpp index 510f6e057f8..f5d4901afdd 100644 --- a/src/messages/search/BadgePredicate.hpp +++ b/src/messages/search/BadgePredicate.hpp @@ -2,6 +2,9 @@ #include "messages/search/MessagePredicate.hpp" +#include +#include + namespace chatterino { /** diff --git a/src/messages/search/ChannelPredicate.cpp b/src/messages/search/ChannelPredicate.cpp index 2f7f3f3fdb1..665f96a973e 100644 --- a/src/messages/search/ChannelPredicate.cpp +++ b/src/messages/search/ChannelPredicate.cpp @@ -1,5 +1,6 @@ #include "messages/search/ChannelPredicate.hpp" +#include "messages/Message.hpp" #include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/ChannelPredicate.hpp b/src/messages/search/ChannelPredicate.hpp index a9f189089b5..663a6c15514 100644 --- a/src/messages/search/ChannelPredicate.hpp +++ b/src/messages/search/ChannelPredicate.hpp @@ -2,6 +2,9 @@ #include "messages/search/MessagePredicate.hpp" +#include +#include + namespace chatterino { /** diff --git a/src/messages/search/LinkPredicate.cpp b/src/messages/search/LinkPredicate.cpp index a592e401503..be400feb7f6 100644 --- a/src/messages/search/LinkPredicate.cpp +++ b/src/messages/search/LinkPredicate.cpp @@ -1,6 +1,7 @@ #include "messages/search/LinkPredicate.hpp" #include "common/LinkParser.hpp" +#include "messages/Message.hpp" #include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/LinkPredicate.hpp b/src/messages/search/LinkPredicate.hpp index c6419402fe3..4bda67c8b15 100644 --- a/src/messages/search/LinkPredicate.hpp +++ b/src/messages/search/LinkPredicate.hpp @@ -2,6 +2,8 @@ #include "messages/search/MessagePredicate.hpp" +#include + namespace chatterino { /** diff --git a/src/messages/search/MessageFlagsPredicate.hpp b/src/messages/search/MessageFlagsPredicate.hpp index a74d72ae2a8..d1e37873f64 100644 --- a/src/messages/search/MessageFlagsPredicate.hpp +++ b/src/messages/search/MessageFlagsPredicate.hpp @@ -1,6 +1,7 @@ #pragma once #include "common/FlagsEnum.hpp" +#include "messages/Message.hpp" #include "messages/search/MessagePredicate.hpp" namespace chatterino { diff --git a/src/messages/search/MessagePredicate.hpp b/src/messages/search/MessagePredicate.hpp index 79806bd62d3..7a6a9a07c9a 100644 --- a/src/messages/search/MessagePredicate.hpp +++ b/src/messages/search/MessagePredicate.hpp @@ -1,11 +1,11 @@ #pragma once -#include "messages/Message.hpp" - #include namespace chatterino { +struct Message; + /** * @brief Abstract base class for message predicates. * diff --git a/src/messages/search/RegexPredicate.cpp b/src/messages/search/RegexPredicate.cpp index 04a22f62477..02eeec6c849 100644 --- a/src/messages/search/RegexPredicate.cpp +++ b/src/messages/search/RegexPredicate.cpp @@ -1,5 +1,7 @@ #include "RegexPredicate.hpp" +#include "messages/Message.hpp" + namespace chatterino { RegexPredicate::RegexPredicate(const QString ®ex, bool negate) diff --git a/src/messages/search/RegexPredicate.hpp b/src/messages/search/RegexPredicate.hpp index 594b985f00d..63e68cabd68 100644 --- a/src/messages/search/RegexPredicate.hpp +++ b/src/messages/search/RegexPredicate.hpp @@ -3,6 +3,8 @@ #include "messages/search/MessagePredicate.hpp" #include "QRegularExpression" +#include + namespace chatterino { /** diff --git a/src/messages/search/SubstringPredicate.cpp b/src/messages/search/SubstringPredicate.cpp index 736cb2cc100..36e4b8e87d0 100644 --- a/src/messages/search/SubstringPredicate.cpp +++ b/src/messages/search/SubstringPredicate.cpp @@ -1,5 +1,7 @@ #include "messages/search/SubstringPredicate.hpp" +#include "messages/Message.hpp" + namespace chatterino { SubstringPredicate::SubstringPredicate(const QString &search) diff --git a/src/messages/search/SubstringPredicate.hpp b/src/messages/search/SubstringPredicate.hpp index e6b99f11be8..1d5f2b85848 100644 --- a/src/messages/search/SubstringPredicate.hpp +++ b/src/messages/search/SubstringPredicate.hpp @@ -2,6 +2,8 @@ #include "messages/search/MessagePredicate.hpp" +#include + namespace chatterino { /** diff --git a/src/messages/search/SubtierPredicate.cpp b/src/messages/search/SubtierPredicate.cpp index 81db09f28d0..2dc79fc3518 100644 --- a/src/messages/search/SubtierPredicate.cpp +++ b/src/messages/search/SubtierPredicate.cpp @@ -1,5 +1,7 @@ #include "messages/search/SubtierPredicate.hpp" +#include "messages/Message.hpp" +#include "providers/twitch/TwitchBadge.hpp" #include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/SubtierPredicate.hpp b/src/messages/search/SubtierPredicate.hpp index bb5caba2a5c..cf24defc8b5 100644 --- a/src/messages/search/SubtierPredicate.hpp +++ b/src/messages/search/SubtierPredicate.hpp @@ -2,6 +2,9 @@ #include "messages/search/MessagePredicate.hpp" +#include +#include + namespace chatterino { /** diff --git a/src/providers/IvrApi.cpp b/src/providers/IvrApi.cpp index 6b19dc92830..26b4088e5eb 100644 --- a/src/providers/IvrApi.cpp +++ b/src/providers/IvrApi.cpp @@ -1,5 +1,6 @@ #include "IvrApi.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "common/QLogging.hpp" diff --git a/src/providers/IvrApi.hpp b/src/providers/IvrApi.hpp index 74d21e1164d..9aca1454381 100644 --- a/src/providers/IvrApi.hpp +++ b/src/providers/IvrApi.hpp @@ -1,10 +1,11 @@ #pragma once #include "common/NetworkRequest.hpp" -#include "messages/Link.hpp" #include "providers/twitch/TwitchEmotes.hpp" #include +#include +#include #include diff --git a/src/providers/LinkResolver.cpp b/src/providers/LinkResolver.cpp index b0d8f5a93a3..320fe569c4d 100644 --- a/src/providers/LinkResolver.cpp +++ b/src/providers/LinkResolver.cpp @@ -1,8 +1,9 @@ #include "providers/LinkResolver.hpp" -#include "common/Common.hpp" #include "common/Env.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" +#include "common/Outcome.hpp" #include "messages/Image.hpp" #include "messages/Link.hpp" #include "singletons/Settings.hpp" diff --git a/src/providers/LinkResolver.hpp b/src/providers/LinkResolver.hpp index 9d52ce38392..df4e7efd490 100644 --- a/src/providers/LinkResolver.hpp +++ b/src/providers/LinkResolver.hpp @@ -1,14 +1,17 @@ #pragma once -#include "messages/Image.hpp" -#include "messages/Link.hpp" - +#include #include #include +#include namespace chatterino { +class Image; +struct Link; +using ImagePtr = std::shared_ptr; + class LinkResolver { public: diff --git a/src/providers/RecentMessagesApi.cpp b/src/providers/RecentMessagesApi.cpp index 48c9d7a42b6..1544b74d2fd 100644 --- a/src/providers/RecentMessagesApi.cpp +++ b/src/providers/RecentMessagesApi.cpp @@ -1,10 +1,12 @@ -#include "RecentMessagesApi.hpp" +#include "providers/RecentMessagesApi.hpp" #include "common/Channel.hpp" #include "common/Common.hpp" #include "common/Env.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" +#include "messages/Message.hpp" #include "providers/twitch/IrcMessageHandler.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" @@ -16,6 +18,7 @@ #include #include #include +#include namespace chatterino { diff --git a/src/providers/bttv/BttvEmotes.cpp b/src/providers/bttv/BttvEmotes.cpp index fa25f733e92..a65d99f33d9 100644 --- a/src/providers/bttv/BttvEmotes.cpp +++ b/src/providers/bttv/BttvEmotes.cpp @@ -1,7 +1,7 @@ #include "providers/bttv/BttvEmotes.hpp" -#include "common/Common.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" #include "messages/Emote.hpp" #include "messages/Image.hpp" diff --git a/src/providers/bttv/BttvEmotes.hpp b/src/providers/bttv/BttvEmotes.hpp index 52fc9b6aa5d..69340ad9964 100644 --- a/src/providers/bttv/BttvEmotes.hpp +++ b/src/providers/bttv/BttvEmotes.hpp @@ -1,9 +1,9 @@ #pragma once -#include "boost/optional.hpp" #include "common/Aliases.hpp" #include "common/Atomic.hpp" -#include "providers/twitch/TwitchChannel.hpp" + +#include #include @@ -12,6 +12,7 @@ namespace chatterino { struct Emote; using EmotePtr = std::shared_ptr; class EmoteMap; +class Channel; class BttvEmotes final { diff --git a/src/providers/bttv/LoadBttvChannelEmote.cpp b/src/providers/bttv/LoadBttvChannelEmote.cpp deleted file mode 100644 index 5ceee36c6d8..00000000000 --- a/src/providers/bttv/LoadBttvChannelEmote.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "LoadBttvChannelEmote.hpp" - -#include "common/Common.hpp" -#include "common/NetworkRequest.hpp" -#include "common/UniqueAccess.hpp" -#include "messages/Emote.hpp" - -#include -#include -#include -#include - -namespace chatterino { - -} // namespace chatterino diff --git a/src/providers/bttv/LoadBttvChannelEmote.hpp b/src/providers/bttv/LoadBttvChannelEmote.hpp deleted file mode 100644 index d0fa5cc32b4..00000000000 --- a/src/providers/bttv/LoadBttvChannelEmote.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -class QString; - -namespace chatterino { - -} // namespace chatterino diff --git a/src/providers/chatterino/ChatterinoBadges.cpp b/src/providers/chatterino/ChatterinoBadges.cpp index 91f2d30023f..f0ccec3af0c 100644 --- a/src/providers/chatterino/ChatterinoBadges.cpp +++ b/src/providers/chatterino/ChatterinoBadges.cpp @@ -1,6 +1,7 @@ #include "ChatterinoBadges.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "messages/Emote.hpp" diff --git a/src/providers/chatterino/ChatterinoBadges.hpp b/src/providers/chatterino/ChatterinoBadges.hpp index aad0487673d..179c55a4501 100644 --- a/src/providers/chatterino/ChatterinoBadges.hpp +++ b/src/providers/chatterino/ChatterinoBadges.hpp @@ -1,10 +1,10 @@ #pragma once #include "common/Aliases.hpp" +#include "common/Singleton.hpp" #include "util/QStringHash.hpp" #include -#include #include #include diff --git a/src/providers/colors/ColorProvider.cpp b/src/providers/colors/ColorProvider.cpp index 342ce45ab59..94fb444514f 100644 --- a/src/providers/colors/ColorProvider.cpp +++ b/src/providers/colors/ColorProvider.cpp @@ -1,5 +1,7 @@ #include "providers/colors/ColorProvider.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" +#include "singletons/Settings.hpp" #include "singletons/Theme.hpp" namespace chatterino { diff --git a/src/providers/emoji/Emojis.cpp b/src/providers/emoji/Emojis.cpp index 3833930ce8c..1727f0bf302 100644 --- a/src/providers/emoji/Emojis.cpp +++ b/src/providers/emoji/Emojis.cpp @@ -1,9 +1,10 @@ #include "providers/emoji/Emojis.hpp" -#include "Application.hpp" #include "common/QLogging.hpp" #include "messages/Emote.hpp" +#include "messages/Image.hpp" #include "singletons/Settings.hpp" +#include "util/RapidjsonHelpers.hpp" #include #include @@ -11,6 +12,7 @@ #include #include +#include #include namespace chatterino { diff --git a/src/providers/ffz/FfzBadges.cpp b/src/providers/ffz/FfzBadges.cpp index 8818ccab9e8..7407c86038c 100644 --- a/src/providers/ffz/FfzBadges.cpp +++ b/src/providers/ffz/FfzBadges.cpp @@ -1,6 +1,7 @@ #include "FfzBadges.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "messages/Emote.hpp" diff --git a/src/providers/ffz/FfzBadges.hpp b/src/providers/ffz/FfzBadges.hpp index 1c6a6b83e1a..c0cc80c681d 100644 --- a/src/providers/ffz/FfzBadges.hpp +++ b/src/providers/ffz/FfzBadges.hpp @@ -1,14 +1,12 @@ #pragma once #include "common/Aliases.hpp" -#include "common/UniqueAccess.hpp" +#include "common/Singleton.hpp" #include "util/QStringHash.hpp" #include -#include #include -#include #include #include #include diff --git a/src/providers/ffz/FfzEmotes.cpp b/src/providers/ffz/FfzEmotes.cpp index a7061015c60..0cf533e5b6c 100644 --- a/src/providers/ffz/FfzEmotes.cpp +++ b/src/providers/ffz/FfzEmotes.cpp @@ -1,6 +1,7 @@ #include "providers/ffz/FfzEmotes.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "common/QLogging.hpp" #include "messages/Emote.hpp" @@ -9,8 +10,6 @@ #include "providers/twitch/TwitchChannel.hpp" #include "singletons/Settings.hpp" -#include - namespace chatterino { namespace { diff --git a/src/providers/ffz/FfzEmotes.hpp b/src/providers/ffz/FfzEmotes.hpp index 63da07964f6..be0726f045d 100644 --- a/src/providers/ffz/FfzEmotes.hpp +++ b/src/providers/ffz/FfzEmotes.hpp @@ -1,9 +1,9 @@ #pragma once -#include "boost/optional.hpp" #include "common/Aliases.hpp" #include "common/Atomic.hpp" -#include "providers/twitch/TwitchChannel.hpp" + +#include #include @@ -12,12 +12,10 @@ namespace chatterino { struct Emote; using EmotePtr = std::shared_ptr; class EmoteMap; +class Channel; class FfzEmotes final { - static constexpr const char *globalEmoteApiUrl = - "https://api.frankerfacez.com/v1/set/global"; - public: FfzEmotes(); diff --git a/src/providers/irc/AbstractIrcServer.cpp b/src/providers/irc/AbstractIrcServer.cpp index 24c663fbd02..77f0631ff7e 100644 --- a/src/providers/irc/AbstractIrcServer.cpp +++ b/src/providers/irc/AbstractIrcServer.cpp @@ -1,7 +1,6 @@ #include "AbstractIrcServer.hpp" #include "common/Channel.hpp" -#include "common/Common.hpp" #include "common/QLogging.hpp" #include "messages/LimitedQueueSnapshot.hpp" #include "messages/Message.hpp" diff --git a/src/providers/irc/AbstractIrcServer.hpp b/src/providers/irc/AbstractIrcServer.hpp index 9de204895f1..fd6a4612ee6 100644 --- a/src/providers/irc/AbstractIrcServer.hpp +++ b/src/providers/irc/AbstractIrcServer.hpp @@ -15,6 +15,7 @@ namespace chatterino { class Channel; using ChannelPtr = std::shared_ptr; +class RatelimitBucket; class AbstractIrcServer : public QObject { diff --git a/src/providers/irc/Irc2.cpp b/src/providers/irc/Irc2.cpp index 2d5eebea3d1..fd1b66851c0 100644 --- a/src/providers/irc/Irc2.cpp +++ b/src/providers/irc/Irc2.cpp @@ -2,6 +2,8 @@ #include "common/Credentials.hpp" #include "common/SignalVectorModel.hpp" +#include "providers/irc/IrcChannel2.hpp" +#include "providers/irc/IrcServer.hpp" #include "singletons/Paths.hpp" #include "util/CombinePath.hpp" #include "util/RapidjsonHelpers.hpp" diff --git a/src/providers/irc/Irc2.hpp b/src/providers/irc/Irc2.hpp index 0b20783c3d2..793e8b9a931 100644 --- a/src/providers/irc/Irc2.hpp +++ b/src/providers/irc/Irc2.hpp @@ -1,8 +1,6 @@ #pragma once #include "common/SignalVector.hpp" -#include "providers/irc/IrcChannel2.hpp" -#include "providers/irc/IrcServer.hpp" #include @@ -10,6 +8,10 @@ class QAbstractTableModel; namespace chatterino { +class Channel; +using ChannelPtr = std::shared_ptr; +class IrcServer; + enum class IrcAuthType { Anonymous, Custom, Pass, Sasl }; struct IrcServerData { diff --git a/src/providers/irc/IrcChannel2.cpp b/src/providers/irc/IrcChannel2.cpp index 84f9ce22c39..164cc75f737 100644 --- a/src/providers/irc/IrcChannel2.cpp +++ b/src/providers/irc/IrcChannel2.cpp @@ -3,6 +3,7 @@ #include "debug/AssertInGuiThread.hpp" #include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" +#include "messages/MessageElement.hpp" #include "providers/irc/IrcCommands.hpp" #include "providers/irc/IrcMessageBuilder.hpp" #include "providers/irc/IrcServer.hpp" diff --git a/src/providers/irc/IrcMessageBuilder.cpp b/src/providers/irc/IrcMessageBuilder.cpp index 7fa9652cbdd..0474bdb76bf 100644 --- a/src/providers/irc/IrcMessageBuilder.cpp +++ b/src/providers/irc/IrcMessageBuilder.cpp @@ -1,15 +1,11 @@ #include "providers/irc/IrcMessageBuilder.hpp" -#include "Application.hpp" -#include "common/IrcColors.hpp" -#include "controllers/accounts/AccountController.hpp" #include "controllers/ignores/IgnoreController.hpp" #include "controllers/ignores/IgnorePhrase.hpp" #include "messages/Message.hpp" #include "messages/MessageColor.hpp" -#include "providers/chatterino/ChatterinoBadges.hpp" +#include "messages/MessageElement.hpp" #include "singletons/Emotes.hpp" -#include "singletons/Resources.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "singletons/WindowManager.hpp" diff --git a/src/providers/irc/IrcMessageBuilder.hpp b/src/providers/irc/IrcMessageBuilder.hpp index c165dde707a..820a893809f 100644 --- a/src/providers/irc/IrcMessageBuilder.hpp +++ b/src/providers/irc/IrcMessageBuilder.hpp @@ -3,7 +3,6 @@ #include "common/Aliases.hpp" #include "common/Outcome.hpp" #include "messages/SharedMessageBuilder.hpp" -#include "providers/twitch/TwitchBadge.hpp" #include #include @@ -15,7 +14,6 @@ struct Emote; using EmotePtr = std::shared_ptr; class Channel; -class TwitchChannel; class IrcMessageBuilder : public SharedMessageBuilder { diff --git a/src/providers/irc/IrcServer.cpp b/src/providers/irc/IrcServer.cpp index 363bf045e03..b79f635bcbe 100644 --- a/src/providers/irc/IrcServer.cpp +++ b/src/providers/irc/IrcServer.cpp @@ -1,5 +1,6 @@ #include "IrcServer.hpp" +#include "Application.hpp" #include "common/QLogging.hpp" #include "messages/Message.hpp" #include "messages/MessageColor.hpp" diff --git a/src/providers/irc/IrcServer.hpp b/src/providers/irc/IrcServer.hpp index 93a4349e6a0..a360493905d 100644 --- a/src/providers/irc/IrcServer.hpp +++ b/src/providers/irc/IrcServer.hpp @@ -1,7 +1,6 @@ #pragma once #include "providers/irc/AbstractIrcServer.hpp" -#include "providers/irc/IrcAccount.hpp" namespace chatterino { diff --git a/src/providers/seventv/SeventvBadges.cpp b/src/providers/seventv/SeventvBadges.cpp index 2fb7f4ef5c5..9bdc51bf6f4 100644 --- a/src/providers/seventv/SeventvBadges.cpp +++ b/src/providers/seventv/SeventvBadges.cpp @@ -1,6 +1,7 @@ #include "providers/seventv/SeventvBadges.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "messages/Emote.hpp" diff --git a/src/providers/seventv/SeventvBadges.hpp b/src/providers/seventv/SeventvBadges.hpp index 2d6d021a2b2..182d37b1055 100644 --- a/src/providers/seventv/SeventvBadges.hpp +++ b/src/providers/seventv/SeventvBadges.hpp @@ -1,10 +1,10 @@ #pragma once #include "common/Aliases.hpp" +#include "common/Singleton.hpp" #include "util/QStringHash.hpp" #include -#include #include #include diff --git a/src/providers/seventv/SeventvEmotes.cpp b/src/providers/seventv/SeventvEmotes.cpp index 740b0c890f3..8f8ee18d682 100644 --- a/src/providers/seventv/SeventvEmotes.cpp +++ b/src/providers/seventv/SeventvEmotes.cpp @@ -1,12 +1,13 @@ #include "providers/seventv/SeventvEmotes.hpp" -#include "common/Common.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" #include "messages/Emote.hpp" #include "messages/Image.hpp" #include "messages/ImageSet.hpp" #include "messages/MessageBuilder.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "singletons/Settings.hpp" @@ -14,6 +15,7 @@ #include #include +#include #include /** diff --git a/src/providers/seventv/SeventvEmotes.hpp b/src/providers/seventv/SeventvEmotes.hpp index ebcb664f70d..023e99555a1 100644 --- a/src/providers/seventv/SeventvEmotes.hpp +++ b/src/providers/seventv/SeventvEmotes.hpp @@ -3,13 +3,17 @@ #include "boost/optional.hpp" #include "common/Aliases.hpp" #include "common/Atomic.hpp" -#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" -#include "providers/twitch/TwitchChannel.hpp" +#include "common/FlagsEnum.hpp" #include namespace chatterino { +class Channel; +struct SeventvEventAPIEmoteAddDispatch; +struct SeventvEventAPIEmoteUpdateDispatch; +struct SeventvEventAPIEmoteRemoveDispatch; + // https://github.com/SevenTV/API/blob/a84e884b5590dbb5d91a5c6b3548afabb228f385/data/model/emote-set.model.go#L29-L36 enum class SeventvActiveEmoteFlag : int64_t { None = 0LL, diff --git a/src/providers/seventv/SeventvEventAPI.cpp b/src/providers/seventv/SeventvEventAPI.cpp index 88a843ba3fb..c4be244dc55 100644 --- a/src/providers/seventv/SeventvEventAPI.cpp +++ b/src/providers/seventv/SeventvEventAPI.cpp @@ -1,6 +1,7 @@ #include "providers/seventv/SeventvEventAPI.hpp" #include "providers/seventv/eventapi/SeventvEventAPIClient.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" #include "providers/seventv/eventapi/SeventvEventAPIMessage.hpp" #include diff --git a/src/providers/seventv/SeventvEventAPI.hpp b/src/providers/seventv/SeventvEventAPI.hpp index 5f6aad3aae6..946e147cba0 100644 --- a/src/providers/seventv/SeventvEventAPI.hpp +++ b/src/providers/seventv/SeventvEventAPI.hpp @@ -2,14 +2,19 @@ #include "providers/liveupdates/BasicPubSubClient.hpp" #include "providers/liveupdates/BasicPubSubManager.hpp" -#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" -#include "providers/seventv/eventapi/SeventvEventAPISubscription.hpp" #include "util/QStringHash.hpp" #include namespace chatterino { +struct SeventvEventAPISubscription; +struct SeventvEventAPIDispatch; +struct SeventvEventAPIEmoteAddDispatch; +struct SeventvEventAPIEmoteUpdateDispatch; +struct SeventvEventAPIEmoteRemoveDispatch; +struct SeventvEventAPIUserConnectionUpdateDispatch; + class SeventvEventAPI : public BasicPubSubManager { template diff --git a/src/providers/seventv/eventapi/SeventvEventAPIClient.cpp b/src/providers/seventv/eventapi/SeventvEventAPIClient.cpp index 21a3e134785..e1fcf2d026a 100644 --- a/src/providers/seventv/eventapi/SeventvEventAPIClient.cpp +++ b/src/providers/seventv/eventapi/SeventvEventAPIClient.cpp @@ -1,5 +1,6 @@ #include "providers/seventv/eventapi/SeventvEventAPIClient.hpp" +#include "providers/seventv/eventapi/SeventvEventAPISubscription.hpp" #include "providers/twitch/PubSubHelpers.hpp" #include diff --git a/src/providers/seventv/eventapi/SeventvEventAPIClient.hpp b/src/providers/seventv/eventapi/SeventvEventAPIClient.hpp index ffd4c766f25..f33256d427d 100644 --- a/src/providers/seventv/eventapi/SeventvEventAPIClient.hpp +++ b/src/providers/seventv/eventapi/SeventvEventAPIClient.hpp @@ -1,6 +1,8 @@ #pragma once #include "providers/liveupdates/BasicPubSubClient.hpp" +// this needs to be included for the specialization +// of std::hash for SeventvEventAPISubscription #include "providers/seventv/eventapi/SeventvEventAPISubscription.hpp" namespace chatterino { diff --git a/src/providers/seventv/eventapi/SeventvEventAPIMessage.hpp b/src/providers/seventv/eventapi/SeventvEventAPIMessage.hpp index b8b04f5405d..f18d07f31f2 100644 --- a/src/providers/seventv/eventapi/SeventvEventAPIMessage.hpp +++ b/src/providers/seventv/eventapi/SeventvEventAPIMessage.hpp @@ -1,6 +1,6 @@ #pragma once -#include "providers/seventv/SeventvEventAPI.hpp" +#include "providers/seventv/eventapi/SeventvEventAPISubscription.hpp" #include #include diff --git a/src/providers/twitch/ChannelPointReward.cpp b/src/providers/twitch/ChannelPointReward.cpp index 28e169ecc70..04d4293167f 100644 --- a/src/providers/twitch/ChannelPointReward.cpp +++ b/src/providers/twitch/ChannelPointReward.cpp @@ -1,6 +1,7 @@ #include "ChannelPointReward.hpp" #include "common/QLogging.hpp" +#include "messages/Image.hpp" namespace chatterino { diff --git a/src/providers/twitch/ChannelPointReward.hpp b/src/providers/twitch/ChannelPointReward.hpp index fad2ed375e7..f9f9b6316e6 100644 --- a/src/providers/twitch/ChannelPointReward.hpp +++ b/src/providers/twitch/ChannelPointReward.hpp @@ -1,7 +1,6 @@ #pragma once #include "common/Aliases.hpp" -#include "messages/Image.hpp" #include "messages/ImageSet.hpp" #include diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index d412a249b42..15d6a48984c 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -4,12 +4,19 @@ #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" #include "messages/LimitedQueue.hpp" +#include "messages/Link.hpp" #include "messages/Message.hpp" +#include "messages/MessageBuilder.hpp" +#include "messages/MessageColor.hpp" +#include "messages/MessageElement.hpp" +#include "messages/MessageThread.hpp" +#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchAccountManager.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchHelpers.hpp" #include "providers/twitch/TwitchIrcServer.hpp" +#include "providers/twitch/TwitchMessageBuilder.hpp" #include "singletons/Resources.hpp" #include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" diff --git a/src/providers/twitch/IrcMessageHandler.hpp b/src/providers/twitch/IrcMessageHandler.hpp index 77b5d370083..114831009b9 100644 --- a/src/providers/twitch/IrcMessageHandler.hpp +++ b/src/providers/twitch/IrcMessageHandler.hpp @@ -1,9 +1,6 @@ #pragma once -#include "common/Channel.hpp" -#include "messages/Message.hpp" -#include "providers/twitch/TwitchChannel.hpp" -#include "providers/twitch/TwitchMessageBuilder.hpp" +#include "messages/LimitedQueueSnapshot.hpp" #include @@ -13,6 +10,11 @@ namespace chatterino { class TwitchIrcServer; class Channel; +using ChannelPtr = std::shared_ptr; +struct Message; +using MessagePtr = std::shared_ptr; +class TwitchChannel; +class TwitchMessageBuilder; class IrcMessageHandler { diff --git a/src/providers/twitch/PubSubClient.hpp b/src/providers/twitch/PubSubClient.hpp index 3899e1337a1..ee0e40c1a15 100644 --- a/src/providers/twitch/PubSubClient.hpp +++ b/src/providers/twitch/PubSubClient.hpp @@ -1,7 +1,6 @@ #pragma once #include "providers/twitch/PubSubClientOptions.hpp" -#include "providers/twitch/PubSubMessages.hpp" #include "providers/twitch/PubSubWebsocket.hpp" #include @@ -12,6 +11,9 @@ namespace chatterino { +struct PubSubMessage; +struct PubSubListenMessage; + struct TopicData { QString topic; bool authed{false}; diff --git a/src/providers/twitch/PubSubHelpers.hpp b/src/providers/twitch/PubSubHelpers.hpp index 8ad545403dd..faf01f4c768 100644 --- a/src/providers/twitch/PubSubHelpers.hpp +++ b/src/providers/twitch/PubSubHelpers.hpp @@ -1,11 +1,9 @@ #pragma once #include "common/QLogging.hpp" -#include "util/RapidjsonHelpers.hpp" #include #include -#include #include diff --git a/src/providers/twitch/PubSubManager.cpp b/src/providers/twitch/PubSubManager.cpp index 52a25938e4b..6bfc67d108f 100644 --- a/src/providers/twitch/PubSubManager.cpp +++ b/src/providers/twitch/PubSubManager.cpp @@ -2,6 +2,7 @@ #include "common/QLogging.hpp" #include "providers/twitch/PubSubActions.hpp" +#include "providers/twitch/PubSubClient.hpp" #include "providers/twitch/PubSubHelpers.hpp" #include "providers/twitch/PubSubMessages.hpp" #include "providers/twitch/TwitchAccount.hpp" @@ -9,6 +10,8 @@ #include "util/Helpers.hpp" #include "util/RapidjsonHelpers.hpp" +#include + #include #include #include diff --git a/src/providers/twitch/PubSubManager.hpp b/src/providers/twitch/PubSubManager.hpp index 4c608d206ea..ea8138d2d9c 100644 --- a/src/providers/twitch/PubSubManager.hpp +++ b/src/providers/twitch/PubSubManager.hpp @@ -1,14 +1,11 @@ #pragma once -#include "providers/twitch/ChatterinoWebSocketppLogger.hpp" -#include "providers/twitch/PubSubActions.hpp" -#include "providers/twitch/PubSubClient.hpp" #include "providers/twitch/PubSubClientOptions.hpp" -#include "providers/twitch/PubSubMessages.hpp" #include "providers/twitch/PubSubWebsocket.hpp" #include "util/ExponentialBackoff.hpp" #include "util/QStringHash.hpp" +#include #include #include #include @@ -25,6 +22,23 @@ namespace chatterino { class TwitchAccount; +class PubSubClient; + +struct ClearChatAction; +struct DeleteAction; +struct ModeChangedAction; +struct ModerationStateAction; +struct BanAction; +struct UnbanAction; +struct PubSubAutoModQueueMessage; +struct AutomodAction; +struct AutomodUserAction; +struct AutomodInfoAction; +struct PubSubWhisperMessage; + +struct PubSubListenMessage; +struct PubSubMessage; +struct PubSubMessageMessage; class PubSub { diff --git a/src/providers/twitch/TwitchAccount.hpp b/src/providers/twitch/TwitchAccount.hpp index 5213f004750..bfb8b98ca66 100644 --- a/src/providers/twitch/TwitchAccount.hpp +++ b/src/providers/twitch/TwitchAccount.hpp @@ -2,11 +2,9 @@ #include "common/Aliases.hpp" #include "common/Atomic.hpp" -#include "common/Channel.hpp" #include "common/UniqueAccess.hpp" #include "controllers/accounts/Account.hpp" #include "messages/Emote.hpp" -#include "providers/twitch/TwitchUser.hpp" #include "util/QStringHash.hpp" #include @@ -20,6 +18,10 @@ namespace chatterino { +struct TwitchUser; +class Channel; +using ChannelPtr = std::shared_ptr; + class TwitchAccount : public Account { public: diff --git a/src/providers/twitch/TwitchAccountManager.cpp b/src/providers/twitch/TwitchAccountManager.cpp index 64125f4942f..6b02d3bb245 100644 --- a/src/providers/twitch/TwitchAccountManager.cpp +++ b/src/providers/twitch/TwitchAccountManager.cpp @@ -5,6 +5,8 @@ #include "providers/twitch/api/Helix.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchCommon.hpp" +#include "providers/twitch/TwitchUser.hpp" +#include "util/SharedPtrElementLess.hpp" namespace chatterino { diff --git a/src/providers/twitch/TwitchAccountManager.hpp b/src/providers/twitch/TwitchAccountManager.hpp index 7c8acd32ed8..4eb90f95a53 100644 --- a/src/providers/twitch/TwitchAccountManager.hpp +++ b/src/providers/twitch/TwitchAccountManager.hpp @@ -2,7 +2,7 @@ #include "common/ChatterinoSetting.hpp" #include "common/SignalVector.hpp" -#include "util/SharedPtrElementLess.hpp" +#include "util/RapidJsonSerializeQString.hpp" #include diff --git a/src/providers/twitch/TwitchBadges.cpp b/src/providers/twitch/TwitchBadges.cpp index 788deae9502..2eb0b1910a9 100644 --- a/src/providers/twitch/TwitchBadges.cpp +++ b/src/providers/twitch/TwitchBadges.cpp @@ -1,9 +1,12 @@ #include "TwitchBadges.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "common/QLogging.hpp" #include "messages/Emote.hpp" +#include "messages/Image.hpp" +#include "util/DisplayBadge.hpp" #include #include diff --git a/src/providers/twitch/TwitchBadges.hpp b/src/providers/twitch/TwitchBadges.hpp index 6283765cb80..5d371d5a966 100644 --- a/src/providers/twitch/TwitchBadges.hpp +++ b/src/providers/twitch/TwitchBadges.hpp @@ -1,12 +1,11 @@ #pragma once #include "common/UniqueAccess.hpp" -#include "messages/Image.hpp" -#include "util/DisplayBadge.hpp" #include "util/QStringHash.hpp" #include #include +#include #include #include @@ -22,6 +21,8 @@ using EmotePtr = std::shared_ptr; class Settings; class Paths; +class Image; +class DisplayBadge; class TwitchBadges { diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 0c995bd9f35..2676aacd59e 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -1,19 +1,26 @@ #include "providers/twitch/TwitchChannel.hpp" +#include "Application.hpp" #include "common/Common.hpp" #include "common/Env.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/notifications/NotificationController.hpp" #include "messages/Emote.hpp" +#include "messages/Image.hpp" +#include "messages/Link.hpp" #include "messages/Message.hpp" +#include "messages/MessageElement.hpp" +#include "messages/MessageThread.hpp" #include "providers/bttv/BttvEmotes.hpp" -#include "providers/bttv/LoadBttvChannelEmote.hpp" #include "providers/RecentMessagesApi.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" #include "providers/seventv/SeventvEmotes.hpp" #include "providers/seventv/SeventvEventAPI.hpp" #include "providers/twitch/api/Helix.hpp" +#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/IrcMessageHandler.hpp" #include "providers/twitch/PubSubManager.hpp" #include "providers/twitch/TwitchAccount.hpp" diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index 79226f077e1..3596f570f7b 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -1,17 +1,11 @@ #pragma once -#include "Application.hpp" #include "common/Aliases.hpp" #include "common/Atomic.hpp" #include "common/Channel.hpp" #include "common/ChannelChatters.hpp" -#include "common/ChatterSet.hpp" #include "common/Outcome.hpp" #include "common/UniqueAccess.hpp" -#include "messages/MessageThread.hpp" -#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" -#include "providers/twitch/api/Helix.hpp" -#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/TwitchEmotes.hpp" #include "util/QStringHash.hpp" @@ -54,6 +48,14 @@ class TwitchBadges; class FfzEmotes; class BttvEmotes; class SeventvEmotes; +struct SeventvEventAPIEmoteAddDispatch; +struct SeventvEventAPIEmoteUpdateDispatch; +struct SeventvEventAPIEmoteRemoveDispatch; +struct SeventvEventAPIUserConnectionUpdateDispatch; +struct ChannelPointReward; +class MessageThread; +struct CheerEmoteSet; +struct HelixStream; class TwitchIrcServer; diff --git a/src/providers/twitch/TwitchIrcServer.cpp b/src/providers/twitch/TwitchIrcServer.cpp index 04053400996..02231091f94 100644 --- a/src/providers/twitch/TwitchIrcServer.cpp +++ b/src/providers/twitch/TwitchIrcServer.cpp @@ -1,18 +1,19 @@ #include "TwitchIrcServer.hpp" #include "Application.hpp" -#include "common/Common.hpp" #include "common/Env.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" #include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" +#include "providers/seventv/eventapi/SeventvEventAPISubscription.hpp" #include "providers/seventv/SeventvEventAPI.hpp" +#include "providers/twitch/api/Helix.hpp" +#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/IrcMessageHandler.hpp" #include "providers/twitch/PubSubManager.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchChannel.hpp" -#include "providers/twitch/TwitchHelpers.hpp" #include "singletons/Settings.hpp" #include "util/Helpers.hpp" #include "util/PostToThread.hpp" diff --git a/src/providers/twitch/TwitchIrcServer.hpp b/src/providers/twitch/TwitchIrcServer.hpp index 572b2bb1384..e93fcc4fc9f 100644 --- a/src/providers/twitch/TwitchIrcServer.hpp +++ b/src/providers/twitch/TwitchIrcServer.hpp @@ -3,12 +3,13 @@ #include "common/Atomic.hpp" #include "common/Channel.hpp" #include "common/Singleton.hpp" -#include "pajlada/signals/signalholder.hpp" #include "providers/bttv/BttvEmotes.hpp" #include "providers/ffz/FfzEmotes.hpp" #include "providers/irc/AbstractIrcServer.hpp" #include "providers/seventv/SeventvEmotes.hpp" +#include + #include #include #include diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index a8b1b0e5b7e..f7694879773 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -7,10 +7,16 @@ #include "controllers/ignores/IgnorePhrase.hpp" #include "controllers/userdata/UserDataController.hpp" #include "messages/Emote.hpp" +#include "messages/Image.hpp" #include "messages/Message.hpp" +#include "messages/MessageThread.hpp" #include "providers/chatterino/ChatterinoBadges.hpp" +#include "providers/colors/ColorProvider.hpp" #include "providers/ffz/FfzBadges.hpp" #include "providers/seventv/SeventvBadges.hpp" +#include "providers/twitch/api/Helix.hpp" +#include "providers/twitch/ChannelPointReward.hpp" +#include "providers/twitch/PubSubActions.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchBadge.hpp" #include "providers/twitch/TwitchBadges.hpp" @@ -27,7 +33,6 @@ #include "widgets/Window.hpp" #include -#include #include #include #include diff --git a/src/providers/twitch/TwitchMessageBuilder.hpp b/src/providers/twitch/TwitchMessageBuilder.hpp index df1d782babf..30d62d84acc 100644 --- a/src/providers/twitch/TwitchMessageBuilder.hpp +++ b/src/providers/twitch/TwitchMessageBuilder.hpp @@ -2,13 +2,9 @@ #include "common/Aliases.hpp" #include "common/Outcome.hpp" -#include "messages/MessageThread.hpp" #include "messages/SharedMessageBuilder.hpp" -#include "providers/twitch/api/Helix.hpp" -#include "providers/twitch/ChannelPointReward.hpp" -#include "providers/twitch/PubSubActions.hpp" -#include "providers/twitch/TwitchBadge.hpp" +#include #include #include #include @@ -20,6 +16,11 @@ using EmotePtr = std::shared_ptr; class Channel; class TwitchChannel; +class MessageThread; +struct HelixVip; +using HelixModerator = HelixVip; +struct ChannelPointReward; +struct DeleteAction; struct TwitchEmoteOccurrence { int start; diff --git a/src/providers/twitch/TwitchUser.cpp b/src/providers/twitch/TwitchUser.cpp index e24e9c78181..f1b6255098d 100644 --- a/src/providers/twitch/TwitchUser.cpp +++ b/src/providers/twitch/TwitchUser.cpp @@ -1,7 +1,15 @@ #include "providers/twitch/TwitchUser.hpp" +#include "providers/twitch/api/Helix.hpp" #include "util/RapidjsonHelpers.hpp" namespace chatterino { +void TwitchUser::fromHelixBlock(const HelixBlock &ignore) +{ + this->id = ignore.userId; + this->name = ignore.userName; + this->displayName = ignore.displayName; +} + } // namespace chatterino diff --git a/src/providers/twitch/TwitchUser.hpp b/src/providers/twitch/TwitchUser.hpp index 478383b98d1..7593abd3c8e 100644 --- a/src/providers/twitch/TwitchUser.hpp +++ b/src/providers/twitch/TwitchUser.hpp @@ -1,6 +1,5 @@ #pragma once -#include "providers/twitch/api/Helix.hpp" #include "util/RapidjsonHelpers.hpp" #include @@ -11,6 +10,8 @@ namespace chatterino { +struct HelixBlock; + struct TwitchUser { QString id; mutable QString name; @@ -24,12 +25,7 @@ struct TwitchUser { this->displayName = other.displayName; } - void fromHelixBlock(const HelixBlock &ignore) - { - this->id = ignore.userId; - this->name = ignore.userName; - this->displayName = ignore.displayName; - } + void fromHelixBlock(const HelixBlock &ignore); bool operator<(const TwitchUser &rhs) const { diff --git a/src/providers/twitch/api/Helix.cpp b/src/providers/twitch/api/Helix.cpp index 0b816f8db5d..76942e8f236 100644 --- a/src/providers/twitch/api/Helix.cpp +++ b/src/providers/twitch/api/Helix.cpp @@ -1,5 +1,7 @@ #include "providers/twitch/api/Helix.hpp" +#include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "common/QLogging.hpp" diff --git a/src/providers/twitch/api/Helix.hpp b/src/providers/twitch/api/Helix.hpp index 92674ca7276..a91f67f404e 100644 --- a/src/providers/twitch/api/Helix.hpp +++ b/src/providers/twitch/api/Helix.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/src/singletons/Badges.hpp b/src/singletons/Badges.hpp index 8d53aa9e58e..e7288ac5c31 100644 --- a/src/singletons/Badges.hpp +++ b/src/singletons/Badges.hpp @@ -1,9 +1,6 @@ #pragma once #include "common/Singleton.hpp" -#include "messages/Emote.hpp" - -#include namespace chatterino { diff --git a/src/singletons/Emotes.cpp b/src/singletons/Emotes.cpp index c5d93e3bf21..5b30faad3fc 100644 --- a/src/singletons/Emotes.cpp +++ b/src/singletons/Emotes.cpp @@ -1,8 +1,5 @@ #include "singletons/Emotes.hpp" -#include "Application.hpp" -#include "controllers/accounts/AccountController.hpp" - namespace chatterino { Emotes::Emotes() diff --git a/src/singletons/Emotes.hpp b/src/singletons/Emotes.hpp index deff15d3acf..1a65a17d0c7 100644 --- a/src/singletons/Emotes.hpp +++ b/src/singletons/Emotes.hpp @@ -1,10 +1,7 @@ #pragma once #include "common/Singleton.hpp" -#include "providers/bttv/BttvEmotes.hpp" #include "providers/emoji/Emojis.hpp" -#include "providers/ffz/FfzEmotes.hpp" -#include "providers/seventv/SeventvEmotes.hpp" #include "providers/twitch/TwitchEmotes.hpp" #include "singletons/helper/GifTimer.hpp" diff --git a/src/singletons/Fonts.cpp b/src/singletons/Fonts.cpp index 521baefa7b3..08c00ca390f 100644 --- a/src/singletons/Fonts.cpp +++ b/src/singletons/Fonts.cpp @@ -1,16 +1,13 @@ #include "singletons/Fonts.hpp" -#include "BaseSettings.hpp" +#include "Application.hpp" #include "debug/AssertInGuiThread.hpp" +#include "singletons/Settings.hpp" +#include "singletons/WindowManager.hpp" #include #include -#ifdef CHATTERINO -# include "Application.hpp" -# include "singletons/WindowManager.hpp" -#endif - #ifdef Q_OS_WIN32 # define DEFAULT_FONT_FAMILY "Segoe UI" # define DEFAULT_FONT_SIZE 10 diff --git a/src/singletons/Logging.hpp b/src/singletons/Logging.hpp index a0b1be3ea18..46d3782b011 100644 --- a/src/singletons/Logging.hpp +++ b/src/singletons/Logging.hpp @@ -1,14 +1,18 @@ #pragma once #include "common/Singleton.hpp" -#include "messages/Message.hpp" -#include "singletons/helper/LoggingChannel.hpp" +#include + +#include #include namespace chatterino { class Paths; +struct Message; +using MessagePtr = std::shared_ptr; +class LoggingChannel; class Logging : public Singleton { diff --git a/src/singletons/NativeMessaging.hpp b/src/singletons/NativeMessaging.hpp index 9733dfb14ec..9c46a08a1c8 100644 --- a/src/singletons/NativeMessaging.hpp +++ b/src/singletons/NativeMessaging.hpp @@ -1,7 +1,8 @@ #pragma once +#include "common/Atomic.hpp" + #include -#include #include #include diff --git a/src/singletons/Settings.cpp b/src/singletons/Settings.cpp index f816209145c..495fe1d3578 100644 --- a/src/singletons/Settings.cpp +++ b/src/singletons/Settings.cpp @@ -1,12 +1,12 @@ #include "singletons/Settings.hpp" -#include "Application.hpp" +#include "controllers/filters/FilterRecord.hpp" +#include "controllers/highlights/HighlightBadge.hpp" #include "controllers/highlights/HighlightBlacklistUser.hpp" #include "controllers/highlights/HighlightPhrase.hpp" #include "controllers/ignores/IgnorePhrase.hpp" -#include "singletons/Paths.hpp" -#include "singletons/Resources.hpp" -#include "singletons/WindowManager.hpp" +#include "controllers/moderationactions/ModerationAction.hpp" +#include "controllers/nicknames/Nickname.hpp" #include "util/PersistSignalVector.hpp" #include "util/WindowsHelper.hpp" diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 2f2d0e7f228..1a671085d73 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -3,12 +3,8 @@ #include "BaseSettings.hpp" #include "common/Channel.hpp" #include "common/SignalVector.hpp" -#include "controllers/filters/FilterRecord.hpp" -#include "controllers/highlights/HighlightBadge.hpp" -#include "controllers/highlights/HighlightPhrase.hpp" -#include "controllers/moderationactions/ModerationAction.hpp" -#include "controllers/nicknames/Nickname.hpp" #include "singletons/Toasts.hpp" +#include "util/RapidJsonSerializeQString.hpp" #include "util/StreamerMode.hpp" #include "widgets/Notebook.hpp" #include "widgets/splits/SplitInput.hpp" @@ -24,7 +20,10 @@ class HighlightPhrase; class HighlightBlacklistUser; class IgnorePhrase; class FilterRecord; +using FilterRecordPtr = std::shared_ptr; class Nickname; +class HighlightBadge; +class ModerationAction; /// Settings which are available for reading on all threads. class ConcurrentSettings @@ -521,7 +520,3 @@ class Settings : public ABSettings, public ConcurrentSettings }; } // namespace chatterino - -#ifdef CHATTERINO -# include "singletons/Settings.hpp" -#endif diff --git a/src/singletons/Theme.hpp b/src/singletons/Theme.hpp index 92dd5e8305c..f99ba169def 100644 --- a/src/singletons/Theme.hpp +++ b/src/singletons/Theme.hpp @@ -1,12 +1,12 @@ #pragma once +#include "common/ChatterinoSetting.hpp" #include "common/Singleton.hpp" #include "util/RapidJsonSerializeQString.hpp" #include #include #include -#include namespace chatterino { diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index 99740d16b1c..09fbf8fbcc0 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -9,6 +9,7 @@ #include "providers/twitch/TwitchCommon.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "singletons/Paths.hpp" +#include "singletons/Settings.hpp" #include "util/StreamLink.hpp" #include "widgets/helper/CommonTexts.hpp" diff --git a/src/singletons/Toasts.hpp b/src/singletons/Toasts.hpp index b1a8eb44e7c..a47a52b5ca5 100644 --- a/src/singletons/Toasts.hpp +++ b/src/singletons/Toasts.hpp @@ -1,9 +1,9 @@ #pragma once -#include "Application.hpp" #include "common/Singleton.hpp" #include +#include namespace chatterino { diff --git a/src/singletons/Updates.cpp b/src/singletons/Updates.cpp index 52c80ec6cfb..2647cfc4358 100644 --- a/src/singletons/Updates.cpp +++ b/src/singletons/Updates.cpp @@ -2,6 +2,7 @@ #include "common/Modes.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/Outcome.hpp" #include "common/QLogging.hpp" #include "common/Version.hpp" diff --git a/src/singletons/WindowManager.hpp b/src/singletons/WindowManager.hpp index 6cac9241c45..ba7cc5a4c93 100644 --- a/src/singletons/WindowManager.hpp +++ b/src/singletons/WindowManager.hpp @@ -1,12 +1,13 @@ #pragma once -#include "common/Channel.hpp" #include "common/FlagsEnum.hpp" #include "common/Singleton.hpp" -#include "common/WindowDescriptors.hpp" -#include "pajlada/settings/settinglistener.hpp" #include "widgets/splits/SplitContainer.hpp" +#include +#include +#include + #include namespace chatterino { @@ -14,8 +15,15 @@ namespace chatterino { class Settings; class Paths; class Window; -class SplitContainer; class ChannelView; +class IndirectChannel; +class Split; +struct SplitDescriptor; +class Channel; +using ChannelPtr = std::shared_ptr; +struct Message; +using MessagePtr = std::shared_ptr; +class WindowLayout; enum class MessageElementFlag : int64_t; using MessageElementFlags = FlagsEnum; diff --git a/src/singletons/helper/LoggingChannel.cpp b/src/singletons/helper/LoggingChannel.cpp index 13f40c06eb2..78120496c76 100644 --- a/src/singletons/helper/LoggingChannel.cpp +++ b/src/singletons/helper/LoggingChannel.cpp @@ -1,14 +1,12 @@ #include "LoggingChannel.hpp" -#include "Application.hpp" #include "common/QLogging.hpp" +#include "messages/Message.hpp" #include "singletons/Paths.hpp" #include "singletons/Settings.hpp" #include -#include - namespace chatterino { QByteArray endline("\n"); diff --git a/src/singletons/helper/LoggingChannel.hpp b/src/singletons/helper/LoggingChannel.hpp index 519dcdaf198..9970baaefcd 100644 --- a/src/singletons/helper/LoggingChannel.hpp +++ b/src/singletons/helper/LoggingChannel.hpp @@ -1,7 +1,5 @@ #pragma once -#include "messages/Message.hpp" - #include #include #include @@ -12,6 +10,8 @@ namespace chatterino { class Logging; +struct Message; +using MessagePtr = std::shared_ptr; class LoggingChannel : boost::noncopyable { diff --git a/src/util/AttachToConsole.cpp b/src/util/AttachToConsole.cpp index b1c993ad4f3..5e5ca77ff8d 100644 --- a/src/util/AttachToConsole.cpp +++ b/src/util/AttachToConsole.cpp @@ -1,7 +1,9 @@ -#include "AttachToConsole.hpp" +#include "util/AttachToConsole.hpp" #ifdef USEWINSDK # include + +# include #endif namespace chatterino { diff --git a/src/util/NuulsUploader.cpp b/src/util/NuulsUploader.cpp index 6063bd30cb0..79f7b3794e7 100644 --- a/src/util/NuulsUploader.cpp +++ b/src/util/NuulsUploader.cpp @@ -2,11 +2,13 @@ #include "common/Env.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" #include "singletons/Paths.hpp" #include "singletons/Settings.hpp" #include "util/CombinePath.hpp" +#include "widgets/helper/ResizingTextEdit.hpp" #include #include diff --git a/src/util/NuulsUploader.hpp b/src/util/NuulsUploader.hpp index 6339d0dae0d..e830b45054f 100644 --- a/src/util/NuulsUploader.hpp +++ b/src/util/NuulsUploader.hpp @@ -1,10 +1,16 @@ -#include "common/Channel.hpp" -#include "widgets/helper/ResizingTextEdit.hpp" +#pragma once #include #include +#include + namespace chatterino { + +class ResizingTextEdit; +class Channel; +using ChannelPtr = std::shared_ptr; + struct RawImageData { QByteArray data; QString format; @@ -17,4 +23,5 @@ void upload(RawImageData imageData, ChannelPtr channel, ResizingTextEdit &textEdit); void upload(const QMimeData *source, ChannelPtr channel, ResizingTextEdit &outputTextEdit); + } // namespace chatterino diff --git a/src/util/WindowsHelper.cpp b/src/util/WindowsHelper.cpp index d2b9a4efebd..06fc0dd798c 100644 --- a/src/util/WindowsHelper.cpp +++ b/src/util/WindowsHelper.cpp @@ -1,5 +1,7 @@ #include "WindowsHelper.hpp" +#include +#include #include #ifdef USEWINSDK diff --git a/src/widgets/AccountSwitchPopup.cpp b/src/widgets/AccountSwitchPopup.cpp index 6b0e32b11ba..a50969289af 100644 --- a/src/widgets/AccountSwitchPopup.cpp +++ b/src/widgets/AccountSwitchPopup.cpp @@ -1,12 +1,11 @@ #include "widgets/AccountSwitchPopup.hpp" +#include "widgets/AccountSwitchWidget.hpp" #include "widgets/dialogs/SettingsDialog.hpp" -#include #include #include #include -#include namespace chatterino { diff --git a/src/widgets/AccountSwitchPopup.hpp b/src/widgets/AccountSwitchPopup.hpp index 619bfbe20c4..801b1a463c8 100644 --- a/src/widgets/AccountSwitchPopup.hpp +++ b/src/widgets/AccountSwitchPopup.hpp @@ -1,12 +1,13 @@ #pragma once -#include "widgets/AccountSwitchWidget.hpp" #include "widgets/BaseWindow.hpp" #include namespace chatterino { +class AccountSwitchWidget; + class AccountSwitchPopup : public BaseWindow { Q_OBJECT diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index a4b1b709301..070a2533a2a 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -1,7 +1,9 @@ #include "widgets/BaseWindow.hpp" -#include "BaseSettings.hpp" +#include "Application.hpp" +#include "singletons/Settings.hpp" #include "singletons/Theme.hpp" +#include "singletons/WindowManager.hpp" #include "util/DebugCount.hpp" #include "util/PostToThread.hpp" #include "util/WindowsHelper.hpp" @@ -16,11 +18,6 @@ #include -#ifdef CHATTERINO -# include "Application.hpp" -# include "singletons/WindowManager.hpp" -#endif - #ifdef USEWINSDK # include # include diff --git a/src/widgets/BaseWindow.hpp b/src/widgets/BaseWindow.hpp index 6accc87ca3e..29a4e474377 100644 --- a/src/widgets/BaseWindow.hpp +++ b/src/widgets/BaseWindow.hpp @@ -4,6 +4,7 @@ #include "widgets/BaseWidget.hpp" #include +#include #include diff --git a/src/widgets/Notebook.hpp b/src/widgets/Notebook.hpp index 11c96d30b61..7cc49cfa67b 100644 --- a/src/widgets/Notebook.hpp +++ b/src/widgets/Notebook.hpp @@ -1,8 +1,8 @@ #pragma once -#include "pajlada/signals/signal.hpp" #include "widgets/BaseWidget.hpp" +#include #include #include #include diff --git a/src/widgets/Scrollbar.cpp b/src/widgets/Scrollbar.cpp index 7fb44f49e88..cbd6e4e3948 100644 --- a/src/widgets/Scrollbar.cpp +++ b/src/widgets/Scrollbar.cpp @@ -1,13 +1,11 @@ #include "widgets/Scrollbar.hpp" -#include "Application.hpp" #include "common/QLogging.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "singletons/WindowManager.hpp" #include "widgets/helper/ChannelView.hpp" -#include #include #include #include diff --git a/src/widgets/TooltipWidget.cpp b/src/widgets/TooltipWidget.cpp index 4e7ee76972f..ac89f5bfaac 100644 --- a/src/widgets/TooltipWidget.cpp +++ b/src/widgets/TooltipWidget.cpp @@ -1,6 +1,7 @@ -#include "TooltipWidget.hpp" +#include "widgets/TooltipWidget.hpp" #include "Application.hpp" +#include "messages/Image.hpp" #include "singletons/Fonts.hpp" #include "singletons/WindowManager.hpp" diff --git a/src/widgets/TooltipWidget.hpp b/src/widgets/TooltipWidget.hpp index 84db6d787e6..7e1c0d2dda1 100644 --- a/src/widgets/TooltipWidget.hpp +++ b/src/widgets/TooltipWidget.hpp @@ -1,6 +1,5 @@ #pragma once -#include "messages/Image.hpp" #include "widgets/BaseWindow.hpp" #include @@ -9,6 +8,9 @@ namespace chatterino { +class Image; +using ImagePtr = std::shared_ptr; + class TooltipWidget : public BaseWindow { Q_OBJECT diff --git a/src/widgets/dialogs/ColorPickerDialog.cpp b/src/widgets/dialogs/ColorPickerDialog.cpp index 4eebac79fb1..c15e4b16a18 100644 --- a/src/widgets/dialogs/ColorPickerDialog.cpp +++ b/src/widgets/dialogs/ColorPickerDialog.cpp @@ -2,9 +2,13 @@ #include "providers/colors/ColorProvider.hpp" #include "singletons/Theme.hpp" +#include "util/LayoutCreator.hpp" +#include "widgets/helper/ColorButton.hpp" +#include "widgets/helper/QColorPicker.hpp" #include #include +#include namespace chatterino { diff --git a/src/widgets/dialogs/ColorPickerDialog.hpp b/src/widgets/dialogs/ColorPickerDialog.hpp index ceccad7b5c6..132e6ac0dcd 100644 --- a/src/widgets/dialogs/ColorPickerDialog.hpp +++ b/src/widgets/dialogs/ColorPickerDialog.hpp @@ -1,17 +1,24 @@ #pragma once -#include "util/LayoutCreator.hpp" #include "widgets/BasePopup.hpp" -#include "widgets/helper/ColorButton.hpp" -#include "widgets/helper/QColorPicker.hpp" #include #include +#include +#include #include namespace chatterino { +class ColorButton; +class QColorLuminancePicker; +class QColorPicker; +class QColSpinBox; + +template +class LayoutCreator; + /** * @brief A custom color picker dialog. * diff --git a/src/widgets/dialogs/EditHotkeyDialog.cpp b/src/widgets/dialogs/EditHotkeyDialog.cpp index 457d5fd3a16..d1bac90cc7a 100644 --- a/src/widgets/dialogs/EditHotkeyDialog.cpp +++ b/src/widgets/dialogs/EditHotkeyDialog.cpp @@ -3,6 +3,7 @@ #include "Application.hpp" #include "common/QLogging.hpp" #include "controllers/hotkeys/ActionNames.hpp" +#include "controllers/hotkeys/Hotkey.hpp" #include "controllers/hotkeys/HotkeyController.hpp" #include "controllers/hotkeys/HotkeyHelpers.hpp" #include "ui_EditHotkeyDialog.h" diff --git a/src/widgets/dialogs/EditHotkeyDialog.hpp b/src/widgets/dialogs/EditHotkeyDialog.hpp index 71923824668..e442b4f6d52 100644 --- a/src/widgets/dialogs/EditHotkeyDialog.hpp +++ b/src/widgets/dialogs/EditHotkeyDialog.hpp @@ -1,7 +1,5 @@ #pragma once -#include "controllers/hotkeys/Hotkey.hpp" - #include #include @@ -14,6 +12,8 @@ class EditHotkeyDialog; namespace chatterino { +class Hotkey; + class EditHotkeyDialog : public QDialog { Q_OBJECT diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index 083064409ad..5d6b5bf3505 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -9,10 +9,12 @@ #include "messages/Emote.hpp" #include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" +#include "messages/MessageElement.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "singletons/Emotes.hpp" +#include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" #include "widgets/helper/ChannelView.hpp" #include "widgets/helper/TrimRegExpValidator.hpp" diff --git a/src/widgets/dialogs/EmotePopup.hpp b/src/widgets/dialogs/EmotePopup.hpp index 0c4a4f3dd16..71a20a0a863 100644 --- a/src/widgets/dialogs/EmotePopup.hpp +++ b/src/widgets/dialogs/EmotePopup.hpp @@ -1,8 +1,6 @@ #pragma once -#include "providers/twitch/TwitchChannel.hpp" #include "widgets/BasePopup.hpp" -#include "widgets/Notebook.hpp" #include #include @@ -13,6 +11,8 @@ struct Link; class ChannelView; class Channel; using ChannelPtr = std::shared_ptr; +class Notebook; +class TwitchChannel; class EmotePopup : public BasePopup { diff --git a/src/widgets/dialogs/ReplyThreadPopup.cpp b/src/widgets/dialogs/ReplyThreadPopup.cpp index 83c39b7799a..fc92da91755 100644 --- a/src/widgets/dialogs/ReplyThreadPopup.cpp +++ b/src/widgets/dialogs/ReplyThreadPopup.cpp @@ -3,9 +3,13 @@ #include "Application.hpp" #include "common/Channel.hpp" #include "common/QLogging.hpp" +#include "controllers/accounts/AccountController.hpp" #include "controllers/hotkeys/HotkeyController.hpp" +#include "messages/Message.hpp" #include "messages/MessageThread.hpp" +#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/TwitchAccount.hpp" +#include "providers/twitch/TwitchChannel.hpp" #include "util/LayoutCreator.hpp" #include "widgets/helper/ChannelView.hpp" #include "widgets/helper/ResizingTextEdit.hpp" diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index 054e5f685ca..1b4cb8965c9 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -4,7 +4,10 @@ #include "common/QLogging.hpp" #include "controllers/hotkeys/HotkeyController.hpp" #include "providers/irc/Irc2.hpp" +#include "providers/irc/IrcChannel2.hpp" +#include "providers/irc/IrcServer.hpp" #include "providers/twitch/TwitchIrcServer.hpp" +#include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "util/LayoutCreator.hpp" #include "widgets/dialogs/IrcConnectionEditor.hpp" diff --git a/src/widgets/dialogs/SelectChannelDialog.hpp b/src/widgets/dialogs/SelectChannelDialog.hpp index 493a41f8e91..3a4f5a5c0cc 100644 --- a/src/widgets/dialogs/SelectChannelDialog.hpp +++ b/src/widgets/dialogs/SelectChannelDialog.hpp @@ -1,7 +1,5 @@ #pragma once -#include "Application.hpp" -#include "common/Channel.hpp" #include "widgets/BaseWindow.hpp" #include @@ -13,6 +11,9 @@ namespace chatterino { class Notebook; class EditableModelView; +class IndirectChannel; +class Channel; +using ChannelPtr = std::shared_ptr; class SelectChannelDialog final : public BaseWindow { diff --git a/src/widgets/dialogs/SelectChannelFiltersDialog.cpp b/src/widgets/dialogs/SelectChannelFiltersDialog.cpp index 1cf7d75ef26..3b31f17abb7 100644 --- a/src/widgets/dialogs/SelectChannelFiltersDialog.cpp +++ b/src/widgets/dialogs/SelectChannelFiltersDialog.cpp @@ -1,5 +1,6 @@ #include "SelectChannelFiltersDialog.hpp" +#include "controllers/filters/FilterRecord.hpp" #include "singletons/Settings.hpp" #include diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index d07a5480256..d3036554075 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -4,9 +4,10 @@ #include "common/Args.hpp" #include "controllers/commands/CommandController.hpp" #include "controllers/hotkeys/HotkeyController.hpp" -#include "singletons/Resources.hpp" +#include "singletons/Settings.hpp" #include "util/LayoutCreator.hpp" #include "widgets/helper/Button.hpp" +#include "widgets/helper/SettingsDialogTab.hpp" #include "widgets/settingspages/AboutPage.hpp" #include "widgets/settingspages/AccountsPage.hpp" #include "widgets/settingspages/CommandPage.hpp" diff --git a/src/widgets/dialogs/SettingsDialog.hpp b/src/widgets/dialogs/SettingsDialog.hpp index 27789920bb8..ad8f873d387 100644 --- a/src/widgets/dialogs/SettingsDialog.hpp +++ b/src/widgets/dialogs/SettingsDialog.hpp @@ -1,7 +1,6 @@ #pragma once #include "widgets/BaseWindow.hpp" -#include "widgets/helper/SettingsDialogTab.hpp" #include #include @@ -19,6 +18,7 @@ namespace chatterino { class SettingsPage; class SettingsDialogTab; class ModerationPage; +enum class SettingsTabId; class PageHeader : public QFrame { diff --git a/src/widgets/dialogs/UpdateDialog.hpp b/src/widgets/dialogs/UpdateDialog.hpp index 48e5eb86b42..be7e481eadf 100644 --- a/src/widgets/dialogs/UpdateDialog.hpp +++ b/src/widgets/dialogs/UpdateDialog.hpp @@ -1,14 +1,16 @@ #pragma once -#include "pajlada/signals/signalholder.hpp" #include "singletons/Updates.hpp" #include "widgets/BaseWindow.hpp" -#include "widgets/Label.hpp" + +#include class QPushButton; namespace chatterino { +class Label; + class UpdateDialog : public BaseWindow { public: diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index ed7e3303376..de3586870e5 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -11,6 +11,7 @@ #include "messages/MessageBuilder.hpp" #include "providers/IvrApi.hpp" #include "providers/twitch/api/Helix.hpp" +#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" @@ -21,7 +22,6 @@ #include "util/Clipboard.hpp" #include "util/Helpers.hpp" #include "util/LayoutCreator.hpp" -#include "util/PostToThread.hpp" #include "util/StreamerMode.hpp" #include "widgets/helper/ChannelView.hpp" #include "widgets/helper/EffectLabel.hpp" diff --git a/src/widgets/dialogs/UserInfoPopup.hpp b/src/widgets/dialogs/UserInfoPopup.hpp index 8217056663c..5e59094d0f1 100644 --- a/src/widgets/dialogs/UserInfoPopup.hpp +++ b/src/widgets/dialogs/UserInfoPopup.hpp @@ -1,7 +1,6 @@ #pragma once #include "widgets/DraggablePopup.hpp" -#include "widgets/helper/ChannelView.hpp" #include #include @@ -15,6 +14,8 @@ namespace chatterino { class Channel; using ChannelPtr = std::shared_ptr; class Label; +class ChannelView; +class Split; class UserInfoPopup final : public DraggablePopup { diff --git a/src/widgets/dialogs/switcher/SwitchSplitItem.cpp b/src/widgets/dialogs/switcher/SwitchSplitItem.cpp index 4802611256e..64fe1bba3c0 100644 --- a/src/widgets/dialogs/switcher/SwitchSplitItem.cpp +++ b/src/widgets/dialogs/switcher/SwitchSplitItem.cpp @@ -3,7 +3,9 @@ #include "Application.hpp" #include "singletons/Fonts.hpp" #include "singletons/Theme.hpp" +#include "singletons/WindowManager.hpp" #include "widgets/helper/NotebookTab.hpp" +#include "widgets/splits/Split.hpp" namespace chatterino { diff --git a/src/widgets/dialogs/switcher/SwitchSplitItem.hpp b/src/widgets/dialogs/switcher/SwitchSplitItem.hpp index 142d258287f..4343e42bfea 100644 --- a/src/widgets/dialogs/switcher/SwitchSplitItem.hpp +++ b/src/widgets/dialogs/switcher/SwitchSplitItem.hpp @@ -1,14 +1,16 @@ #pragma once -#include "singletons/WindowManager.hpp" #include "widgets/dialogs/switcher/AbstractSwitcherItem.hpp" -#include "widgets/helper/NotebookTab.hpp" -#include "widgets/Notebook.hpp" -#include "widgets/splits/Split.hpp" -#include "widgets/Window.hpp" + +#include +#include +#include namespace chatterino { +class SplitContainer; +class Split; + class SwitchSplitItem : public AbstractSwitcherItem { public: diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index d89982cae69..6877d79fd55 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -4,15 +4,19 @@ #include "common/Common.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" +#include "controllers/commands/Command.hpp" #include "controllers/commands/CommandController.hpp" +#include "controllers/filters/FilterSet.hpp" #include "debug/Benchmark.hpp" #include "messages/Emote.hpp" +#include "messages/Image.hpp" #include "messages/layouts/MessageLayout.hpp" #include "messages/layouts/MessageLayoutElement.hpp" #include "messages/LimitedQueueSnapshot.hpp" #include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" #include "messages/MessageElement.hpp" +#include "messages/MessageThread.hpp" #include "providers/LinkResolver.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchChannel.hpp" @@ -31,6 +35,7 @@ #include "widgets/dialogs/SettingsDialog.hpp" #include "widgets/dialogs/UserInfoPopup.hpp" #include "widgets/helper/EffectLabel.hpp" +#include "widgets/helper/ScrollbarHighlight.hpp" #include "widgets/helper/SearchPopup.hpp" #include "widgets/Scrollbar.hpp" #include "widgets/splits/Split.hpp" diff --git a/src/widgets/helper/ChannelView.hpp b/src/widgets/helper/ChannelView.hpp index afb1e836e0f..0d5e1b3e3ad 100644 --- a/src/widgets/helper/ChannelView.hpp +++ b/src/widgets/helper/ChannelView.hpp @@ -1,8 +1,6 @@ #pragma once #include "common/FlagsEnum.hpp" -#include "controllers/filters/FilterSet.hpp" -#include "messages/Image.hpp" #include "messages/LimitedQueue.hpp" #include "messages/LimitedQueueSnapshot.hpp" #include "messages/Selection.hpp" @@ -10,6 +8,7 @@ #include "widgets/BaseWidget.hpp" #include +#include #include #include #include @@ -43,6 +42,8 @@ class EffectLabel; struct Link; class MessageLayoutElement; class Split; +class FilterSet; +using FilterSetPtr = std::shared_ptr; enum class PauseReason { Mouse, diff --git a/src/widgets/helper/EffectLabel.hpp b/src/widgets/helper/EffectLabel.hpp index f1fbc5dff0d..b6ea8af0870 100644 --- a/src/widgets/helper/EffectLabel.hpp +++ b/src/widgets/helper/EffectLabel.hpp @@ -1,6 +1,5 @@ #pragma once -#include "widgets/BaseWidget.hpp" #include "widgets/helper/Button.hpp" #include "widgets/helper/SignalLabel.hpp" #include "widgets/Label.hpp" diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index 31e7563c98f..37cf1b3b6ed 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -1,7 +1,6 @@ #pragma once #include "common/Common.hpp" -#include "widgets/BaseWidget.hpp" #include "widgets/helper/Button.hpp" #include "widgets/Notebook.hpp" @@ -14,8 +13,6 @@ namespace chatterino { #define NOTEBOOK_TAB_HEIGHT 28 -// class Notebook; -class Notebook; class SplitContainer; class NotebookTab : public Button diff --git a/src/widgets/helper/SearchPopup.cpp b/src/widgets/helper/SearchPopup.cpp index a7524abf405..0c0f055272f 100644 --- a/src/widgets/helper/SearchPopup.cpp +++ b/src/widgets/helper/SearchPopup.cpp @@ -1,7 +1,10 @@ #include "SearchPopup.hpp" +#include "Application.hpp" #include "common/Channel.hpp" +#include "controllers/filters/FilterSet.hpp" #include "controllers/hotkeys/HotkeyController.hpp" +#include "messages/MessageElement.hpp" #include "messages/search/AuthorPredicate.hpp" #include "messages/search/BadgePredicate.hpp" #include "messages/search/ChannelPredicate.hpp" @@ -12,6 +15,7 @@ #include "messages/search/SubtierPredicate.hpp" #include "singletons/WindowManager.hpp" #include "widgets/helper/ChannelView.hpp" +#include "widgets/splits/Split.hpp" #include #include diff --git a/src/widgets/helper/SearchPopup.hpp b/src/widgets/helper/SearchPopup.hpp index e95fcf0ceb5..d7caab885ac 100644 --- a/src/widgets/helper/SearchPopup.hpp +++ b/src/widgets/helper/SearchPopup.hpp @@ -1,11 +1,8 @@ #pragma once -#include "controllers/filters/FilterSet.hpp" #include "ForwardDecl.hpp" #include "messages/LimitedQueueSnapshot.hpp" -#include "messages/search/MessagePredicate.hpp" #include "widgets/BasePopup.hpp" -#include "widgets/splits/Split.hpp" #include @@ -13,6 +10,9 @@ class QLineEdit; namespace chatterino { +class Split; +class MessagePredicate; + class SearchPopup : public BasePopup { public: diff --git a/src/widgets/helper/SettingsDialogTab.hpp b/src/widgets/helper/SettingsDialogTab.hpp index a6c72bdb611..1c907ad459d 100644 --- a/src/widgets/helper/SettingsDialogTab.hpp +++ b/src/widgets/helper/SettingsDialogTab.hpp @@ -13,7 +13,7 @@ namespace chatterino { class SettingsPage; class SettingsDialog; -enum SettingsTabId { +enum class SettingsTabId { None, Accounts, Moderation, diff --git a/src/widgets/listview/GenericListModel.hpp b/src/widgets/listview/GenericListModel.hpp index ae64f285907..0f2fe21751c 100644 --- a/src/widgets/listview/GenericListModel.hpp +++ b/src/widgets/listview/GenericListModel.hpp @@ -1,3 +1,5 @@ +#pragma once + #include "widgets/listview/GenericListItem.hpp" #include diff --git a/src/widgets/listview/GenericListView.hpp b/src/widgets/listview/GenericListView.hpp index 10aea451678..0ae0f08d286 100644 --- a/src/widgets/listview/GenericListView.hpp +++ b/src/widgets/listview/GenericListView.hpp @@ -1,7 +1,6 @@ #pragma once #include "widgets/listview/GenericItemDelegate.hpp" -#include "widgets/listview/GenericListItem.hpp" #include diff --git a/src/widgets/settingspages/AccountsPage.hpp b/src/widgets/settingspages/AccountsPage.hpp index 58fc02db679..fd24c842236 100644 --- a/src/widgets/settingspages/AccountsPage.hpp +++ b/src/widgets/settingspages/AccountsPage.hpp @@ -1,12 +1,13 @@ #pragma once -#include "widgets/AccountSwitchWidget.hpp" #include "widgets/settingspages/SettingsPage.hpp" #include namespace chatterino { +class AccountSwitchWidget; + class AccountsPage : public SettingsPage { public: diff --git a/src/widgets/settingspages/CommandPage.cpp b/src/widgets/settingspages/CommandPage.cpp index fd971b9e6d0..1e648f4722c 100644 --- a/src/widgets/settingspages/CommandPage.cpp +++ b/src/widgets/settingspages/CommandPage.cpp @@ -1,9 +1,13 @@ #include "CommandPage.hpp" #include "Application.hpp" +#include "controllers/commands/Command.hpp" #include "controllers/commands/CommandController.hpp" #include "controllers/commands/CommandModel.hpp" +#include "singletons/Settings.hpp" +#include "util/CombinePath.hpp" #include "util/LayoutCreator.hpp" +#include "util/Qt.hpp" #include "util/StandardItemHelper.hpp" #include "widgets/helper/EditableModelView.hpp" @@ -13,12 +17,6 @@ #include #include #include -//#include "widgets/helper/ComboBoxItemDelegate.hpp" -#include "util/CombinePath.hpp" -#include "util/Qt.hpp" - -#include -#include // clang-format off #define TEXT "{1} => first word     {1+} => first word and after     {{ => {     more info" diff --git a/src/widgets/settingspages/ExternalToolsPage.cpp b/src/widgets/settingspages/ExternalToolsPage.cpp index 68db6d8eac7..6fb615d93cd 100644 --- a/src/widgets/settingspages/ExternalToolsPage.cpp +++ b/src/widgets/settingspages/ExternalToolsPage.cpp @@ -1,6 +1,6 @@ #include "ExternalToolsPage.hpp" -#include "Application.hpp" +#include "singletons/Settings.hpp" #include "util/Helpers.hpp" #include "util/LayoutCreator.hpp" #include "util/RemoveScrollAreaBackground.hpp" diff --git a/src/widgets/settingspages/FiltersPage.cpp b/src/widgets/settingspages/FiltersPage.cpp index d4262064584..1268ff132e8 100644 --- a/src/widgets/settingspages/FiltersPage.cpp +++ b/src/widgets/settingspages/FiltersPage.cpp @@ -1,6 +1,8 @@ #include "FiltersPage.hpp" +#include "Application.hpp" #include "controllers/filters/FilterModel.hpp" +#include "controllers/filters/FilterRecord.hpp" #include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" #include "util/LayoutCreator.hpp" diff --git a/src/widgets/settingspages/FiltersPage.hpp b/src/widgets/settingspages/FiltersPage.hpp index b6f95e01a4c..febf9a8edf0 100644 --- a/src/widgets/settingspages/FiltersPage.hpp +++ b/src/widgets/settingspages/FiltersPage.hpp @@ -1,6 +1,5 @@ #pragma once -#include "widgets/helper/EditableModelView.hpp" #include "widgets/settingspages/SettingsPage.hpp" #include @@ -9,6 +8,8 @@ class QVBoxLayout; namespace chatterino { +class EditableModelView; + class FiltersPage : public SettingsPage { public: diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index 3ba79516e96..3de5a77afc0 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -10,14 +10,13 @@ #include "singletons/Fonts.hpp" #include "singletons/NativeMessaging.hpp" #include "singletons/Paths.hpp" +#include "singletons/Settings.hpp" #include "singletons/Theme.hpp" -#include "singletons/WindowManager.hpp" #include "util/FuzzyConvert.hpp" #include "util/Helpers.hpp" #include "util/IncognitoBrowser.hpp" #include "util/StreamerMode.hpp" #include "widgets/BaseWindow.hpp" -#include "widgets/helper/Line.hpp" #include "widgets/settingspages/GeneralPageView.hpp" #include "widgets/splits/SplitInput.hpp" diff --git a/src/widgets/settingspages/GeneralPageView.cpp b/src/widgets/settingspages/GeneralPageView.cpp index 70733b95364..0d1ab0b25a4 100644 --- a/src/widgets/settingspages/GeneralPageView.cpp +++ b/src/widgets/settingspages/GeneralPageView.cpp @@ -1,7 +1,6 @@ #include "widgets/settingspages/GeneralPageView.hpp" #include "Application.hpp" -#include "singletons/WindowManager.hpp" #include "util/LayoutHelper.hpp" #include "util/RapidJsonSerializeQString.hpp" #include "widgets/dialogs/ColorPickerDialog.hpp" @@ -9,6 +8,7 @@ #include "widgets/helper/Line.hpp" #include +#include #include namespace { diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index e794eea33b2..04b5058bf62 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -2,16 +2,20 @@ #include "Application.hpp" #include "controllers/highlights/BadgeHighlightModel.hpp" +#include "controllers/highlights/HighlightBadge.hpp" #include "controllers/highlights/HighlightBlacklistModel.hpp" +#include "controllers/highlights/HighlightBlacklistUser.hpp" #include "controllers/highlights/HighlightModel.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" #include "controllers/highlights/UserHighlightModel.hpp" +#include "providers/colors/ColorProvider.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "util/Helpers.hpp" #include "util/LayoutCreator.hpp" -#include "util/StandardItemHelper.hpp" #include "widgets/dialogs/BadgePickerDialog.hpp" #include "widgets/dialogs/ColorPickerDialog.hpp" +#include "widgets/helper/EditableModelView.hpp" #include #include diff --git a/src/widgets/settingspages/HighlightingPage.hpp b/src/widgets/settingspages/HighlightingPage.hpp index 487bf9f7240..47a9c3e3a32 100644 --- a/src/widgets/settingspages/HighlightingPage.hpp +++ b/src/widgets/settingspages/HighlightingPage.hpp @@ -1,6 +1,5 @@ #pragma once -#include "widgets/helper/EditableModelView.hpp" #include "widgets/settingspages/SettingsPage.hpp" #include @@ -11,6 +10,8 @@ class QListWidget; namespace chatterino { +class EditableModelView; + class HighlightingPage : public SettingsPage { public: diff --git a/src/widgets/settingspages/IgnoresPage.cpp b/src/widgets/settingspages/IgnoresPage.cpp index 661fbd6fc67..c8aefe07f27 100644 --- a/src/widgets/settingspages/IgnoresPage.cpp +++ b/src/widgets/settingspages/IgnoresPage.cpp @@ -4,7 +4,9 @@ #include "controllers/accounts/AccountController.hpp" #include "controllers/ignores/IgnoreController.hpp" #include "controllers/ignores/IgnoreModel.hpp" +#include "controllers/ignores/IgnorePhrase.hpp" #include "providers/twitch/TwitchAccount.hpp" +#include "providers/twitch/TwitchUser.hpp" #include "singletons/Settings.hpp" #include "util/LayoutCreator.hpp" #include "widgets/helper/EditableModelView.hpp" diff --git a/src/widgets/settingspages/KeyboardSettingsPage.cpp b/src/widgets/settingspages/KeyboardSettingsPage.cpp index 89932fcd50a..011be06ace1 100644 --- a/src/widgets/settingspages/KeyboardSettingsPage.cpp +++ b/src/widgets/settingspages/KeyboardSettingsPage.cpp @@ -2,14 +2,17 @@ #include "Application.hpp" #include "common/QLogging.hpp" +#include "controllers/hotkeys/Hotkey.hpp" #include "controllers/hotkeys/HotkeyController.hpp" #include "controllers/hotkeys/HotkeyModel.hpp" #include "util/LayoutCreator.hpp" #include "widgets/dialogs/EditHotkeyDialog.hpp" +#include "widgets/helper/EditableModelView.hpp" #include #include #include +#include #include namespace chatterino { diff --git a/src/widgets/settingspages/KeyboardSettingsPage.hpp b/src/widgets/settingspages/KeyboardSettingsPage.hpp index 1da25070b82..2a7d1dff99e 100644 --- a/src/widgets/settingspages/KeyboardSettingsPage.hpp +++ b/src/widgets/settingspages/KeyboardSettingsPage.hpp @@ -1,11 +1,11 @@ #pragma once -#include "widgets/helper/EditableModelView.hpp" #include "widgets/settingspages/SettingsPage.hpp" namespace chatterino { class HotkeyModel; +class EditableModelView; class KeyboardSettingsPage : public SettingsPage { diff --git a/src/widgets/settingspages/ModerationPage.cpp b/src/widgets/settingspages/ModerationPage.cpp index 074c7105f91..64b340d0de0 100644 --- a/src/widgets/settingspages/ModerationPage.cpp +++ b/src/widgets/settingspages/ModerationPage.cpp @@ -1,25 +1,22 @@ #include "ModerationPage.hpp" #include "Application.hpp" +#include "controllers/moderationactions/ModerationAction.hpp" #include "controllers/moderationactions/ModerationActionModel.hpp" #include "singletons/Logging.hpp" #include "singletons/Paths.hpp" +#include "singletons/Settings.hpp" #include "util/Helpers.hpp" #include "util/LayoutCreator.hpp" #include "widgets/helper/EditableModelView.hpp" #include -#include -#include #include #include #include -#include #include #include #include -#include -#include namespace chatterino { diff --git a/src/widgets/settingspages/NicknamesPage.cpp b/src/widgets/settingspages/NicknamesPage.cpp index 277007f64a9..e8fcf56feeb 100644 --- a/src/widgets/settingspages/NicknamesPage.cpp +++ b/src/widgets/settingspages/NicknamesPage.cpp @@ -1,11 +1,11 @@ #include "NicknamesPage.hpp" +#include "controllers/nicknames/Nickname.hpp" #include "controllers/nicknames/NicknamesModel.hpp" #include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" #include "util/LayoutCreator.hpp" #include "widgets/helper/EditableModelView.hpp" -#include "widgets/Window.hpp" #include #include diff --git a/src/widgets/settingspages/NicknamesPage.hpp b/src/widgets/settingspages/NicknamesPage.hpp index 59b2f710244..a3cf9e64152 100644 --- a/src/widgets/settingspages/NicknamesPage.hpp +++ b/src/widgets/settingspages/NicknamesPage.hpp @@ -1,12 +1,7 @@ #pragma once -#include "widgets/helper/EditableModelView.hpp" #include "widgets/settingspages/SettingsPage.hpp" -#include - -class QVBoxLayout; - namespace chatterino { class NicknamesPage : public SettingsPage diff --git a/src/widgets/settingspages/NotificationPage.hpp b/src/widgets/settingspages/NotificationPage.hpp index 7b175902052..3d60e3f48fe 100644 --- a/src/widgets/settingspages/NotificationPage.hpp +++ b/src/widgets/settingspages/NotificationPage.hpp @@ -2,10 +2,7 @@ #include "widgets/settingspages/SettingsPage.hpp" -class QPushButton; -class QListWidget; - -class QVBoxLayout; +class QComboBox; namespace chatterino { diff --git a/src/widgets/settingspages/SettingsPage.cpp b/src/widgets/settingspages/SettingsPage.cpp index 02b7157d036..bedb52067d3 100644 --- a/src/widgets/settingspages/SettingsPage.cpp +++ b/src/widgets/settingspages/SettingsPage.cpp @@ -2,10 +2,10 @@ #include "Application.hpp" #include "singletons/WindowManager.hpp" +#include "util/FunctionEventFilter.hpp" +#include "util/RapidJsonSerializeQString.hpp" #include -#include -#include namespace chatterino { diff --git a/src/widgets/settingspages/SettingsPage.hpp b/src/widgets/settingspages/SettingsPage.hpp index ed66c1fb2da..245f482cec4 100644 --- a/src/widgets/settingspages/SettingsPage.hpp +++ b/src/widgets/settingspages/SettingsPage.hpp @@ -1,7 +1,6 @@ #pragma once -#include "singletons/Settings.hpp" - +#include #include #include #include diff --git a/src/widgets/splits/ClosedSplits.hpp b/src/widgets/splits/ClosedSplits.hpp index de692a6701a..d93d4f7b165 100644 --- a/src/widgets/splits/ClosedSplits.hpp +++ b/src/widgets/splits/ClosedSplits.hpp @@ -1,8 +1,6 @@ #pragma once -#include "common/Channel.hpp" -#include "widgets/helper/NotebookTab.hpp" - +#include #include #include @@ -11,6 +9,8 @@ namespace chatterino { +class NotebookTab; + class ClosedSplits { public: diff --git a/src/widgets/splits/InputCompletionItem.cpp b/src/widgets/splits/InputCompletionItem.cpp index 99994b60584..49b7ada97c2 100644 --- a/src/widgets/splits/InputCompletionItem.cpp +++ b/src/widgets/splits/InputCompletionItem.cpp @@ -1,4 +1,7 @@ -#include "InputCompletionItem.hpp" +#include "widgets/splits/InputCompletionItem.hpp" + +#include "messages/Emote.hpp" +#include "messages/Image.hpp" namespace chatterino { diff --git a/src/widgets/splits/InputCompletionItem.hpp b/src/widgets/splits/InputCompletionItem.hpp index 30707463ab8..19af4131623 100644 --- a/src/widgets/splits/InputCompletionItem.hpp +++ b/src/widgets/splits/InputCompletionItem.hpp @@ -1,12 +1,14 @@ #pragma once -#include "messages/Emote.hpp" #include "widgets/listview/GenericListItem.hpp" #include namespace chatterino { +struct Emote; +using EmotePtr = std::shared_ptr; + class InputCompletionItem : public GenericListItem { using ActionCallback = std::function; diff --git a/src/widgets/splits/InputCompletionPopup.hpp b/src/widgets/splits/InputCompletionPopup.hpp index 38eec2256fd..a267336936f 100644 --- a/src/widgets/splits/InputCompletionPopup.hpp +++ b/src/widgets/splits/InputCompletionPopup.hpp @@ -1,6 +1,5 @@ #pragma once -#include "common/Channel.hpp" #include "widgets/BasePopup.hpp" #include "widgets/listview/GenericListModel.hpp" @@ -8,6 +7,9 @@ namespace chatterino { +class Channel; +using ChannelPtr = std::shared_ptr; + class GenericListView; class InputCompletionPopup : public BasePopup diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index b4454ba3002..a55c2571db3 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -2,15 +2,14 @@ #include "Application.hpp" #include "common/Common.hpp" -#include "common/Env.hpp" #include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/commands/CommandController.hpp" #include "controllers/hotkeys/HotkeyController.hpp" #include "controllers/notifications/NotificationController.hpp" #include "messages/MessageThread.hpp" -#include "providers/twitch/EmoteValue.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index 51543234351..20993004578 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -3,10 +3,10 @@ #include "common/Aliases.hpp" #include "common/Channel.hpp" #include "common/NullablePtr.hpp" -#include "pajlada/signals/signalholder.hpp" #include "widgets/BaseWidget.hpp" #include +#include #include #include #include diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index 65dde68a366..2fdc5d0cb15 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -3,6 +3,7 @@ #include "Application.hpp" #include "common/Common.hpp" #include "common/QLogging.hpp" +#include "common/WindowDescriptors.hpp" #include "debug/AssertInGuiThread.hpp" #include "singletons/Fonts.hpp" #include "singletons/Theme.hpp" @@ -15,7 +16,6 @@ #include "widgets/splits/Split.hpp" #include "widgets/Window.hpp" -#include #include #include #include diff --git a/src/widgets/splits/SplitContainer.hpp b/src/widgets/splits/SplitContainer.hpp index 2a37c890707..7e4d752f819 100644 --- a/src/widgets/splits/SplitContainer.hpp +++ b/src/widgets/splits/SplitContainer.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include class QJsonObject; diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index bf774fa9cec..b752c037085 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -1,6 +1,9 @@ #include "widgets/splits/SplitHeader.hpp" #include "Application.hpp" +#include "common/NetworkCommon.hpp" +#include "common/NetworkRequest.hpp" +#include "common/NetworkResult.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/commands/CommandController.hpp" #include "controllers/hotkeys/Hotkey.hpp" @@ -15,7 +18,6 @@ #include "singletons/Theme.hpp" #include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" -#include "util/LayoutCreator.hpp" #include "util/LayoutHelper.hpp" #include "util/StreamerMode.hpp" #include "widgets/dialogs/SettingsDialog.hpp" diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index a9ef07174c2..fa631fae9ea 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -5,6 +5,8 @@ #include "controllers/commands/CommandController.hpp" #include "controllers/hotkeys/HotkeyController.hpp" #include "messages/Link.hpp" +#include "messages/Message.hpp" +#include "messages/MessageThread.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchCommon.hpp" #include "providers/twitch/TwitchIrcServer.hpp" @@ -22,7 +24,6 @@ #include "widgets/splits/InputCompletionPopup.hpp" #include "widgets/splits/Split.hpp" #include "widgets/splits/SplitContainer.hpp" -#include "widgets/splits/SplitInput.hpp" #include #include diff --git a/src/widgets/splits/SplitInput.hpp b/src/widgets/splits/SplitInput.hpp index 865cf401290..a0ec5eb5265 100644 --- a/src/widgets/splits/SplitInput.hpp +++ b/src/widgets/splits/SplitInput.hpp @@ -2,7 +2,6 @@ #include "util/QObjectRef.hpp" #include "widgets/BaseWidget.hpp" -#include "widgets/dialogs/EmotePopup.hpp" #include #include diff --git a/src/widgets/splits/SplitOverlay.hpp b/src/widgets/splits/SplitOverlay.hpp index 66a3669e984..caaf076542f 100644 --- a/src/widgets/splits/SplitOverlay.hpp +++ b/src/widgets/splits/SplitOverlay.hpp @@ -1,8 +1,8 @@ #pragma once -#include "pajlada/signals/signalholder.hpp" #include "widgets/BaseWidget.hpp" +#include #include #include diff --git a/tests/src/ChannelChatters.cpp b/tests/src/ChannelChatters.cpp index e0006a205cc..328c50e6c71 100644 --- a/tests/src/ChannelChatters.cpp +++ b/tests/src/ChannelChatters.cpp @@ -1,5 +1,7 @@ #include "common/ChannelChatters.hpp" +#include "common/Channel.hpp" + #include #include #include diff --git a/tests/src/HighlightController.cpp b/tests/src/HighlightController.cpp index 6db834d1826..c712709d6d5 100644 --- a/tests/src/HighlightController.cpp +++ b/tests/src/HighlightController.cpp @@ -2,10 +2,13 @@ #include "Application.hpp" #include "BaseSettings.hpp" +#include "controllers/accounts/AccountController.hpp" #include "messages/MessageBuilder.hpp" // for MessageParseArgs #include "mocks/UserData.hpp" #include "providers/twitch/api/Helix.hpp" #include "providers/twitch/TwitchBadge.hpp" // for Badge +#include "singletons/Paths.hpp" +#include "singletons/Settings.hpp" #include #include diff --git a/tests/src/SeventvEventAPI.cpp b/tests/src/SeventvEventAPI.cpp index 6df942104d0..bdde3207a31 100644 --- a/tests/src/SeventvEventAPI.cpp +++ b/tests/src/SeventvEventAPI.cpp @@ -1,5 +1,9 @@ #include "providers/seventv/SeventvEventAPI.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIClient.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIDispatch.hpp" +#include "providers/seventv/eventapi/SeventvEventAPIMessage.hpp" + #include #include #include diff --git a/tests/src/TwitchPubSubClient.cpp b/tests/src/TwitchPubSubClient.cpp index d3f05cc528e..86739fc4ad1 100644 --- a/tests/src/TwitchPubSubClient.cpp +++ b/tests/src/TwitchPubSubClient.cpp @@ -1,7 +1,13 @@ #include "providers/twitch/PubSubActions.hpp" +#include "providers/twitch/PubSubClient.hpp" #include "providers/twitch/PubSubManager.hpp" +#include "providers/twitch/pubsubmessages/AutoMod.hpp" +#include "providers/twitch/pubsubmessages/Whisper.hpp" #include +#include + +#include using namespace chatterino; using namespace std::chrono_literals;