mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-12-04 08:08:49 +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_)
|
for (const auto &m : mentions_)
|
||||||
if (m != u"@room")
|
if (m != u"@room")
|
||||||
userMentions.push_back(m.toStdString());
|
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{
|
auto mention = mtx::common::Mentions{
|
||||||
.user_ids = userMentions,
|
.user_ids = userMentions,
|
||||||
.room = containsAtRoom_,
|
.room = containsAtRoom_,
|
||||||
|
|
Loading…
Reference in a new issue