Issue 12504: Don't notify likes and reshares by mail

pull/15070/head
Michael 2025-08-03 17:51:03 +00:00
rodzic 9283f0927f
commit 5920fc9d6b
2 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -122,7 +122,7 @@ class Subscription
$type = NotificationFactory::getType($notification);
if (DI::notify()->shouldShowOnDesktop($notification, $type)) {
DI::notify()->createFromNotification($notification);
DI::notify()->createFromNotification($notification, $type);
}
if (empty($type)) {

Wyświetl plik

@ -686,7 +686,7 @@ class Notify extends BaseRepository
return false;
}
public function shouldShowOnDesktop(NotificationEntity $Notification, string $type = null): bool
public function shouldShowOnDesktop(NotificationEntity $Notification, string $type = ''): bool
{
if (is_null($type)) {
$type = NotificationFactory::getType($Notification);
@ -718,15 +718,20 @@ class Notify extends BaseRepository
return false;
}
public function createFromNotification(NotificationEntity $Notification): bool
public function createFromNotification(NotificationEntity $Notification, string $type): bool
{
$this->logger->info('Start', ['uid' => $Notification->uid, 'id' => $Notification->id, 'type' => $Notification->type]);
if ($Notification->type === Model\Post\UserNotification::TYPE_NONE) {
$this->logger->info('Not an item based notification, quitting', ['uid' => $Notification->uid, 'id' => $Notification->id, 'type' => $Notification->type]);
return false;
}
if (in_array($type, [Notification::TYPE_LIKE, Notification::TYPE_RESHARE])) {
$this->logger->info('Notification type is like or reshare, quitting', ['uid' => $Notification->uid, 'id' => $Notification->id, 'type' => $Notification->type]);
return false;
}
$params = [];
$params['verb'] = $Notification->verb;
$params['uid'] = $Notification->uid;