diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-09-20 16:17:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 16:17:36 +0300 |
commit | 6d261cd902a1e16666eea0c14b8f67a9ef9973d2 (patch) | |
tree | dae8851530a0a6efbbbd551f17628d0852389c14 /lib/Service | |
parent | 36bfe11b8e60b7f103b97f60d91b33d48002236d (diff) | |
parent | bf6150be9549813459f26a92cfafaa114331cebe (diff) |
Merge pull request #6193 from nextcloud/feature/4623/different-mention-marker-for-all-mentions
Add a flag for the direct mentions
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/ParticipantService.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index c158e45fb..89dd94106 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -878,7 +878,7 @@ class ParticipantService { $this->dispatcher->dispatch(Room::EVENT_AFTER_SESSION_UPDATE_CALL_FLAGS, $event); } - public function markUsersAsMentioned(Room $room, array $userIds, int $messageId): void { + public function markUsersAsMentioned(Room $room, array $userIds, int $messageId, array $usersDirectlyMentioned): void { $query = $this->connection->getQueryBuilder(); $query->update('talk_attendees') ->set('last_mention_message', $query->createNamedParameter($messageId, IQueryBuilder::PARAM_INT)) @@ -886,6 +886,16 @@ class ParticipantService { ->andWhere($query->expr()->eq('actor_type', $query->createNamedParameter(Attendee::ACTOR_USERS))) ->andWhere($query->expr()->in('actor_id', $query->createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY))); $query->execute(); + + if (!empty($usersDirectlyMentioned)) { + $query = $this->connection->getQueryBuilder(); + $query->update('talk_attendees') + ->set('last_mention_direct', $query->createNamedParameter($messageId, IQueryBuilder::PARAM_INT)) + ->where($query->expr()->eq('room_id', $query->createNamedParameter($room->getId(), IQueryBuilder::PARAM_INT))) + ->andWhere($query->expr()->eq('actor_type', $query->createNamedParameter(Attendee::ACTOR_USERS))) + ->andWhere($query->expr()->in('actor_id', $query->createNamedParameter($usersDirectlyMentioned, IQueryBuilder::PARAM_STR_ARRAY))); + $query->execute(); + } } public function resetChatDetails(Room $room): void { @@ -893,6 +903,7 @@ class ParticipantService { $query->update('talk_attendees') ->set('last_read_message', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) ->set('last_mention_message', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) + ->set('last_mention_direct', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) ->where($query->expr()->eq('room_id', $query->createNamedParameter($room->getId(), IQueryBuilder::PARAM_INT))); $query->executeStatement(); } |