mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Split log line generation from message search text (#4742)
* Split log line generation from message search text * changelog * remove empty space at the beginning of usernames * Move changelog entry --------- Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
5727db2029
commit
e13df1f602
2 changed files with 24 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
- Minor: Message input is now focused when clicking on emotes. (#4719)
|
- Minor: Message input is now focused when clicking on emotes. (#4719)
|
||||||
- Minor: Changed viewer list to chatter list to more match Twitch's terminology. (#4732)
|
- Minor: Changed viewer list to chatter list to more match Twitch's terminology. (#4732)
|
||||||
- Minor: Nicknames are now taken into consideration when searching for messages. (#4663)
|
- Minor: Nicknames are now taken into consideration when searching for messages. (#4663, #4742)
|
||||||
- Minor: Add an icon showing when streamer mode is enabled (#4410, #4690)
|
- Minor: Add an icon showing when streamer mode is enabled (#4410, #4690)
|
||||||
- Minor: Added `/shoutout <username>` commands to shoutout specified user. (#4638)
|
- Minor: Added `/shoutout <username>` commands to shoutout specified user. (#4638)
|
||||||
- Minor: Improved editing hotkeys. (#4628)
|
- Minor: Improved editing hotkeys. (#4628)
|
||||||
|
|
|
@ -105,20 +105,39 @@ void LoggingChannel::addMessage(MessagePtr message)
|
||||||
str.append(now.toString("HH:mm:ss"));
|
str.append(now.toString("HH:mm:ss"));
|
||||||
str.append("] ");
|
str.append("] ");
|
||||||
|
|
||||||
QString messageSearchText = message->searchText;
|
QString messageText;
|
||||||
|
if (message->loginName.isEmpty())
|
||||||
|
{
|
||||||
|
// This accounts for any messages not explicitly sent by a user, like
|
||||||
|
// system messages, parts of announcements, subs etc.
|
||||||
|
messageText = message->messageText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (message->localizedName.isEmpty())
|
||||||
|
{
|
||||||
|
messageText = message->loginName + ": " + message->messageText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
messageText = message->localizedName + " " + message->loginName +
|
||||||
|
": " + message->messageText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((message->flags.has(MessageFlag::ReplyMessage) &&
|
if ((message->flags.has(MessageFlag::ReplyMessage) &&
|
||||||
getSettings()->stripReplyMention) &&
|
getSettings()->stripReplyMention) &&
|
||||||
!getSettings()->hideReplyContext)
|
!getSettings()->hideReplyContext)
|
||||||
{
|
{
|
||||||
qsizetype colonIndex = messageSearchText.indexOf(':');
|
qsizetype colonIndex = messageText.indexOf(':');
|
||||||
if (colonIndex != -1)
|
if (colonIndex != -1)
|
||||||
{
|
{
|
||||||
QString rootMessageChatter =
|
QString rootMessageChatter =
|
||||||
message->replyThread->root()->loginName;
|
message->replyThread->root()->loginName;
|
||||||
messageSearchText.insert(colonIndex + 1, " @" + rootMessageChatter);
|
messageText.insert(colonIndex + 1, " @" + rootMessageChatter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
str.append(messageSearchText);
|
str.append(messageText);
|
||||||
str.append(endline);
|
str.append(endline);
|
||||||
|
|
||||||
this->appendLine(str);
|
this->appendLine(str);
|
||||||
|
|
Loading…
Reference in a new issue