Merge branch '3.0' into 3.1
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / files / lib / system / worker / ConversationRebuildDataWorker.class.php
index 3e02f4d95967f08d246741d9a6c81a6e59978408..769efbcaddf26c27f1861772086a6aae771e9982 100644 (file)
@@ -91,8 +91,9 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                $sql = "SELECT  COUNT(*) AS participants
                        FROM    wcf".WCF_N."_conversation_to_user
                        WHERE   conversationID = ?
+                               AND hideConversation <> ?
                                AND participantID IS NOT NULL";
-               $existingParticipantStatement = WCF::getDB()->prepareStatement($sql, 5);
+               $existingParticipantStatement = WCF::getDB()->prepareStatement($sql);
                
                $obsoleteConversations = [];
                $updateData = [];
@@ -104,7 +105,7 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                                if (!$conversation->userID) $obsolete = true;
                        }
                        else {
-                               $existingParticipantStatement->execute([$conversation->conversationID]);
+                               $existingParticipantStatement->execute([$conversation->conversationID, Conversation::STATE_LEFT]);
                                $row = $existingParticipantStatement->fetchSingleRow();
                                if (!$row['participants']) $obsolete = true;
                        }