fix: retain text from input when replying (#3989)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -978,9 +978,13 @@ void SplitInput::setReply(std::shared_ptr<MessageThread> reply,
|
||||
if (this->enableInlineReplying_)
|
||||
{
|
||||
// Only enable reply label if inline replying
|
||||
this->ui_.textEdit->setPlainText(
|
||||
"@" + this->replyThread_->root()->displayName + " ");
|
||||
this->ui_.textEdit->moveCursor(QTextCursor::EndOfBlock);
|
||||
auto replyPrefix = "@" + this->replyThread_->root()->displayName + " ";
|
||||
auto plainText = this->ui_.textEdit->toPlainText().trimmed();
|
||||
if (!plainText.startsWith(replyPrefix))
|
||||
{
|
||||
this->ui_.textEdit->setPlainText(replyPrefix + plainText + " ");
|
||||
this->ui_.textEdit->moveCursor(QTextCursor::EndOfBlock);
|
||||
}
|
||||
this->ui_.replyLabel->setText("Replying to @" +
|
||||
this->replyThread_->root()->displayName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user