mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #1045 from TranRed/patch-3
Added {message} parameter for moderation buttons
This commit is contained in:
commit
8aa2d42ca9
|
@ -48,6 +48,7 @@ struct Message : boost::noncopyable {
|
|||
QTime parseTime;
|
||||
QString id;
|
||||
QString searchText;
|
||||
QString messageText;
|
||||
QString loginName;
|
||||
QString displayName;
|
||||
QString localizedName;
|
||||
|
|
|
@ -97,6 +97,7 @@ MessageBuilder::MessageBuilder(const QString &text)
|
|||
this->emplace<TimestampElement>();
|
||||
this->emplace<TextElement>(text, MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
this->message().messageText = text;
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
|
@ -108,6 +109,7 @@ MessageBuilder::MessageBuilder(SystemMessageTag, const QString &text)
|
|||
MessageColor::System);
|
||||
this->message().flags.set(MessageFlag::System);
|
||||
this->message().flags.set(MessageFlag::DoNotTriggerNotification);
|
||||
this->message().messageText = text;
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
|
@ -158,6 +160,7 @@ MessageBuilder::MessageBuilder(TimeoutMessageTag, const QString &username,
|
|||
this->emplace<TimestampElement>();
|
||||
this->emplace<TextElement>(text, MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
this->message().messageText = text;
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
|
@ -214,6 +217,7 @@ MessageBuilder::MessageBuilder(const BanAction &action, uint32_t count)
|
|||
|
||||
this->emplace<TextElement>(text, MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
this->message().messageText = text;
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
|
@ -243,6 +247,7 @@ MessageBuilder::MessageBuilder(const UnbanAction &action)
|
|||
|
||||
this->emplace<TextElement>(text, MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
this->message().messageText = text;
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
|
|
|
@ -438,6 +438,7 @@ MessagePtr TwitchMessageBuilder::build()
|
|||
|
||||
this->addWords(splits, twitchEmotes);
|
||||
|
||||
this->message().messageText = this->originalMessage_;
|
||||
this->message().searchText = this->userName + ": " + this->originalMessage_;
|
||||
|
||||
return this->release();
|
||||
|
|
|
@ -1667,9 +1667,12 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
|
|||
case Link::UserAction:
|
||||
{
|
||||
QString value = link.value;
|
||||
|
||||
value.replace("{user}", layout->getMessage()->loginName)
|
||||
.replace("{channel}", this->channel_->getName())
|
||||
.replace("{msg-id}", layout->getMessage()->id);
|
||||
.replace("{msg-id}", layout->getMessage()->id)
|
||||
.replace("{message}", layout->getMessage()->messageText);
|
||||
|
||||
this->channel_->sendMessage(value);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue