From 5e176b52a548fac55fbb260ebd8caff002399b5d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 11 Dec 2022 04:11:29 +0000 Subject: [PATCH] Issue 12285: Show sharing notification only once --- src/Model/Post/UserNotification.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Model/Post/UserNotification.php b/src/Model/Post/UserNotification.php index b26fb292b..d872d5c41 100644 --- a/src/Model/Post/UserNotification.php +++ b/src/Model/Post/UserNotification.php @@ -440,6 +440,12 @@ class UserNotification } } + // Only check on posts by the user itself + $cdata = Contact::getPublicAndUserContactID($item['contact-id'], $item['uid']); + if (empty($cdata['user']) || ($item['author-id'] != $cdata['public'])) { + return false; + } + // Check if the contact posted or shared something directly if (DBA::exists('contact', ['id' => $item['contact-id'], 'notify_new_posts' => true])) { return true;