]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Item/Activity.php
old boot.php functions replaced in src/module (2)
[friendica.git] / src / Module / Item / Activity.php
index b788167662db89be7aa6ddd5cb06618b02d4e492..ed09e8c5dddab02c7b02182f7ff79af2c5b07eee 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -51,13 +51,13 @@ class Activity extends BaseModule
                $itemId =  $this->parameters['id'];
 
                if (in_array($verb, ['announce', 'unannounce'])) {
-                       $item = Post::selectFirst(['network', 'uri-id', 'uid'], ['id' => $itemId]);
+                       $item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [Session::getLocalUser(), 0]]);
                        if ($item['network'] == Protocol::DIASPORA) {
-                               Diaspora::performReshare($item['uri-id'], $item['uid']);
+                               Diaspora::performReshare($item['uri-id'], Session::getLocalUser());
                        }
                }
 
-               if (!Item::performActivity($itemId, $verb, local_user())) {
+               if (!Item::performActivity($itemId, $verb, Session::getLocalUser())) {
                        throw new HTTPException\BadRequestException();
                }