Include reply mention when logging (#4420)

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Scrub 2023-03-19 08:29:46 -04:00 committed by GitHub
parent 130b23edaf
commit 7b6094909e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -2,6 +2,7 @@
## Unversioned
- Minor: Include normally-stripped mention in replies in logs. (#4420)
- Minor: Added support for FrankerFaceZ animated emotes. (#4434)
- Minor: Added a local backup of the Twitch Badges API in case the request fails. (#4463)
- Bugfix: Fixed an issue where animated emotes would render on top of zero-width emotes. (#4314)

View file

@ -2,6 +2,7 @@
#include "common/QLogging.hpp"
#include "messages/Message.hpp"
#include "messages/MessageThread.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"
@ -104,7 +105,20 @@ void LoggingChannel::addMessage(MessagePtr message)
str.append(now.toString("HH:mm:ss"));
str.append("] ");
str.append(message->searchText);
QString messageSearchText = message->searchText;
if ((message->flags.has(MessageFlag::ReplyMessage) &&
getSettings()->stripReplyMention) &&
!getSettings()->hideReplyContext)
{
qsizetype colonIndex = messageSearchText.indexOf(':');
if (colonIndex != -1)
{
QString rootMessageChatter =
message->replyThread->root()->loginName;
messageSearchText.insert(colonIndex + 1, " @" + rootMessageChatter);
}
}
str.append(messageSearchText);
str.append(endline);
this->appendLine(str);