Add {channel} replacement

This commit is contained in:
Ruben Anders 2019-04-11 12:00:57 +02:00
parent a2fa1bad6b
commit 00d4fbf9ed
2 changed files with 2 additions and 2 deletions

View file

@ -1667,7 +1667,7 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
case Link::UserAction: case Link::UserAction:
{ {
QString value = link.value; QString value = link.value;
value.replace("{user}", layout->getMessage()->loginName); value.replace("{user}", layout->getMessage()->loginName).replace("{channel}", this->channel_->getName());
this->channel_->sendMessage(value); this->channel_->sendMessage(value);
} }
break; break;

View file

@ -161,7 +161,7 @@ ModerationPage::ModerationPage()
// clang-format off // clang-format off
auto label = modMode.emplace<QLabel>( auto label = modMode.emplace<QLabel>(
"Moderation mode is enabled by clicking <img width='18' height='18' src=':/buttons/modModeDisabled.png'> in a channel that you moderate.<br><br>" "Moderation mode is enabled by clicking <img width='18' height='18' src=':/buttons/modModeDisabled.png'> in a channel that you moderate.<br><br>"
"Moderation buttons can be bound to chat commands such as \"/ban {user}\", \"/timeout {user} 1000\" or any other custom text commands.<br>"); "Moderation buttons can be bound to chat commands such as \"/ban {user}\", \"/timeout {user} 1000\", \"/w someusername !report {user} was bad in channel {channel}\" or any other custom text commands.<br>");
label->setWordWrap(true); label->setWordWrap(true);
label->setStyleSheet("color: #bbb"); label->setStyleSheet("color: #bbb");
// clang-format on // clang-format on