Loading Core/Analytics/Delegates/UpdateUserState.php +14 −13 Original line number Original line Diff line number Diff line Loading @@ -26,11 +26,9 @@ class UpdateUserState public function update(): void public function update(): void { { if ($this->user->getUserState() !== $this->userState->getState()) { $this->updateUserEntity(); $this->updateUserEntity(); $this->sendStateChangeNotification(); $this->sendStateChangeNotification(); } } } private function updateUserEntity(): void private function updateUserEntity(): void { { Loading @@ -41,14 +39,17 @@ class UpdateUserState private function sendStateChangeNotification(): void private function sendStateChangeNotification(): void { { if ($this->userState->getStateChange() !== 0) { $notificationView = ($this->userState->getStateChange() > 0) ? 'reward_state_increase' : 'reward_state_decrease'; Dispatcher::trigger('notification', 'reward', [ Dispatcher::trigger('notification', 'reward', [ 'to' => [ 'to' => [ $this->userState->getUserGuid() $this->userState->getUserGuid() ], ], 'from' => Notification::SYSTEM_ENTITY, 'from' => Notification::SYSTEM_ENTITY, 'notification_view' => 'rewards_state_change', 'notification_view' => $notificationView, 'params' => $this->userState->export() 'params' => $this->userState->export() ]); ]); } } } } } Core/Analytics/UserStates/UserState.php +1 −1 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ use Minds\Traits\MagicAttributes; * @method UserState setActivityPercentage(float $activityPercentage) * @method UserState setActivityPercentage(float $activityPercentage) * @method float getActivityPercentage() * @method float getActivityPercentage() * @method UserState setStateChange(int $stateChange) * @method UserState setStateChange(int $stateChange) * @method int getUserState() * @method int getStateChange() */ */ class UserState class UserState { { Loading Loading
Core/Analytics/Delegates/UpdateUserState.php +14 −13 Original line number Original line Diff line number Diff line Loading @@ -26,11 +26,9 @@ class UpdateUserState public function update(): void public function update(): void { { if ($this->user->getUserState() !== $this->userState->getState()) { $this->updateUserEntity(); $this->updateUserEntity(); $this->sendStateChangeNotification(); $this->sendStateChangeNotification(); } } } private function updateUserEntity(): void private function updateUserEntity(): void { { Loading @@ -41,14 +39,17 @@ class UpdateUserState private function sendStateChangeNotification(): void private function sendStateChangeNotification(): void { { if ($this->userState->getStateChange() !== 0) { $notificationView = ($this->userState->getStateChange() > 0) ? 'reward_state_increase' : 'reward_state_decrease'; Dispatcher::trigger('notification', 'reward', [ Dispatcher::trigger('notification', 'reward', [ 'to' => [ 'to' => [ $this->userState->getUserGuid() $this->userState->getUserGuid() ], ], 'from' => Notification::SYSTEM_ENTITY, 'from' => Notification::SYSTEM_ENTITY, 'notification_view' => 'rewards_state_change', 'notification_view' => $notificationView, 'params' => $this->userState->export() 'params' => $this->userState->export() ]); ]); } } } } }
Core/Analytics/UserStates/UserState.php +1 −1 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ use Minds\Traits\MagicAttributes; * @method UserState setActivityPercentage(float $activityPercentage) * @method UserState setActivityPercentage(float $activityPercentage) * @method float getActivityPercentage() * @method float getActivityPercentage() * @method UserState setStateChange(int $stateChange) * @method UserState setStateChange(int $stateChange) * @method int getUserState() * @method int getStateChange() */ */ class UserState class UserState { { Loading