Issue 11189: Fix notifications for new posts

This commit is contained in:
Michael 2022-01-28 05:28:13 +00:00
parent ec897c6c85
commit cd0a0c3424
2 changed files with 72 additions and 56 deletions

View file

@ -140,7 +140,7 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
$title = '';
}
$this->logger->debug('Got verb and type', ['verb' => $Notification->verb, 'type' => $Notification->type]);
$this->logger->debug('Got verb and type', ['verb' => $Notification->verb, 'type' => $Notification->type, 'causer' => $causer['id'], 'author' => $author['id'], 'item' => $item['id'], 'uid' => $Notification->uid]);
switch ($Notification->verb) {
case Activity::LIKE:
@ -239,6 +239,18 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
case Post\UserNotification::TYPE_DIRECT_THREAD_COMMENT:
$msg = $userL10n->t('%1$s commented on your thread %2$s');
break;
case Post\UserNotification::TYPE_SHARED:
if (($causer['id'] != $author['id']) && ($title != '')) {
$msg = $userL10n->t('%1$s shared the post %2$s from %3$s');
} elseif ($causer['id'] != $author['id']) {
$msg = $userL10n->t('%1$s shared a post from %3$s');
} elseif ($title != '') {
$msg = $userL10n->t('%1$s shared the post %2$s');
} else {
$msg = $userL10n->t('%1$s shared a post');
}
break;
}
break;
}