From 98281b502bb69e98109886e3ee21c62ab5124860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 2 Feb 2013 23:43:14 +0100 Subject: [PATCH] Use faster changing values for activity points Fixes #15 --- file/lib/form/ChatForm.class.php | 3 ++- file/lib/page/ChatPage.class.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/file/lib/form/ChatForm.class.php b/file/lib/form/ChatForm.class.php index a3b77a5..2e71210 100644 --- a/file/lib/form/ChatForm.class.php +++ b/file/lib/form/ChatForm.class.php @@ -217,9 +217,10 @@ public function save() { ) )); $this->objectAction->executeAction(); + $returnValues = $this->objectAction->getReturnValues(); // add activity points - \wcf\system\user\activity\point\UserActivityPointHandler::getInstance()->fireEvent('be.bastelstu.chat.activityPointEvent.message', TIME_NOW, WCF::getUser()->userID); + \wcf\system\user\activity\point\UserActivityPointHandler::getInstance()->fireEvent('be.bastelstu.chat.activityPointEvent.message', $returnValues->messageID, WCF::getUser()->userID); $this->saved(); } diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index a4a50d2..aeecc49 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -208,7 +208,7 @@ public function show() { parent::show(); // add activity points - \wcf\system\user\activity\point\UserActivityPointHandler::getInstance()->fireEvent('be.bastelstu.chat.activityPointEvent.join', TIME_NOW, WCF::getUser()->userID); + \wcf\system\user\activity\point\UserActivityPointHandler::getInstance()->fireEvent('be.bastelstu.chat.activityPointEvent.join', (microtime(true) * 1000 & 0xFFFFFFFF), WCF::getUser()->userID); // break if not using ajax if ($this->useTemplate) exit;