From b876a9efcd5580fe9c8800b7fdf165c6f6c4345a Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Fri, 23 Dec 2022 02:38:00 +0100 Subject: [PATCH] Distinguish between comment likes and post likes. --- .../Notifications/Repository/Notify.php | 11 ++++++++--- view/lang/C/messages.po | 15 ++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Navigation/Notifications/Repository/Notify.php b/src/Navigation/Notifications/Repository/Notify.php index 7af61d0b6..e2eb6cbf6 100644 --- a/src/Navigation/Notifications/Repository/Notify.php +++ b/src/Navigation/Notifications/Repository/Notify.php @@ -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]); diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index e4d20b57e..a086ec4c1 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2023.03-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-23 01:05+0100\n" +"POT-Creation-Date: 2022-12-23 02:32+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -10793,7 +10793,7 @@ msgid "%1$s commented on their %2$s %3$s" msgstr "" #: src/Navigation/Notifications/Repository/Notify.php:341 -#: src/Navigation/Notifications/Repository/Notify.php:789 +#: src/Navigation/Notifications/Repository/Notify.php:796 #, php-format msgid "%1$s Comment to conversation #%2$d by %3$s" msgstr "" @@ -10805,7 +10805,7 @@ msgstr "" #: src/Navigation/Notifications/Repository/Notify.php:347 #: src/Navigation/Notifications/Repository/Notify.php:362 -#: src/Navigation/Notifications/Repository/Notify.php:807 +#: src/Navigation/Notifications/Repository/Notify.php:812 #, php-format msgid "Please visit %s to view and/or reply to the conversation." msgstr "" @@ -11008,9 +11008,14 @@ msgstr "" msgid "%s %s shared a new post" msgstr "" -#: src/Navigation/Notifications/Repository/Notify.php:787 +#: src/Navigation/Notifications/Repository/Notify.php:789 #, php-format -msgid "%1$s Like in conversation #%2$d by %3$s" +msgid "%1$s %2$s liked your post #%3$d" +msgstr "" + +#: src/Navigation/Notifications/Repository/Notify.php:792 +#, php-format +msgid "%1$s %2$s liked your comment on #%3$d" msgstr "" #: src/Object/EMail/ItemCCEMail.php:42