From 0dc9129d799e210f06f99d6eaad778a79def520e Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 29 Jun 2016 16:54:23 +0300 Subject: [PATCH] notification improvements 2 --- application/Espo/Hooks/Common/Stream.php | 3 --- application/Espo/Services/Notification.php | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/application/Espo/Hooks/Common/Stream.php b/application/Espo/Hooks/Common/Stream.php index 4ad3c140a7..48045780bb 100644 --- a/application/Espo/Hooks/Common/Stream.php +++ b/application/Espo/Hooks/Common/Stream.php @@ -200,9 +200,6 @@ class Stream extends \Espo\Core\Hooks\Base if (in_array($userId, $userIdList)) { unset($autofollowUserIdList[$i]); } - if ($createdById === $userId) { - unset($autofollowUserIdList[$i]); - } } $autofollowUserIdList = array_values($autofollowUserIdList); diff --git a/application/Espo/Services/Notification.php b/application/Espo/Services/Notification.php index e8a4353ea8..4046ab7bd7 100644 --- a/application/Espo/Services/Notification.php +++ b/application/Espo/Services/Notification.php @@ -88,9 +88,8 @@ class Notification extends \Espo\Services\Record ))->find(); foreach ($userList as $user) { $userId = $user->id; - if (!$this->checkUserNoteAccess($user, $note)) { - continue; - } + if (!$this->checkUserNoteAccess($user, $note)) continue; + if ($note->get('createdById') === $user->id) continue; $id = uniqid(); $arr[] = "(".$pdo->quote($id).", ".$pdo->quote($encodedData).", ".$pdo->quote('Note').", ".$pdo->quote($userId).", ".$pdo->quote($now).", ".$pdo->quote($note->id).", ".$pdo->quote('Note').", ".$pdo->quote($note->get('parentId')).", ".$pdo->quote($note->get('parentType')).")"; }