feat: add sound and flash alert for automod caught messages (#5026)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2023-12-25 17:17:44 -06:00
committed by GitHub
parent 1006bf955a
commit eb12cfa50b
19 changed files with 348 additions and 193 deletions
+7 -6
View File
@@ -1093,12 +1093,13 @@ void ChannelView::messageAppended(MessagePtr &message,
if (!messageFlags->has(MessageFlag::DoNotTriggerNotification))
{
if (messageFlags->has(MessageFlag::Highlighted) &&
messageFlags->has(MessageFlag::ShowInMentions) &&
!messageFlags->has(MessageFlag::Subscription) &&
(getSettings()->highlightMentions ||
this->channel_->getType() != Channel::Type::TwitchMentions))
if ((messageFlags->has(MessageFlag::Highlighted) &&
messageFlags->has(MessageFlag::ShowInMentions) &&
!messageFlags->has(MessageFlag::Subscription) &&
(getSettings()->highlightMentions ||
this->channel_->getType() != Channel::Type::TwitchMentions)) ||
(this->channel_->getType() == Channel::Type::TwitchAutomod &&
getSettings()->enableAutomodHighlight))
{
this->tabHighlightRequested.invoke(HighlightState::Highlighted);
}
@@ -26,6 +26,7 @@ ScrollbarHighlight::ScrollbarHighlight(const std::shared_ptr<QColor> color,
QColor ScrollbarHighlight::getColor() const
{
assert(this->color_);
return *this->color_;
}
@@ -370,21 +370,22 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked,
EditableModelView *view,
HighlightTab tab)
{
if (!clicked.flags().testFlag(Qt::ItemIsEnabled))
{
return;
}
switch (tab)
{
case HighlightTab::Messages:
case HighlightTab::Users: {
using Column = HighlightModel::Column;
bool restrictColorRow =
(tab == HighlightTab::Messages &&
clicked.row() ==
HighlightModel::HighlightRowIndexes::WhisperRow);
if (clicked.column() == Column::SoundPath &&
clicked.flags().testFlag(Qt::ItemIsEnabled))
if (clicked.column() == Column::SoundPath)
{
this->openSoundDialog(clicked, view, Column::SoundPath);
}
else if (clicked.column() == Column::Color && !restrictColorRow)
else if (clicked.column() == Column::Color)
{
this->openColorDialog(clicked, view, tab);
}