diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-05-09 23:27:41 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-05-09 23:42:36 +0200 |
commit | cf373c016ad422d9a338209a45253455eb38a387 (patch) | |
tree | a39ec11e8ed9f22af18fa0679fec76aae99dd269 | |
parent | Merge pull request #1720 from TheDrawingCoder-Gamer/emoji-shortcodes-2 (diff) | |
download | nheko-cf373c016ad422d9a338209a45253455eb38a387.tar.xz |
Implement MSC4142, mention via replies
-rw-r--r-- | src/timeline/InputBar.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 1636bcd1..ac1d47a2 100644 --- a/src/timeline/InputBar.cpp +++ b/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_, |