WHERE conversation_to_user.conversationID = conversation.conversationID
AND conversation_to_user.hideConversation <> ?
AND conversation_to_user.participantID <> ?
+ AND conversation_to_user.isInvisible = ?
)
WHERE conversation.conversationID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
Conversation::STATE_LEFT,
$this->userID,
+ 0,
$this->conversationID
));
}
}
}
- // make invisible participant visible
- $sql = "UPDATE wcf".WCF_N."_conversation_to_user
- SET isInvisible = 0
- WHERE participantID = ?
- AND conversationID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array($message->userID, $conversation->conversationID));
+ $userConversation = Conversation::getUserConversation($conversation->conversationID, $message->userID);
+ if ($userConversation !== null && $userConversation->isInvisible) {
+ // make invisible participant visible
+ $sql = "UPDATE wcf".WCF_N."_conversation_to_user
+ SET isInvisible = 0
+ WHERE participantID = ?
+ AND conversationID = ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array($message->userID, $conversation->conversationID));
+
+ $conversationEditor->updateParticipantSummary();
+ $conversationEditor->updateParticipantCount();
+ }
// reset visibility if it was hidden but not left
$sql = "UPDATE wcf".WCF_N."_conversation_to_user