It's now possible to remove invisible recipients from a conversation
authorMarcel Werk <burntime@woltlab.com>
Thu, 28 Mar 2013 12:54:42 +0000 (13:54 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 28 Mar 2013 12:54:42 +0000 (13:54 +0100)
files/lib/data/conversation/ConversationParticipantList.class.php
files/lib/page/ConversationPage.class.php

index 81ed7e7582fd3db7a65fcdfc3a6b892ac0187649..71adef734a558861011ec7dafcc1a74a89b70b66 100644 (file)
@@ -23,16 +23,19 @@ class ConversationParticipantList extends UserProfileList {
         * Creates a new ConversationParticipantList object.
         * 
         * @param       integer         $conversationID
+        * @param       boolean         $isAuthor               true if given user is the author of this conversation
         */
-       public function __construct($conversationID, $userID = 0) {
+       public function __construct($conversationID, $userID = 0, $isAuthor = false) {
                parent::__construct();
                
                $this->getConditionBuilder()->add('conversation_to_user.conversationID = ?', array($conversationID));
-               if ($userID) {
-                       $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0 OR conversation_to_user.participantID = ?', array($userID));
-               }
-               else {
-                       $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0');      
+               if (!$isAuthor) {
+                       if ($userID) {
+                               $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0 OR conversation_to_user.participantID = ?', array($userID));
+                       }
+                       else {
+                               $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0');      
+                       }
                }
                $this->sqlConditionJoins .= " LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = conversation_to_user.participantID)";
                
index 603bc69b3b6608b7cc6885620673b3aece636fe5..a0c6ecb2555e9bc09bfbea4d2aa874de2f9a9f9e 100644 (file)
@@ -178,7 +178,7 @@ class ConversationPage extends MultipleLinkPage {
                }
                
                // get participants
-               $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID);
+               $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID, ($this->conversation->userID == WCF::getUser()->userID));
                $this->participantList->readObjects();
                
                // init quote objects