Using constants instead of magic numbers
authorAlexander Ebert <ebert@woltlab.com>
Sat, 9 Mar 2013 22:41:35 +0000 (23:41 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 9 Mar 2013 22:41:35 +0000 (23:41 +0100)
files/lib/data/conversation/Conversation.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php

index fc56a9a71b006c95356bf969764400f169b25829..010a60faffad2d4ae1bf91cac4ba51faefb844bb 100644 (file)
@@ -156,7 +156,7 @@ class Conversation extends DatabaseObject implements IBreadcrumbProvider, IRoute
        public function getParticipantIDs($excludeLeftParticipants = false) {
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("conversationID = ?", array($this->conversationID));
-               if ($excludeLeftParticipants) $conditions->add("hideConversation <> ?", array(2));
+               if ($excludeLeftParticipants) $conditions->add("hideConversation <> ?", array(self::STATE_LEFT));
                
                $sql = "SELECT          participantID
                        FROM            wcf".WCF_N."_conversation_to_user
index acb6efad323bb75171f88c9b8250782a1244b9f3..2f05419a8da5393a3247b1e11e2b5dd9d8316196 100644 (file)
@@ -104,9 +104,9 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                                        AND hideConversation = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute(array(
-                               0,
+                               Conversation::STATE_DEFAULT,
                                $conversation->conversationID,
-                               1
+                               Conversation::STATE_HIDDEN
                        ));
                }