Merge pull request #11364 from friendica/notification-links

Fix link to post in notification
This commit is contained in:
Hypolite Petovan 2022-03-20 19:59:41 -04:00 committed by GitHub
commit 7c282c597d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 31 deletions

View file

@ -141,7 +141,7 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
} }
$link_item = Post::selectFirstPost(['guid'], ['uri-id' => $Notification->targetUriId]); $link_item = Post::selectFirstPost(['guid'], ['uri-id' => $Notification->targetUriId]);
} else { } 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)) { if (empty($item)) {
$this->logger->info('Post not found', ['uri-id' => $Notification->targetUriId]); $this->logger->info('Post not found', ['uri-id' => $Notification->targetUriId]);
return $message; return $message;
@ -154,8 +154,11 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
return $message; return $message;
} }
} }
if (($Notification->verb != Activity::POST) || !in_array($Notification->type, [Post\UserNotification::TYPE_DIRECT_THREAD_COMMENT, Post\UserNotification::TYPE_IMPLICIT_TAGGED])) {
$link_item = $item; $link_item = $item;
} }
}
if (in_array($Notification->type, [Post\UserNotification::TYPE_COMMENT_PARTICIPATION, Post\UserNotification::TYPE_ACTIVITY_PARTICIPATION, Post\UserNotification::TYPE_SHARED])) { 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', 'contact-type']); $author = Contact::getById($item['author-id'], ['id', 'name', 'url', 'contact-type']);

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2022.05-dev\n" "Project-Id-Version: 2022.05-dev\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -8513,11 +8513,11 @@ msgstr ""
msgid "Show unread" msgid "Show unread"
msgstr "" msgstr ""
#: src/Module/Notifications/Ping.php:212 #: src/Module/Notifications/Ping.php:218
msgid "{0} requested registration" msgid "{0} requested registration"
msgstr "" msgstr ""
#: src/Module/Notifications/Ping.php:223 #: src/Module/Notifications/Ping.php:229
#, php-format #, php-format
msgid "{0} and %d others requested registration" msgid "{0} and %d others requested registration"
msgstr "" msgstr ""
@ -10030,116 +10030,116 @@ msgstr ""
msgid "%1$s has started following you" msgid "%1$s has started following you"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:184 #: src/Navigation/Notifications/Factory/Notification.php:186
#, php-format #, php-format
msgid "%1$s liked your comment on %2$s" msgid "%1$s liked your comment on %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:187 #: src/Navigation/Notifications/Factory/Notification.php:189
#, php-format #, php-format
msgid "%1$s liked your post %2$s" msgid "%1$s liked your post %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:194 #: src/Navigation/Notifications/Factory/Notification.php:196
#, php-format #, php-format
msgid "%1$s disliked your comment on %2$s" msgid "%1$s disliked your comment on %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:197 #: src/Navigation/Notifications/Factory/Notification.php:199
#, php-format #, php-format
msgid "%1$s disliked your post %2$s" msgid "%1$s disliked your post %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:204 #: src/Navigation/Notifications/Factory/Notification.php:206
#, php-format #, php-format
msgid "%1$s shared your comment %2$s" msgid "%1$s shared your comment %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:207 #: src/Navigation/Notifications/Factory/Notification.php:209
#, php-format #, php-format
msgid "%1$s shared your post %2$s" msgid "%1$s shared your post %2$s"
msgstr "" 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:213
#: src/Navigation/Notifications/Factory/Notification.php:282 #: src/Navigation/Notifications/Factory/Notification.php:282
#, php-format #, php-format
msgid "%1$s shared a post from %3$s" msgid "%1$s shared the post %2$s from %3$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:215 #: src/Navigation/Notifications/Factory/Notification.php:215
#: src/Navigation/Notifications/Factory/Notification.php:284 #: src/Navigation/Notifications/Factory/Notification.php:284
#, php-format #, php-format
msgid "%1$s shared the post %2$s" msgid "%1$s shared a post from %3$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:217 #: src/Navigation/Notifications/Factory/Notification.php:217
#: src/Navigation/Notifications/Factory/Notification.php:286 #: src/Navigation/Notifications/Factory/Notification.php:286
#, php-format #, 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" msgid "%1$s shared a post"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:225 #: src/Navigation/Notifications/Factory/Notification.php:227
#, php-format #, php-format
msgid "%1$s wants to attend your event %2$s" msgid "%1$s wants to attend your event %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:232 #: src/Navigation/Notifications/Factory/Notification.php:234
#, php-format #, php-format
msgid "%1$s does not want to attend your event %2$s" msgid "%1$s does not want to attend your event %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:239 #: src/Navigation/Notifications/Factory/Notification.php:241
#, php-format #, php-format
msgid "%1$s maybe wants to attend your event %2$s" msgid "%1$s maybe wants to attend your event %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:246 #: src/Navigation/Notifications/Factory/Notification.php:248
#, php-format #, php-format
msgid "%1$s tagged you on %2$s" msgid "%1$s tagged you on %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:250 #: src/Navigation/Notifications/Factory/Notification.php:252
#, php-format #, php-format
msgid "%1$s replied to you on %2$s" msgid "%1$s replied to you on %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:254 #: src/Navigation/Notifications/Factory/Notification.php:256
#, php-format #, php-format
msgid "%1$s commented in your thread %2$s" msgid "%1$s commented in your thread %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:258 #: src/Navigation/Notifications/Factory/Notification.php:260
#, php-format #, php-format
msgid "%1$s commented on your comment %2$s" msgid "%1$s commented on your comment %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:264 #: src/Navigation/Notifications/Factory/Notification.php:266
#, php-format #, php-format
msgid "%1$s commented in their thread %2$s" msgid "%1$s commented in their thread %2$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:266 #: src/Navigation/Notifications/Factory/Notification.php:268
#, php-format #, php-format
msgid "%1$s commented in their thread" msgid "%1$s commented in their thread"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:268 #: src/Navigation/Notifications/Factory/Notification.php:270
#, php-format #, php-format
msgid "%1$s commented in the thread %2$s from %3$s" msgid "%1$s commented in the thread %2$s from %3$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:270 #: src/Navigation/Notifications/Factory/Notification.php:272
#, php-format #, php-format
msgid "%1$s commented in the thread from %3$s" msgid "%1$s commented in the thread from %3$s"
msgstr "" msgstr ""
#: src/Navigation/Notifications/Factory/Notification.php:275 #: src/Navigation/Notifications/Factory/Notification.php:277
#, php-format #, php-format
msgid "%1$s commented on your thread %2$s" msgid "%1$s commented on your thread %2$s"
msgstr "" msgstr ""