kopia lustrzana https://github.com/friendica/friendica
Issue 12504: Don't notify likes and reshares by mail
rodzic
9283f0927f
commit
5920fc9d6b
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue