diff --git a/VKAPI/Handlers/Friends.php b/VKAPI/Handlers/Friends.php index 56de3294..59cf5679 100644 --- a/VKAPI/Handlers/Friends.php +++ b/VKAPI/Handlers/Friends.php @@ -4,7 +4,7 @@ use openvk\Web\Models\Repositories\Users as UsersRepo; final class Friends extends VKAPIRequestHandler { - function get(int $user_id, string $fields = "", int $offset = 0, int $count = 100): object + function get(int $user_id = 0, string $fields = "", int $offset = 0, int $count = 100): object { $i = 0; $offset++; @@ -14,6 +14,10 @@ final class Friends extends VKAPIRequestHandler $this->requireUser(); + if ($user_id == 0) { + $user_id = $this->getUser()->getId(); + } + if (is_null($users->get($user_id))) { $this->fail(100, "One of the parameters specified was missing or invalid"); } diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 693ca3cb..add2159b 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -802,7 +802,7 @@ final class Wall extends VKAPIRequestHandler return [ "type" => "photo", "photo" => [ - "album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : NULL, + "album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : 0, "date" => $attachment->getPublicationTime()->timestamp(), "id" => $attachment->getVirtualId(), "owner_id" => $attachment->getOwner()->getId(),