Suppress the `removeParticipant` modification log message for invisible participants
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 26 Sep 2023 07:52:32 +0000 (09:52 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 26 Sep 2023 09:38:37 +0000 (11:38 +0200)
These cannot efficiently be filtered after-the-fact, thus we suppress them
entirely.

For the same reason this fix will not affect existing conversations with the
issue.

files/lib/data/conversation/ConversationAction.class.php

index 742491ef03d93e68f03b3854a6a54aad6d2b5b5e..da8ed8b18581501e11b03a89df3edf1248332303 100644 (file)
@@ -1084,8 +1084,15 @@ class ConversationAction extends AbstractDatabaseObjectAction implements
         $this->conversation->removeParticipant($this->parameters['userID']);
         $this->conversation->updateParticipantSummary();
 
-        ConversationModificationLogHandler::getInstance()
-            ->removeParticipant($this->conversation->getDecoratedObject(), $this->parameters['userID']);
+        $userConversation = Conversation::getUserConversation(
+            $this->conversation->conversationID,
+            $this->parameters['userID']
+        );
+
+        if (!$userConversation->isInvisible) {
+            ConversationModificationLogHandler::getInstance()
+                ->removeParticipant($this->conversation->getDecoratedObject(), $this->parameters['userID']);
+        }
 
         // reset storage
         UserStorageHandler::getInstance()->reset([$this->parameters['userID']], 'unreadConversationCount');