Implement MSC4142, mention via replies

This commit is contained in:
Nicolas Werner 2024-05-09 23:27:41 +02:00
parent 7d9e3039fc
commit cf373c016a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -504,6 +504,16 @@ InputBar::generateMentions()
for (const auto &m : mentions_)
if (m != u"@room")
userMentions.push_back(m.toStdString());
if (!room->reply().isEmpty()) {
auto replyToSender =
room->dataById(room->reply(), TimelineModel::Roles::UserId, "").toString().toStdString();
if (!replyToSender.empty() &&
std::ranges::find(userMentions, replyToSender) == userMentions.end()) {
userMentions.push_back(replyToSender);
}
}
auto mention = mtx::common::Mentions{
.user_ids = userMentions,
.room = containsAtRoom_,