Skip to content

Commit

Permalink
Merge branch 'master' into fix/command-reply-thread-parent
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy authored Nov 3, 2023
2 parents 5798d08 + 4e63a1b commit 4208a31
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 34 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
- Bugfix: Fixed the input completion popup from disappearing when clicking on it on Windows and macOS. (#4876)
- Bugfix: Fixed double-click text selection moving its position with each new message. (#4898)
- Bugfix: Fixed an issue where notifications on Windows would contain no or an old avatar. (#4899)
- Bugfix: Fixed a crash when clicking `More messages below` button in a usercard and closing it quickly. (#4933)
- Bugfix: Fixed `/reply` command showing outdated context when replying to a threaded message. (#4919)
- Dev: Change clang-format from v14 to v16. (#4929)
- Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791)
- Dev: Temporarily disable High DPI scaling on Qt6 builds on Windows. (#4767)
- Dev: Tests now run on Ubuntu 22.04 instead of 20.04 to loosen C++ restrictions in tests. (#4774)
Expand Down
65 changes: 35 additions & 30 deletions src/messages/Message.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#include "messages/Message.hpp"

#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;

namespace chatterino {

Message::Message()
Expand All @@ -26,45 +19,57 @@ Message::~Message()
DebugCount::decrease("messages");
}

SBHighlight Message::getScrollBarHighlight() const
ScrollbarHighlight Message::getScrollBarHighlight() const
{
if (this->flags.has(MessageFlag::Highlighted) ||
this->flags.has(MessageFlag::HighlightedWhisper))
{
return SBHighlight(this->highlightColor);
return {
this->highlightColor,
};
}
else if (this->flags.has(MessageFlag::Subscription) &&
getSettings()->enableSubHighlight)

if (this->flags.has(MessageFlag::Subscription) &&
getSettings()->enableSubHighlight)
{
return SBHighlight(
ColorProvider::instance().color(ColorType::Subscription));
return {
ColorProvider::instance().color(ColorType::Subscription),
};
}
else if (this->flags.has(MessageFlag::RedeemedHighlight) ||
this->flags.has(MessageFlag::RedeemedChannelPointReward))

if (this->flags.has(MessageFlag::RedeemedHighlight) ||
this->flags.has(MessageFlag::RedeemedChannelPointReward))
{
return SBHighlight(
return {
ColorProvider::instance().color(ColorType::RedeemedHighlight),
SBHighlight::Default, true);
ScrollbarHighlight::Default,
true,
};
}
else if (this->flags.has(MessageFlag::ElevatedMessage))

if (this->flags.has(MessageFlag::ElevatedMessage))
{
return SBHighlight(ColorProvider::instance().color(
ColorType::ElevatedMessageHighlight),
SBHighlight::Default, false, false, true);
return {
ColorProvider::instance().color(
ColorType::ElevatedMessageHighlight),
ScrollbarHighlight::Default,
false,
false,
true,
};
}
else if (this->flags.has(MessageFlag::FirstMessage))

if (this->flags.has(MessageFlag::FirstMessage))
{
return SBHighlight(
return {
ColorProvider::instance().color(ColorType::FirstMessageHighlight),
SBHighlight::Default, false, true);
ScrollbarHighlight::Default,
false,
true,
};
}

return SBHighlight();
return {};
}

// Static
namespace {

} // namespace

} // namespace chatterino
4 changes: 2 additions & 2 deletions src/providers/twitch/api/Helix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace {

using namespace chatterino;

static constexpr auto NUM_MODERATORS_TO_FETCH_PER_REQUEST = 100;
constexpr auto NUM_MODERATORS_TO_FETCH_PER_REQUEST = 100;

static constexpr auto NUM_CHATTERS_TO_FETCH = 1000;
constexpr auto NUM_CHATTERS_TO_FETCH = 1000;

} // namespace

Expand Down
1 change: 0 additions & 1 deletion src/widgets/AttachedWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "Application.hpp"
#include "common/QLogging.hpp"
#include "ForwardDecl.hpp"
#include "singletons/Settings.hpp"
#include "util/DebugCount.hpp"
#include "widgets/splits/Split.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/ChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void ChannelView::initializeLayout()

QObject::connect(
this->goToBottom_, &EffectLabel::leftClicked, this, [this] {
QTimer::singleShot(180, [this] {
QTimer::singleShot(180, this, [this] {
this->scrollBar_->scrollToBottom(
getSettings()->enableSmoothScrollingNewMessages.getValue());
});
Expand Down

0 comments on commit 4208a31

Please sign in to comment.