From 007a35800d76583172d7ddf66427caac792707db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 1 Aug 2014 22:52:41 +0200 Subject: [PATCH] Use parameterized event in QuickReplyManager see 04ac9c2bde8d5412dab5e59329dfe1949f359ce7 --- .../message/QuickReplyManager.class.php | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php index c2ab348741..b0f1016fee 100644 --- a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php +++ b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php @@ -50,18 +50,6 @@ class QuickReplyManager extends SingletonFactory { */ public $type = ''; - /** - * additional fields - * @var array - */ - public $additionalFields = array(); - - /** - * the message that just was created - * @var \wcf\data\DatabaseObject - */ - public $message = null; - /** * Returns a stored message from session. * @@ -182,7 +170,8 @@ class QuickReplyManager extends SingletonFactory { * @return array */ public function createMessage(IMessageQuickReplyAction $object, array &$parameters, $containerActionClassName, $sortOrder, $templateName, $application = 'wcf') { - EventHandler::getInstance()->fireAction($this, 'createMessage'); + $additionalFields = array(); + EventHandler::getInstance()->fireAction($this, 'createMessage', $additionalFields); $tableIndexName = call_user_func(array($this->container, 'getDatabaseTableIndexName')); $parameters['data'][$tableIndexName] = $parameters['objectID']; @@ -197,22 +186,15 @@ class QuickReplyManager extends SingletonFactory { } unset($parameters['data']['preParse']); - $parameters['data'] = array_merge($this->additionalFields, $parameters['data']); + $parameters['data'] = array_merge($additionalFields, $parameters['data']); // attachment support if (MODULE_ATTACHMENT && $object instanceof IAttachmentMessageQuickReplyAction) { $parameters['attachmentHandler'] = $object->getAttachmentHandler($this->container); } - // clean up - $this->additionalFields = array(); - - $this->message = $object->create(); - EventHandler::getInstance()->fireAction($this, 'createdMessage'); - $message = $this->message; - - // clean up - $this->message = null; + $message = $object->create(); + EventHandler::getInstance()->fireAction($this, 'createdMessage', array('message' => $message)); if ($message instanceof IMessage && !$message->isVisible()) { return array( -- 2.20.1