diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c75671d..b5e6e3a23 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 fa2fdd505..c1bdf2c9a 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 6f6bc995b..edb571f16 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 f70fa29ca..89ce45d06 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 56e0f0aea..eebd4c246 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 3f4f10420..d65ae931b 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 96d4810d1..b15717dc9 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 6dcfccaf7..353b52d7e 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 0c76dc91d..08bddf2e8 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 c41cae9c8..b1f6b6fb5 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 907d22a80..8350f4668 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 3d1140c3f..384c49f31 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 8a9a8f377..8cd5eaf62 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 2692b05a9..0ba3bc959 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 1cf6ae931..a19af9692 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 e5aea0641..2552a00b7 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 ced3b36b3..4ed526645 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 6d698438e..7268d3356 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 f05e6c4ed..fcae24249 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 a3117d3ab..1bee92be2 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 30bf0f5ee..628a60859 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 40387d4ae..ed6872615 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 08932160e..9362de12c 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 { -QString emoteOnly(const CommandContext &ctx); -QString emoteOnlyOff(const CommandContext &ctx); +struct CommandContext; -QString subscribers(const CommandContext &ctx); -QString subscribersOff(const CommandContext &ctx); +namespace commands { -QString slow(const CommandContext &ctx); -QString slowOff(const CommandContext &ctx); + QString emoteOnly(const CommandContext &ctx); + QString emoteOnlyOff(const CommandContext &ctx); -QString followers(const CommandContext &ctx); -QString followersOff(const CommandContext &ctx); + QString subscribers(const CommandContext &ctx); + QString subscribersOff(const CommandContext &ctx); -QString uniqueChat(const CommandContext &ctx); -QString uniqueChatOff(const CommandContext &ctx); + QString slow(const CommandContext &ctx); + QString slowOff(const CommandContext &ctx); -} // namespace chatterino::commands + QString followers(const CommandContext &ctx); + QString followersOff(const CommandContext &ctx); + + QString uniqueChat(const CommandContext &ctx); + QString uniqueChatOff(const CommandContext &ctx); + +} // namespace commands + +} // namespace chatterino diff --git a/src/controllers/filters/FilterModel.cpp b/src/controllers/filters/FilterModel.cpp index 68d91ec4f..5ce793eb6 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 ffa4a1060..14c0fd66b 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 000000000..24bd22f62 --- /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 e18a1d48b..bb6eeeff3 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 000000000..8bd20414c --- /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 687f79964..dd1501664 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(); + FilterSet(const QList &filterIds); - 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); - } + ~FilterSet(); - 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; - } - - return true; - } - - 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 9e71a365b..00c5bd6b7 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 0d8c7a5b2..d6fcd7c9e 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 3e1c10a20..ffca5b289 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 0103dcb2c..cf3b8501c 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 899b59c39..b4452a22b 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 0605fd8da..d1013c3f0 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 0ff68bc0b..8bfc09867 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 d18963ccb..414af461a 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 785eb047d..58eee196e 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 3f4b37e57..7e238d817 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 19f052649..13ff5ec6b 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 98fa78e00..7f20a9c6c 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 4cf9faff0..392f13e28 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 8a6596a74..42aeb819f 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 11edd2c47..fa2811ddc 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 538fc42e1..8d5700ac4 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 f45b98a61..df6639756 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 33fd40643..2089bab5a 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 f23b95373..98c59ca5e 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 0e3e06018..e3df12e47 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 cbecbb4d9..3702a4270 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 9904d7874..915a880bd 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 a7b8519e9..d5f7a301e 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 5c311b669..5ff129fd0 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 @@ public: 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 7f4039f98..de26613c2 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 00c8f6e7a..d6595556d 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 eb62bab92..065e6f417 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 79cb26426..529f5fa0d 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 2028fa3e2..4277b128f 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 7cd034eac..aab622203 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 8fd5ea540..1205e44b5 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 6828c3be2..f6cfce6b8 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 6d4856a8d..8ac0e39bd 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 5cc036ec1..1cc78c2c3 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 2648c3372..d157abbfc 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 @@ public: 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 f7ef40ad9..7c6d13086 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 eae285c8a..6bd20ea37 100644 --- a/src/messages/Image.hpp +++ b/src/messages/Image.hpp @@ -102,6 +102,9 @@ private: 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 1dccf10e9..09294f766 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 4e484eedb..49c94eed0 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 af5417f93..cb005a843 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 baba77e5b..fcecef211 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 12e21f76e..96ab66586 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 3dfc12077..ea76b5918 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 471d1d648..000000000 --- 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 1a0fa9dbe..c428375d3 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 db0557751..5dce1ad9f 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 902e7ede0..d00d092e4 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 d9200d8e7..41bb0d941 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 13ea77c09..86e662e54 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 c84b5d2e3..adc365577 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 2fb25c985..19a2ac8fb 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 555a2b36c..dc3fbafa8 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 510f6e057..f5d4901af 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 2f7f3f3fd..665f96a97 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 a9f189089..663a6c155 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 a592e4015..be400feb7 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 c6419402f..4bda67c8b 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 a74d72ae2..d1e37873f 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 79806bd62..7a6a9a07c 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 04a22f624..02eeec6c8 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 594b985f0..63e68cabd 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 736cb2cc1..36e4b8e87 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 e6b99f11b..1d5f2b858 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 81db09f28..2dc79fc35 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 bb5caba2a..cf24defc8 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 6b19dc928..26b4088e5 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 74d21e116..9aca14543 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 b0d8f5a93..320fe569c 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 9d52ce383..df4e7efd4 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 48c9d7a42..1544b74d2 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 fa25f733e..a65d99f33 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 52fc9b6aa..69340ad99 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 5ceee36c6..000000000 --- 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 d0fa5cc32..000000000 --- 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 91f2d3002..f0ccec3af 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 aad048767..179c55a45 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 342ce45ab..94fb44451 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 3833930ce..1727f0bf3 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 8818ccab9..7407c8603 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 1c6a6b83e..c0cc80c68 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 a7061015c..0cf533e5b 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 63da07964..be0726f04 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 24c663fbd..77f0631ff 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 9de204895..fd6a4612e 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 2d5eebea3..fd1b66851 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 0b20783c3..793e8b9a9 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 84f9ce22c..164cc75f7 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 7fa9652cb..0474bdb76 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 c165dde70..820a89380 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 363bf045e..b79f635bc 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 93a4349e6..a36049390 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 2fb7f4ef5..9bdc51bf6 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 2d6d021a2..182d37b10 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 740b0c890..8f8ee18d6 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 ebcb664f7..023e99555 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 88a843ba3..c4be244dc 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 5f6aad3aa..946e147cb 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 21a3e1347..e1fcf2d02 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 ffd4c766f..f33256d42 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 b8b04f540..f18d07f31 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 28e169ecc..04d429316 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 fad2ed375..f9f9b6316 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 d412a249b..15d6a4898 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 77b5d3700..114831009 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 3899e1337..ee0e40c1a 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 8ad545403..faf01f4c7 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 52a25938e..6bfc67d10 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 4c608d206..ea8138d2d 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 5213f0047..bfb8b98ca 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 64125f494..6b02d3bb2 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 7c8acd32e..4eb90f95a 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 788deae95..2eb0b1910 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 6283765cb..5d371d5a9 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 0c995bd9f..2676aacd5 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 79226f077..3596f570f 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 040534009..02231091f 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 572b2bb13..e93fcc4fc 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 a8b1b0e5b..f76948797 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 df1d782ba..30d62d84a 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 e24e9c781..f1b625509 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 478383b98..7593abd3c 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 0b816f8db..76942e8f2 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 92674ca72..a91f67f40 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 8d53aa9e5..e7288ac5c 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 c5d93e3bf..5b30faad3 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 deff15d3a..1a65a17d0 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 521baefa7..08c00ca39 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 a0b1be3ea..46d3782b0 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 9733dfb14..9c46a08a1 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 f81620914..495fe1d35 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 2f2d0e7f2..1a671085d 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 @@ private: }; } // namespace chatterino - -#ifdef CHATTERINO -# include "singletons/Settings.hpp" -#endif diff --git a/src/singletons/Theme.hpp b/src/singletons/Theme.hpp index 92dd5e830..f99ba169d 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 99740d16b..09fbf8fbc 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 b1a8eb44e..a47a52b5c 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 52c80ec6c..2647cfc43 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 6cac9241c..ba7cc5a4c 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 13f40c06e..78120496c 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 519dcdaf1..9970baaef 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 b1c993ad4..5e5ca77ff 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 6063bd30c..79f7b3794 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 6339d0dae..e830b4505 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 d2b9a4efe..06fc0dd79 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 6b0e32b11..a50969289 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 619bfbe20..801b1a463 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 a4b1b7093..070a2533a 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 6accc87ca..29a4e4743 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 11c96d30b..7cc49cfa6 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 7fb44f49e..cbd6e4e39 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 4e7ee7697..ac89f5bfa 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 84db6d787..7e1c0d2dd 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 4eebac79f..c15e4b16a 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 ceccad7b5..132e6ac0d 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 457d5fd3a..d1bac90cc 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 719238246..e442b4f6d 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 083064409..5d6b5bf35 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 0c4a4f3dd..71a20a0a8 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 83c39b779..fc92da917 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 054e5f685..1b4cb8965 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 493a41f8e..3a4f5a5c0 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 1cf7d75ef..3b31f17ab 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 d07a54802..d30365540 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 27789920b..ad8f873d3 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 48e5eb86b..be7e481ea 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 ed7e33033..de3586870 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 821705666..5e59094d0 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 480261125..64fe1bba3 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 142d25828..4343e42bf 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 d89982cae..6877d79fd 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 afb1e836e..0d5e1b3e3 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 f1fbc5dff..b6ea8af08 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 31e7563c9..37cf1b3b6 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 a7524abf4..0c0f05527 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 e95fcf0ce..d7caab885 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 a6c72bdb6..1c907ad45 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 ae64f2859..0f2fe2175 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 10aea4516..0ae0f08d2 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 58fc02db6..fd24c8422 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 fd971b9e6..1e648f472 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 68db6d8ea..6fb615d93 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 d42620645..1268ff132 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 b6f95e01a..febf9a8ed 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 3ba79516e..3de5a77af 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 70733b953..0d1ab0b25 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 e794eea33..04b5058bf 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 487bf9f72..47a9c3e3a 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 661fbd6fc..c8aefe07f 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 89932fcd5..011be06ac 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 1da25070b..2a7d1dff9 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 074c7105f..64b340d0d 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 277007f64..e8fcf56fe 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 59b2f7102..a3cf9e641 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 7b1759020..3d60e3f48 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 02b7157d0..bedb52067 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 ed66c1fb2..245f482ce 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 de692a670..d93d4f7b1 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 99994b605..49b7ada97 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 30707463a..19af41316 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 38eec2256..a26733693 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 b4454ba30..a55c2571d 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 515432343..209930045 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 65dde68a3..2fdc5d0cb 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 2a37c8907..7e4d752f8 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 bf774fa9c..b752c0370 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 a9ef07174..fa631fae9 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 865cf4012..a0ec5eb52 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 66a3669e9..caaf07654 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 e0006a205..328c50e6c 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 6db834d18..c712709d6 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 6df942104..bdde3207a 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 d3f05cc52..86739fc4a 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;