From 4dace46159ea71c1904e75ead245c9fe47098d3b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Mar 2022 19:59:35 +0000 Subject: [PATCH 1/2] Fix link to post in notification --- src/Navigation/Notifications/Factory/Notification.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Navigation/Notifications/Factory/Notification.php b/src/Navigation/Notifications/Factory/Notification.php index 4e40972ee..ea74357c0 100644 --- a/src/Navigation/Notifications/Factory/Notification.php +++ b/src/Navigation/Notifications/Factory/Notification.php @@ -141,7 +141,7 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow } $link_item = Post::selectFirstPost(['guid'], ['uri-id' => $Notification->targetUriId]); } else { - $item = Post::selectFirst([], ['uri-id' => $Notification->targetUriId, 'uid' => [0, $Notification->uid]], ['order' => ['uid' => true]]); + $link_item = $item = Post::selectFirst([], ['uri-id' => $Notification->targetUriId, 'uid' => [0, $Notification->uid]], ['order' => ['uid' => true]]); if (empty($item)) { $this->logger->info('Post not found', ['uri-id' => $Notification->targetUriId]); return $message; @@ -154,7 +154,10 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow return $message; } } - $link_item = $item; + + if (($Notification->verb != Activity::POST) || !in_array($Notification->type, [Post\UserNotification::TYPE_DIRECT_THREAD_COMMENT, Post\UserNotification::TYPE_IMPLICIT_TAGGED])) { + $link_item = $item; + } } if (in_array($Notification->type, [Post\UserNotification::TYPE_COMMENT_PARTICIPATION, Post\UserNotification::TYPE_ACTIVITY_PARTICIPATION, Post\UserNotification::TYPE_SHARED])) { From 7959bc1e63cd40ff347971fad777309e9c5125e4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Mar 2022 20:21:35 +0000 Subject: [PATCH 2/2] Updated messages.po --- view/lang/C/messages.po | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 2d32af838..301d4cdc4 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-19 11:26+0000\n" +"POT-Creation-Date: 2022-03-20 20:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -8513,11 +8513,11 @@ msgstr "" msgid "Show unread" msgstr "" -#: src/Module/Notifications/Ping.php:212 +#: src/Module/Notifications/Ping.php:218 msgid "{0} requested registration" msgstr "" -#: src/Module/Notifications/Ping.php:223 +#: src/Module/Notifications/Ping.php:229 #, php-format msgid "{0} and %d others requested registration" msgstr "" @@ -10030,116 +10030,116 @@ msgstr "" msgid "%1$s has started following you" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:184 +#: src/Navigation/Notifications/Factory/Notification.php:186 #, php-format msgid "%1$s liked your comment on %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:187 +#: src/Navigation/Notifications/Factory/Notification.php:189 #, php-format msgid "%1$s liked your post %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:194 +#: src/Navigation/Notifications/Factory/Notification.php:196 #, php-format msgid "%1$s disliked your comment on %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:197 +#: src/Navigation/Notifications/Factory/Notification.php:199 #, php-format msgid "%1$s disliked your post %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:204 +#: src/Navigation/Notifications/Factory/Notification.php:206 #, php-format msgid "%1$s shared your comment %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:207 +#: src/Navigation/Notifications/Factory/Notification.php:209 #, php-format msgid "%1$s shared your post %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:211 -#: src/Navigation/Notifications/Factory/Notification.php:280 -#, php-format -msgid "%1$s shared the post %2$s from %3$s" -msgstr "" - #: src/Navigation/Notifications/Factory/Notification.php:213 #: src/Navigation/Notifications/Factory/Notification.php:282 #, php-format -msgid "%1$s shared a post from %3$s" +msgid "%1$s shared the post %2$s from %3$s" msgstr "" #: src/Navigation/Notifications/Factory/Notification.php:215 #: src/Navigation/Notifications/Factory/Notification.php:284 #, php-format -msgid "%1$s shared the post %2$s" +msgid "%1$s shared a post from %3$s" msgstr "" #: src/Navigation/Notifications/Factory/Notification.php:217 #: src/Navigation/Notifications/Factory/Notification.php:286 #, php-format +msgid "%1$s shared the post %2$s" +msgstr "" + +#: src/Navigation/Notifications/Factory/Notification.php:219 +#: src/Navigation/Notifications/Factory/Notification.php:288 +#, php-format msgid "%1$s shared a post" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:225 +#: src/Navigation/Notifications/Factory/Notification.php:227 #, php-format msgid "%1$s wants to attend your event %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:232 +#: src/Navigation/Notifications/Factory/Notification.php:234 #, php-format msgid "%1$s does not want to attend your event %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:239 +#: src/Navigation/Notifications/Factory/Notification.php:241 #, php-format msgid "%1$s maybe wants to attend your event %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:246 +#: src/Navigation/Notifications/Factory/Notification.php:248 #, php-format msgid "%1$s tagged you on %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:250 +#: src/Navigation/Notifications/Factory/Notification.php:252 #, php-format msgid "%1$s replied to you on %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:254 +#: src/Navigation/Notifications/Factory/Notification.php:256 #, php-format msgid "%1$s commented in your thread %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:258 +#: src/Navigation/Notifications/Factory/Notification.php:260 #, php-format msgid "%1$s commented on your comment %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:264 +#: src/Navigation/Notifications/Factory/Notification.php:266 #, php-format msgid "%1$s commented in their thread %2$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:266 +#: src/Navigation/Notifications/Factory/Notification.php:268 #, php-format msgid "%1$s commented in their thread" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:268 +#: src/Navigation/Notifications/Factory/Notification.php:270 #, php-format msgid "%1$s commented in the thread %2$s from %3$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:270 +#: src/Navigation/Notifications/Factory/Notification.php:272 #, php-format msgid "%1$s commented in the thread from %3$s" msgstr "" -#: src/Navigation/Notifications/Factory/Notification.php:275 +#: src/Navigation/Notifications/Factory/Notification.php:277 #, php-format msgid "%1$s commented on your thread %2$s" msgstr ""