Stop whispers from showing up in /mentions unless they match another highlight (#4389)
This commit is contained in:
@@ -149,6 +149,7 @@
|
|||||||
- Bugfix: Fixed crash happening when QuickSwitcher is used with a popout window. (#4187)
|
- Bugfix: Fixed crash happening when QuickSwitcher is used with a popout window. (#4187)
|
||||||
- Bugfix: Fixed low contrast of text in settings tooltips. (#4188)
|
- Bugfix: Fixed low contrast of text in settings tooltips. (#4188)
|
||||||
- Bugfix: Fixed being unable to see the usercard of VIPs who have Asian language display names. (#4174)
|
- Bugfix: Fixed being unable to see the usercard of VIPs who have Asian language display names. (#4174)
|
||||||
|
- Bugfix: Fixed whispers always being shown in the /mentions split. (#4389)
|
||||||
- Bugfix: Fixed messages where Right-to-Left order is mixed in multiple lines. (#4173)
|
- Bugfix: Fixed messages where Right-to-Left order is mixed in multiple lines. (#4173)
|
||||||
- Bugfix: Fixed the wrong right-click menu showing in the chat input box. (#4177)
|
- Bugfix: Fixed the wrong right-click menu showing in the chat input box. (#4177)
|
||||||
- Bugfix: Fixed popup windows not appearing/minimizing correctly on the Windows taskbar. (#4181)
|
- Bugfix: Fixed popup windows not appearing/minimizing correctly on the Windows taskbar. (#4181)
|
||||||
|
|||||||
@@ -810,7 +810,7 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
|||||||
|
|
||||||
getApp()->twitch->lastUserThatWhisperedMe.set(builder.userName);
|
getApp()->twitch->lastUserThatWhisperedMe.set(builder.userName);
|
||||||
|
|
||||||
if (_message->flags.has(MessageFlag::Highlighted))
|
if (_message->flags.has(MessageFlag::ShowInMentions))
|
||||||
{
|
{
|
||||||
getApp()->twitch->mentionsChannel->addMessage(_message);
|
getApp()->twitch->mentionsChannel->addMessage(_message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
#include "BaseSettings.hpp"
|
#include "BaseSettings.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
|
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||||
#include "messages/MessageBuilder.hpp" // for MessageParseArgs
|
#include "messages/MessageBuilder.hpp" // for MessageParseArgs
|
||||||
#include "mocks/UserData.hpp"
|
#include "mocks/UserData.hpp"
|
||||||
#include "providers/twitch/api/Helix.hpp"
|
#include "providers/twitch/api/Helix.hpp"
|
||||||
@@ -774,6 +775,56 @@ TEST_F(HighlightControllerTest, A)
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// TEST CASE: Whispers that do not hit a highlight phrase should not be added to /mentions
|
||||||
|
{
|
||||||
|
// input
|
||||||
|
.args =
|
||||||
|
MessageParseArgs{
|
||||||
|
.isReceivedWhisper = true,
|
||||||
|
},
|
||||||
|
.senderName = "forsen",
|
||||||
|
.originalMessage = "Hello NymN!",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// expected
|
||||||
|
.state = true, // state
|
||||||
|
.result =
|
||||||
|
{
|
||||||
|
false, // alert
|
||||||
|
false, // playsound
|
||||||
|
boost::none, // custom sound url
|
||||||
|
std::make_shared<QColor>(
|
||||||
|
HighlightPhrase::
|
||||||
|
FALLBACK_HIGHLIGHT_COLOR), // color
|
||||||
|
false, // showInMentions
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// TEST CASE: Whispers that do hit a highlight phrase should be added to /mentions
|
||||||
|
{
|
||||||
|
// input
|
||||||
|
.args =
|
||||||
|
MessageParseArgs{
|
||||||
|
.isReceivedWhisper = true,
|
||||||
|
},
|
||||||
|
.senderName = "forsen",
|
||||||
|
.originalMessage = "!testmanxd",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// expected
|
||||||
|
.state = true, // state
|
||||||
|
.result =
|
||||||
|
{
|
||||||
|
true, // alert
|
||||||
|
true, // playsound
|
||||||
|
boost::none, // custom sound url
|
||||||
|
std::make_shared<QColor>("#7f7f3f49"), // color
|
||||||
|
true, // showInMentions
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto &[input, expected] : tests)
|
for (const auto &[input, expected] : tests)
|
||||||
|
|||||||
Reference in New Issue
Block a user