Distinguish between comment likes and post likes.

This commit is contained in:
Marek Bachmann 2022-12-23 02:38:00 +01:00
parent ef4f508f9b
commit b876a9efcd
2 changed files with 18 additions and 8 deletions

View file

@ -784,14 +784,19 @@ class Notify extends BaseRepository
} else {
$params['type'] = Model\Notification\Type::COMMENT;
if ($params['verb'] = Activity::LIKE) {
$subject = $l10n->t('%1$s Like in conversation #%2$d by %3$s', $subjectPrefix, $item['parent'], $contact['name']);
switch ($Notification->type) {
case Model\Post\UserNotification::TYPE_DIRECT_COMMENT:
$subject = $l10n->t('%1$s %2$s liked your post #%3$d', $subjectPrefix, $contact['name'], $item['parent']);
break;
case Model\Post\UserNotification::TYPE_DIRECT_THREAD_COMMENT:
$subject = $l10n->t('%1$s %2$s liked your comment on #%3$d', $subjectPrefix, $contact['name'], $item['parent']);
break;
}
} else {
$subject = $l10n->t('%1$s Comment to conversation #%2$d by %3$s', $subjectPrefix, $item['parent'], $contact['name']);
}
}
$msg = $this->notification->getMessageFromNotification($Notification);
if (empty($msg)) {
$this->logger->info('No notification message, quitting', ['uid' => $Notification->uid, 'id' => $Notification->id, 'type' => $Notification->type]);