From 98260e8d0a7f7acec6416ffe570468e779a1b2a8 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Mon, 17 Oct 2022 23:24:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=B0=D0=B6=D0=B5=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=B7=D0=BD=D0=B0=D1=8E=20=D0=BA=D0=B0=D0=BA=20=D1=8D=D1=82?= =?UTF-8?q?=D0=BE=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D1=8C,=20=D0=BD=D0=B0=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BD=D0=BE=20=D0=BF=D0=BE=D1=82=D0=BE=D0=BC=D1=83-?= =?UTF-8?q?=D1=87=D1=82=D0=BE=20=D0=BA=D0=B0=D0=BA=D0=BE=D0=B9-=D1=82?= =?UTF-8?q?=D0=BE=20=D0=B4=D0=B5=D0=B2=D1=83=D1=88=D0=BA=D0=B5=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D0=BB=D0=B8=20=D0=B2=20=D0=BF=D0=B8=D0=B7?= =?UTF-8?q?=D0=B4=D1=83=20=D0=B1=D0=B5=D0=BD=D0=B7=D0=B8=D0=BD=20=D0=B8=20?= =?UTF-8?q?=D1=80=D0=BE=D0=B4=D0=B8=D0=BB=D1=81=D1=8F=20=D0=BA=D0=B0=D0=BC?= =?UTF-8?q?=D0=B0=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VKAPI/Handlers/Wall.php | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 1b04fe05..9dca9ebe 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -59,6 +59,8 @@ final class Wall extends VKAPIRequestHandler } } + $groups[] = $attachment->isPostedOnBehalfOfGroup() ? $attachment->getOwner()->getId() * -1 : $attachment->getOwner()->getId(); + $repost[] = [ "id" => $attachment->getVirtualId(), "owner_id" => $attachment->isPostedOnBehalfOfGroup() ? $attachment->getOwner()->getId() * -1 : $attachment->getOwner()->getId(), @@ -200,7 +202,9 @@ final class Wall extends VKAPIRequestHandler $repostAttachments[] = $this->getApiPhoto($repostAttachment); /* Рекурсии, сука! Заказывали? */ } - } + } + + $groups[] = $attachment->isPostedOnBehalfOfGroup() ? $attachment->getOwner()->getId() * -1 : $attachment->getOwner()->getId(); $repost[] = [ "id" => $attachment->getVirtualId(), @@ -606,24 +610,24 @@ final class Wall extends VKAPIRequestHandler return [ "type" => "poll", "poll" => [ - "multiple" => $attachment->isMultipleChoice(), - "end_date" => $attachment->endsAt() == NULL ? 0 : $attachment->endsAt()->timestamp(), - "closed" => $attachment->hasEnded(), - "is_board" => false, - "can_edit" => false, - "can_vote" => $attachment->canVote($user), - "can_report" => false, - "can_share" => true, - "created" => 0, - "id" => $attachment->getId(), - "owner_id" => $attachment->getOwner()->getId(), - "question" => $attachment->getTitle(), - "votes" => $attachment->getVoterCount(), + "multiple" => $attachment->isMultipleChoice(), + "end_date" => $attachment->endsAt() == NULL ? 0 : $attachment->endsAt()->timestamp(), + "closed" => $attachment->hasEnded(), + "is_board" => false, + "can_edit" => false, + "can_vote" => $attachment->canVote($user), + "can_report" => false, + "can_share" => true, + "created" => 0, + "id" => $attachment->getId(), + "owner_id" => $attachment->getOwner()->getId(), + "question" => $attachment->getTitle(), + "votes" => $attachment->getVoterCount(), "disable_unvote" => $attachment->isRevotable(), - "anonymous" => $attachment->isAnonymous(), - "answer_ids" => $userVote, - "answers" => $answers, - "author_id" => $attachment->getOwner()->getId(), + "anonymous" => $attachment->isAnonymous(), + "answer_ids" => $userVote, + "answers" => $answers, + "author_id" => $attachment->getOwner()->getId(), ] ]; }