From: Alexander Ebert Date: Fri, 3 Jun 2016 23:20:43 +0000 (+0200) Subject: Added additional callback during quick reply X-Git-Tag: 3.0.0_Beta_1~1531 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7fde0b67a5834716d131c70db595cf29837bb6d5;p=GitHub%2FWoltLab%2FWCF.git Added additional callback during quick reply Allows to inject additional data before reading the message list. --- diff --git a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php index bf4c965464..9cc3f4d656 100644 --- a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php +++ b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php @@ -176,9 +176,10 @@ class QuickReplyManager extends SingletonFactory { * @param string $sortOrder * @param string $templateName * @param string $application + * @param callable $callbackCreatedMessage * @return array */ - public function createMessage(IMessageQuickReplyAction $object, array &$parameters, $containerActionClassName, $sortOrder, $templateName, $application = 'wcf') { + public function createMessage(IMessageQuickReplyAction $object, array &$parameters, $containerActionClassName, $sortOrder, $templateName, $application = 'wcf', callable $callbackCreatedMessage = null) { $additionalFields = []; EventHandler::getInstance()->fireAction($this, 'createMessage', $additionalFields); @@ -205,6 +206,10 @@ class QuickReplyManager extends SingletonFactory { $eventParameters = ['message' => $message]; EventHandler::getInstance()->fireAction($this, 'createdMessage', $eventParameters); + if ($callbackCreatedMessage !== null) { + $callbackCreatedMessage($message); + } + if ($message instanceof IMessage && !$message->isVisible()) { return ['isVisible' => false]; }