Fix IRC mentions not showing up in the /mentions split (#3400)

This commit is contained in:
pajlada 2021-12-25 16:22:52 +01:00 committed by GitHub
parent 45e4fc04ef
commit 1662ced2c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -67,6 +67,7 @@
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368)
- Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382)
- Bugfix: Fixed crash that would occur if the user tries to modify the currently connected IRC connection. (#3398)
- Bugfix: Fixed IRC mentions not showing up in the /mentions split. (#3400)
- Bugfix: Fixed a crash that could occur on certain Linux systems when toggling the Always on Top flag. (#3385)
- Bugfix: Fixed zero-width emotes sometimes wrapping lines incorrectly. (#3389)
- Bugfix: Fixed using special chars in Windows username breaking the storage of custom commands (#3397)

View file

@ -8,6 +8,7 @@
#include "providers/irc/Irc2.hpp"
#include "providers/irc/IrcChannel2.hpp"
#include "providers/irc/IrcMessageBuilder.hpp"
#include "providers/twitch/TwitchIrcServer.hpp" // NOTE: Included to access the mentions channel
#include "singletons/Settings.hpp"
#include "util/IrcHelpers.hpp"
#include "util/QObjectRef.hpp"
@ -184,8 +185,18 @@ void IrcServer::privateMessageReceived(Communi::IrcPrivateMessage *message)
if (!builder.isIgnored())
{
channel->addMessage(builder.build());
auto msg = builder.build();
channel->addMessage(msg);
builder.triggerHighlights();
const auto highlighted = msg->flags.has(MessageFlag::Highlighted);
const auto showInMentions =
msg->flags.has(MessageFlag::ShowInMentions);
if (highlighted && showInMentions)
{
getApp()->twitch2->mentionsChannel->addMessage(msg);
}
}
else
{