Add support for intentional mentions

This is still a bit flaky around when to remove a mention, but it should
work in most cases. Might add a toggle in the future to disable these
though.
This commit is contained in:
Nicolas Werner 2024-03-08 18:43:59 +01:00
parent 7ec56d8df5
commit 7c2a152cfb
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
15 changed files with 242 additions and 51 deletions

View file

@ -198,9 +198,10 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QObject *parent)
if (eventInDb) {
if (auto newRules =
std::get_if<mtx::events::AccountDataEvent<mtx::pushrules::GlobalRuleset>>(
&*eventInDb))
&*eventInDb)) {
pushrules =
std::make_unique<mtx::pushrules::PushRuleEvaluator>(newRules->content.global);
}
}
}
if (pushrules) {