mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 09:30:47 +03:00
Implement MSC4142, mention via replies
This commit is contained in:
parent
7d9e3039fc
commit
cf373c016a
1 changed files with 10 additions and 0 deletions
|
@ -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…
Reference in a new issue