From b70710e16437da3b4c47d845e5a413e971f9aa8d Mon Sep 17 00:00:00 2001 From: celestora Date: Mon, 28 Nov 2022 17:20:27 +0200 Subject: [PATCH] Return valid id for Comment in wall.getComments Fixes #790, probably? --- VKAPI/Handlers/Wall.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index e2023fa5..9297dcbc 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -441,9 +441,14 @@ final class Wall extends VKAPIRequestHandler $profiles = []; foreach($comments as $comment) { + $owner = $comment->getOwner(); + $oid = $owner->getId(); + if($owner instanceof Club) + $oid *= -1; + $item = [ "id" => $comment->getId(), - "from_id" => $comment->getOwner()->getId(), + "from_id" => $oid, "date" => $comment->getPublicationTime()->timestamp(), "text" => $comment->getText(false), "post_id" => $post->getVirtualId(),