-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extra context to messages that are added to channels, allowing the logging controller to take more responsibility in what messages to log #5499
Conversation
This can be used by the logger to check if it should be logged or not
a55a6e4
to
684e93e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Confirm that inline whispers are reposts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -28,6 +28,14 @@ enum class TimeoutStackStyle : int { | |||
Default = DontStackBeyondUserMessage, | |||
}; | |||
|
|||
/// Context of the message being added to a channel | |||
enum class MessageContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: enum 'MessageContext' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class MessageContext {
^
|
||
if (getSettings()->inlineWhispers && | ||
!(getSettings()->streamerModeSuppressInlineWhispers && | ||
getIApp()->getStreamerMode()->isEnabled())) | ||
{ | ||
app->getTwitchAbstract()->forEachChannel( | ||
[&messagexD, overrideFlags](ChannelPtr _channel) { | ||
_channel->addMessage(messagexD, overrideFlags); | ||
[&messagexD](ChannelPtr _channel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter '_channel' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
[&messagexD](ChannelPtr _channel) { | |
[&messagexD](const ChannelPtr& _channel) { |
I have removed the
DoNotLog
flags fromUserInfoPopup
on purpose since all messages added from it are "reposts", i.e. messages that wouldn't be logged anywayCurrently it's the logger that checks whether or not to log reposts - this should just be moved to Channel's addMessage function insteadFixes #5470