-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split log line generation from message search text #4742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still generates duplicate usernames in logs Without this PR:
With this PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected
After this PR:
[13:49:58] pajlada: asd << without nickname
[13:50:00] 테스트계정420 testaccount_420: xd
[13:50:18] pajlada: xddddd << with nickname
@Mm2PL has mentioned that this will make a change in how usernames are logged; the previous way was to have two spaces if no localized username was found, this PR changes this with my additional commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
if ((message->flags.has(MessageFlag::ReplyMessage) && | ||
getSettings()->stripReplyMention) && | ||
!getSettings()->hideReplyContext) | ||
{ | ||
qsizetype colonIndex = messageSearchText.indexOf(':'); | ||
qsizetype colonIndex = messageText.indexOf(':'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'colonIndex' of type 'qsizetype' (aka 'long long') can be declared 'const' [misc-const-correctness]
qsizetype colonIndex = messageText.indexOf(':'); | |
qsizetype const colonIndex = messageText.indexOf(':'); |
if (colonIndex != -1) | ||
{ | ||
QString rootMessageChatter = | ||
message->replyThread->root()->loginName; | ||
messageSearchText.insert(colonIndex + 1, " @" + rootMessageChatter); | ||
messageText.insert(colonIndex + 1, " @" + rootMessageChatter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
messageText.insert(colonIndex + 1, " @" + rootMessageChatter);
^
* 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>
* 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>
Description
Closes #4697
The line string is now generated in logging code and search text isn't used.