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;
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
*/
);
}
- // 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]
+ )
+ );
}
}