mirror of
https://github.com/friendica/friendica
synced 2025-04-26 06:30:11 +00:00
Needless coude duplication removed
This commit is contained in:
parent
27a306185a
commit
e4887d23d2
2 changed files with 22 additions and 33 deletions
|
@ -114,8 +114,7 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
|
|||
return $message;
|
||||
}
|
||||
|
||||
if (($Notification->verb == Activity::POST) ||
|
||||
(($Notification->type === Post\UserNotification::TYPE_SHARED) && ($Notification->verb == Activity::ANNOUNCE))) {
|
||||
if (($Notification->verb == Activity::POST) || ($Notification->type === Post\UserNotification::TYPE_SHARED)) {
|
||||
$item = Post::selectFirst([], ['uri-id' => $item['thr-parent-id'], 'uid' => [0, $Notification->uid]], ['order' => ['uid' => true]]);
|
||||
if (empty($item)) {
|
||||
$this->logger->info('Thread parent post not found', ['uri-id' => $item['thr-parent-id']]);
|
||||
|
@ -124,13 +123,7 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
|
|||
}
|
||||
}
|
||||
|
||||
if ($Notification->type === Post\UserNotification::TYPE_SHARED) {
|
||||
$author = Contact::getById($item['author-id'], ['id', 'name', 'url']);
|
||||
if (empty($author)) {
|
||||
$this->logger->info('Author not found', ['author' => $item['author-id']]);
|
||||
return $message;
|
||||
}
|
||||
} elseif (in_array($Notification->type, [Post\UserNotification::TYPE_COMMENT_PARTICIPATION, Post\UserNotification::TYPE_ACTIVITY_PARTICIPATION])) {
|
||||
if (in_array($Notification->type, [Post\UserNotification::TYPE_COMMENT_PARTICIPATION, Post\UserNotification::TYPE_ACTIVITY_PARTICIPATION, Post\UserNotification::TYPE_SHARED])) {
|
||||
$author = Contact::getById($item['author-id'], ['id', 'name', 'url']);
|
||||
if (empty($author)) {
|
||||
$this->logger->info('Author not found', ['author' => $item['author-id']]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue