Prevent deleted attachments from showing in wall.get

This commit is contained in:
celestora 2022-05-01 17:04:59 +03:00 committed by GitHub
parent b985057b49
commit bfa26c24d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,11 +23,12 @@ final class Wall extends VKAPIRequestHandler
foreach ($posts->getPostsFromUsersWall((int)$owner_id, 1, $count, $offset) as $post) {
$from_id = get_class($post->getOwner()) == "openvk\Web\Models\Entities\Club" ? $post->getOwner()->getId() * (-1) : $post->getOwner()->getId();
$attachments;
foreach($post->getChildren() as $attachment)
{
if($attachment instanceof \openvk\Web\Models\Entities\Photo)
{
$attachments = [];
foreach($post->getChildren() as $attachment) {
if($attachment instanceof \openvk\Web\Models\Entities\Photo) {
if($attachment->isDeleted())
continue;
$attachments[] = [
"type" => "photo",
"photo" => [