From 28484add293eac5d0299d991ffaaa9f478c418e1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 15 Nov 2017 17:47:31 +0100 Subject: [PATCH] Remove leave message caused by invisible participants --- files/lib/page/ConversationPage.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/files/lib/page/ConversationPage.class.php b/files/lib/page/ConversationPage.class.php index b23f7e5..84802ad 100644 --- a/files/lib/page/ConversationPage.class.php +++ b/files/lib/page/ConversationPage.class.php @@ -224,9 +224,24 @@ class ConversationPage extends MultipleLinkPage { } $this->objectList->rewind(); + // get invisible participants + $invisibleParticipantIDs = []; + if (WCF::getUser()->userID != $this->conversation->userID) { + foreach ($this->participantList as $participant) { + if ($participant->isInvisible) { + $invisibleParticipantIDs[] = $participant->userID; + } + } + } + // load modification log entries $this->modificationLogList = new ConversationLogModificationLogList($this->conversation->conversationID); $this->modificationLogList->getConditionBuilder()->add("modification_log.time BETWEEN ? AND ?", [$startTime, $endTime]); + + if (!empty($invisibleParticipantIDs)) { + $this->modificationLogList->getConditionBuilder()->add("(modification_log.action <> ? OR modification_log.userID NOT IN (?))", ['leave', $invisibleParticipantIDs]); + } + $this->modificationLogList->readObjects(); } -- 2.20.1