]> git.mxchange.org Git - friendica.git/commitdiff
Fetch the user's post if present
authorMichael <heluecht@pirati.ca>
Sat, 21 Aug 2021 21:40:47 +0000 (21:40 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 21 Aug 2021 21:40:47 +0000 (21:40 +0000)
src/Model/Notification.php

index 78799f8f8b251421a797a174f1620c5c837a56b0..03bfafe782809ac1b0f1aa4f297b400d6452fa91 100644 (file)
@@ -194,20 +194,20 @@ class Notification extends BaseModel
                $post     = Verb::getID(Activity::POST);
 
                if (in_array($notification['type'], [Post\UserNotification::NOTIF_THREAD_COMMENT, Post\UserNotification::NOTIF_COMMENT_PARTICIPATION, Post\UserNotification::NOTIF_EXPLICIT_TAGGED])) {
-                       $item = Post::selectFirst([], ['uri-id' => $notification['parent-uri-id'], 'uid' => [0, $notification['uid']]]);
+                       $item = Post::selectFirst([], ['uri-id' => $notification['parent-uri-id'], 'uid' => [0, $notification['uid']]], ['order' => ['uid' => true]]);
                        if (empty($item)) {
                                Logger::info('Parent post not found', ['uri-id' => $notification['parent-uri-id']]);
                                return $message;
                        }
                } else {
-                       $item = Post::selectFirst([], ['uri-id' => $notification['target-uri-id'], 'uid' => [0, $notification['uid']]]);
+                       $item = Post::selectFirst([], ['uri-id' => $notification['target-uri-id'], 'uid' => [0, $notification['uid']]], ['order' => ['uid' => true]]);
                        if (empty($item)) {
                                Logger::info('Post not found', ['uri-id' => $notification['target-uri-id']]);
                                return $message;
                        }
 
                        if ($notification['vid'] == $post) {
-                               $item = Post::selectFirst([], ['uri-id' => $item['thr-parent-id'], 'uid' => [0, $notification['uid']]]);
+                               $item = Post::selectFirst([], ['uri-id' => $item['thr-parent-id'], 'uid' => [0, $notification['uid']]], ['order' => ['uid' => true]]);
                                if (empty($item)) {
                                        Logger::info('Thread parent post not found', ['uri-id' => $item['thr-parent-id']]);
                                        return $message;