Fix rainbow replies and add rainbowme
This commit is contained in:
parent
6cf3d97ebd
commit
8719d59e22
@ -306,8 +306,8 @@ InputBar::message(QString msg, MarkdownOverride useMarkdown, bool rainbowify)
|
||||
if ((ChatPage::instance()->userSettings()->markdown() &&
|
||||
useMarkdown == MarkdownOverride::NOT_SPECIFIED) ||
|
||||
useMarkdown == MarkdownOverride::ON)
|
||||
text.formatted_body =
|
||||
utils::getFormattedQuoteBody(related, utils::markdownToHtml(msg))
|
||||
text.formatted_body = utils::getFormattedQuoteBody(
|
||||
related, utils::markdownToHtml(msg, rainbowify))
|
||||
.toStdString();
|
||||
else
|
||||
text.formatted_body =
|
||||
@ -321,9 +321,9 @@ InputBar::message(QString msg, MarkdownOverride useMarkdown, bool rainbowify)
|
||||
}
|
||||
|
||||
void
|
||||
InputBar::emote(QString msg)
|
||||
InputBar::emote(QString msg, bool rainbowify)
|
||||
{
|
||||
auto html = utils::markdownToHtml(msg);
|
||||
auto html = utils::markdownToHtml(msg, rainbowify);
|
||||
|
||||
mtx::events::msg::Emote emote;
|
||||
emote.body = msg.trimmed().toStdString();
|
||||
@ -475,7 +475,7 @@ void
|
||||
InputBar::command(QString command, QString args)
|
||||
{
|
||||
if (command == "me") {
|
||||
emote(args);
|
||||
emote(args, false);
|
||||
} else if (command == "react") {
|
||||
auto eventId = room->reply();
|
||||
if (!eventId.isEmpty())
|
||||
@ -529,6 +529,8 @@ InputBar::command(QString command, QString args)
|
||||
message(args, MarkdownOverride::OFF);
|
||||
} else if (command == "rainbow") {
|
||||
message(args, MarkdownOverride::ON, true);
|
||||
} else if (command == "rainbowme") {
|
||||
emote(args, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ signals:
|
||||
void uploadingChanged(bool value);
|
||||
|
||||
private:
|
||||
void emote(QString body);
|
||||
void emote(QString body, bool rainbowify);
|
||||
void command(QString name, QString args);
|
||||
void image(const QString &filename,
|
||||
const std::optional<mtx::crypto::EncryptedFile> &file,
|
||||
|
Loading…
Reference in New Issue
Block a user