Skip to content

Commit

Permalink
Implement MSC4142, mention via replies
Browse files Browse the repository at this point in the history
  • Loading branch information
deepbluev7 committed May 9, 2024
1 parent 7d9e303 commit cf373c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/timeline/InputBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_,
Expand Down

0 comments on commit cf373c0

Please sign in to comment.