Merge branch '5.4' into 5.5
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / files / lib / data / conversation / message / ConversationMessageAction.class.php
index 75c6b366e165df7da630b7fd10a751983c61314e..1f7c1078f4faa7bfda04074aede5cfa6aa100dc9 100644 (file)
@@ -25,7 +25,6 @@ use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\system\message\QuickReplyManager;
 use wcf\system\message\quote\MessageQuoteManager;
 use wcf\system\moderation\queue\ModerationQueueManager;
-use wcf\system\request\LinkHandler;
 use wcf\system\search\SearchIndexManager;
 use wcf\system\user\notification\object\ConversationMessageUserNotificationObject;
 use wcf\system\user\notification\UserNotificationHandler;
@@ -328,71 +327,6 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
         return $returnValues;
     }
 
-    /**
-     * @inheritDoc
-     */
-    public function validateJumpToExtended()
-    {
-        $this->readInteger('containerID');
-        $this->readString('message', true);
-        $this->readString('tmpHash', true);
-
-        $this->conversation = new Conversation($this->parameters['containerID']);
-        if (!$this->conversation->conversationID) {
-            throw new UserInputException('containerID');
-        } elseif (
-            $this->conversation->isClosed
-            || !Conversation::isParticipant([$this->conversation->conversationID])
-        ) {
-            throw new PermissionDeniedException();
-        }
-
-        // editing existing message
-        if (isset($this->parameters['messageID'])) {
-            $this->message = new ConversationMessage(\intval($this->parameters['messageID']));
-            if (!$this->message->messageID || ($this->message->conversationID != $this->conversation->conversationID)) {
-                throw new UserInputException('messageID');
-            }
-
-            if (!$this->message->canEdit()) {
-                throw new PermissionDeniedException();
-            }
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function jumpToExtended()
-    {
-        // quick reply
-        if ($this->message === null) {
-            QuickReplyManager::getInstance()
-                ->setMessage('conversation', $this->conversation->conversationID, $this->parameters['message']);
-            $url = LinkHandler::getInstance()->getLink(
-                'ConversationMessageAdd',
-                ['id' => $this->conversation->conversationID]
-            );
-        } else {
-            // editing message
-            QuickReplyManager::getInstance()
-                ->setMessage('conversationMessage', $this->message->messageID, $this->parameters['message']);
-            $url = LinkHandler::getInstance()->getLink(
-                'ConversationMessageEdit',
-                ['id' => $this->message->messageID]
-            );
-        }
-
-        if (!empty($this->parameters['tmpHash'])) {
-            QuickReplyManager::getInstance()->setTmpHash($this->parameters['tmpHash']);
-        }
-
-        // redirect
-        return [
-            'url' => $url,
-        ];
-    }
-
     /**
      * @inheritDoc
      */
@@ -587,18 +521,15 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
             );
         }
 
-        // search for censored words
-        if (ENABLE_CENSORSHIP) {
-            $result = Censorship::getInstance()->test($message);
-            if ($result) {
-                throw new UserInputException(
-                    'message',
-                    WCF::getLanguage()->getDynamicVariable(
-                        'wcf.message.error.censoredWordsFound',
-                        ['censoredWords' => $result]
-                    )
-                );
-            }
+        $censoredWords = Censorship::getInstance()->test($message);
+        if ($censoredWords) {
+            throw new UserInputException(
+                'message',
+                WCF::getLanguage()->getDynamicVariable(
+                    'wcf.message.error.censoredWordsFound',
+                    ['censoredWords' => $censoredWords]
+                )
+            );
         }
     }