]> git.mxchange.org Git - friendica.git/commitdiff
Avoiding notice
authorMichael <heluecht@pirati.ca>
Mon, 15 Feb 2021 07:44:51 +0000 (07:44 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 15 Feb 2021 07:44:51 +0000 (07:44 +0000)
src/Worker/Delivery.php
src/Worker/Notifier.php

index e2db058ea51969ba02560339ee9dd84f89d3664e..af04d91c5f241d2946f8ee65efc061af8c2217ee 100644 (file)
@@ -55,6 +55,8 @@ class Delivery
        {
                Logger::info('Invoked', ['cmd' => $cmd, 'target' => $post_uriid, 'sender_uid' => $sender_uid, 'contact' => $contact_id]);
 
+               $target_id = $post_uriid;
+
                if (!empty($sender_uid)) {
                        $post = Post::selectFirst(['id'], ['uri-id' => $post_uriid, 'uid' => $sender_uid]);
                        if (!DBA::isResult($post)) {
@@ -69,8 +71,6 @@ class Delivery
                                $sender_uid = $post['uid'];
                                $post_uriid = $post['uri-id'];
                        }
-               } else {
-                       $target_id = $post_uriid;
                }
 
                $top_level = false;
index f225adf11d4f7b1d034d4797061c1920fd59890e..896916ede6fbdf445399ae0640338ebe0f4c6a7a 100644 (file)
@@ -59,6 +59,8 @@ class Notifier
 
                Logger::info('Invoked', ['cmd' => $cmd, 'target' => $post_uriid, 'sender_uid' => $sender_uid]);
 
+               $target_id = $post_uriid;
+
                if (!empty($sender_uid)) {
                        $post = Post::selectFirst(['id'], ['uri-id' => $post_uriid, 'uid' => $sender_uid]);
                        if (!DBA::isResult($post)) {
@@ -67,15 +69,12 @@ class Notifier
                        }
                        $target_id = $post['id'];
                } elseif (!in_array($cmd, [Delivery::MAIL, Delivery::SUGGESTION, Delivery::REMOVAL, Delivery::RELOCATION])) {
-                       $post = Post::selectFirst(['id'], ['item-id' => $post_uriid]);
                        $post = Post::selectFirst(['id', 'uid', 'uri-id'], ['item-id' => $post_uriid]);
                        if (DBA::isResult($post)) {
                                $target_id = $post['id'];
                                $sender_uid = $post['uid'];
                                $post_uriid = $post['uri-id'];
                        }
-               } else {
-                       $target_id = $post_uriid;
                }
 
                $top_level = false;