Implement MSC4142, mention via replies

pull/1726/head
Nicolas Werner 7 months ago
parent 7d9e3039fc
commit cf373c016a
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 10
      src/timeline/InputBar.cpp

@ -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_,

Loading…
Cancel
Save