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