use wcf\data\IMessageInlineEditorAction;
use wcf\data\IMessageQuoteAction;
use wcf\data\smiley\SmileyCache;
+use wcf\event\message\MessageSpamChecking;
use wcf\system\attachment\AttachmentHandler;
use wcf\system\bbcode\BBCodeHandler;
use wcf\system\conversation\ConversationHandler;
WCF::getSession()->getPermission('user.message.disallowedBBCodes')
));
QuickReplyManager::getInstance()->validateParameters($this, $this->parameters, Conversation::class);
+
+ if ($this->messageIsProbablySpam()) {
+ throw new PermissionDeniedException();
+ }
}
/**
$this->conversation,
$this->getHtmlInputProcessor($this->parameters['data']['message'], $this->message->messageID)
);
+
+ if ($this->messageIsProbablySpam()) {
+ throw new PermissionDeniedException();
+ }
}
/**
return $this->htmlInputProcessor;
}
+
+ /**
+ * This method triggers the event for the spam check and returns the result.
+ *
+ * @since 6.1
+ */
+ protected function messageIsProbablySpam(): bool
+ {
+ $event = new MessageSpamChecking(
+ $this->htmlInputProcessor,
+ WCF::getUser()->userID ? WCF::getUser() : null,
+ UserUtil::getIpAddress()
+ );
+ EventHandler::getInstance()->fire($event);
+
+ return $event->defaultPrevented();
+ }
}