Fix users with @room in the name pinging the whole room when replied to
This commit is contained in:
parent
f099ec63d1
commit
42b53817e0
@ -375,6 +375,11 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow
|
|||||||
} else if (!room->reply().isEmpty()) {
|
} else if (!room->reply().isEmpty()) {
|
||||||
auto related = room->relatedInfo(room->reply());
|
auto related = room->relatedInfo(room->reply());
|
||||||
|
|
||||||
|
// Skip reply fallbacks to users who would cause a room ping with the fallback.
|
||||||
|
// This should be fine, since in some cases the reply fallback can be omitted now and the
|
||||||
|
// alternative is worse! On Element Android this applies to any substring, but that is their
|
||||||
|
// bug to fix.
|
||||||
|
if (!related.quoted_user.startsWith("@room:")) {
|
||||||
QString body;
|
QString body;
|
||||||
bool firstLine = true;
|
bool firstLine = true;
|
||||||
auto lines = related.quoted_body.splitRef(u'\n');
|
auto lines = related.quoted_body.splitRef(u'\n');
|
||||||
@ -400,6 +405,7 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow
|
|||||||
else
|
else
|
||||||
text.formatted_body =
|
text.formatted_body =
|
||||||
utils::getFormattedQuoteBody(related, msg.toHtmlEscaped()).toStdString();
|
utils::getFormattedQuoteBody(related, msg.toHtmlEscaped()).toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
text.relations.relations.push_back(
|
text.relations.relations.push_back(
|
||||||
{mtx::common::RelationType::InReplyTo, related.related_event});
|
{mtx::common::RelationType::InReplyTo, related.related_event});
|
||||||
|
Loading…
Reference in New Issue
Block a user