mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Split parseUsername
into parseUsername
and apendUsername
This commit is contained in:
parent
7ce1458348
commit
3bfaba2d95
2 changed files with 8 additions and 2 deletions
|
@ -38,6 +38,8 @@ SharedMessage TwitchMessageBuilder::parse()
|
|||
|
||||
this->originalMessage = this->ircMessage->content();
|
||||
|
||||
this->parseUsername();
|
||||
|
||||
// The timestamp is always appended to the builder
|
||||
// Whether or not will be rendered is decided/checked later
|
||||
this->appendTimestamp();
|
||||
|
@ -54,7 +56,7 @@ SharedMessage TwitchMessageBuilder::parse()
|
|||
this->parseChannelName();
|
||||
}
|
||||
|
||||
this->parseUsername();
|
||||
this->appendUsername();
|
||||
|
||||
// highlights
|
||||
if (settings.enableHighlights.get()) {
|
||||
|
@ -282,11 +284,14 @@ void TwitchMessageBuilder::parseUsername()
|
|||
if (this->userName.isEmpty()) {
|
||||
this->userName = this->tags.value(QLatin1String("login")).toString();
|
||||
}
|
||||
}
|
||||
|
||||
void TwitchMessageBuilder::appendUsername()
|
||||
{
|
||||
QString username = this->userName;
|
||||
QString localizedName;
|
||||
|
||||
iterator = this->tags.find("display-name");
|
||||
auto iterator = this->tags.find("display-name");
|
||||
if (iterator != this->tags.end()) {
|
||||
QString displayName = iterator.value().toString();
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ private:
|
|||
void parseRoomID();
|
||||
void parseChannelName();
|
||||
void parseUsername();
|
||||
void appendUsername();
|
||||
void parseHighlights();
|
||||
|
||||
void appendModerationButtons();
|
||||
|
|
Loading…
Reference in a new issue