Skip to content
Snippets Groups Projects
Verified Commit 8719d59e authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix rainbow replies and add rainbowme

parent 6cf3d97e
No related branches found
No related tags found
No related merge requests found
Pipeline #953 passed
......@@ -306,9 +306,9 @@ 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))
.toStdString();
text.formatted_body = utils::getFormattedQuoteBody(
related, utils::markdownToHtml(msg, rainbowify))
.toStdString();
else
text.formatted_body =
utils::getFormattedQuoteBody(related, msg.toHtmlEscaped()).toStdString();
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment