mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
VKAPI: Fix newsfeed
This commit is contained in:
parent
dffa6d799e
commit
51d9aba5a6
1 changed files with 4 additions and 4 deletions
|
@ -45,7 +45,7 @@ final class Wall extends VKAPIRequestHandler
|
||||||
|
|
||||||
$attachments[] = $this->getApiPhoto($attachment);
|
$attachments[] = $this->getApiPhoto($attachment);
|
||||||
} else if($attachment instanceof \openvk\Web\Models\Entities\Poll) {
|
} else if($attachment instanceof \openvk\Web\Models\Entities\Poll) {
|
||||||
$attachments[] = $this->getApiPoll($attachment);
|
$attachments[] = $this->getApiPoll($attachment, $this->getUser());
|
||||||
} else if ($attachment instanceof \openvk\Web\Models\Entities\Post) {
|
} else if ($attachment instanceof \openvk\Web\Models\Entities\Post) {
|
||||||
$repostAttachments = [];
|
$repostAttachments = [];
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ final class Wall extends VKAPIRequestHandler
|
||||||
if($attachment instanceof \openvk\Web\Models\Entities\Photo) {
|
if($attachment instanceof \openvk\Web\Models\Entities\Photo) {
|
||||||
$attachments[] = $this->getApiPhoto($attachment);
|
$attachments[] = $this->getApiPhoto($attachment);
|
||||||
} else if($attachment instanceof \openvk\Web\Models\Entities\Poll) {
|
} else if($attachment instanceof \openvk\Web\Models\Entities\Poll) {
|
||||||
$attachments[] = $this->getApiPoll($attachment);
|
$attachments[] = $this->getApiPoll($attachment, $user);
|
||||||
} else if ($attachment instanceof \openvk\Web\Models\Entities\Post) {
|
} else if ($attachment instanceof \openvk\Web\Models\Entities\Post) {
|
||||||
$repostAttachments = [];
|
$repostAttachments = [];
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ final class Wall extends VKAPIRequestHandler
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getApiPoll($attachment) {
|
private function getApiPoll($attachment, $user) {
|
||||||
$answers = array();
|
$answers = array();
|
||||||
foreach($attachment->getResults()->options as $answer) {
|
foreach($attachment->getResults()->options as $answer) {
|
||||||
$answers[] = (object)[
|
$answers[] = (object)[
|
||||||
|
@ -600,7 +600,7 @@ final class Wall extends VKAPIRequestHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
$userVote = array();
|
$userVote = array();
|
||||||
foreach($attachment->getUserVote($this->getUser()) as $vote)
|
foreach($attachment->getUserVote($user) as $vote)
|
||||||
$userVote[] = $vote[0];
|
$userVote[] = $vote[0];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
Loading…
Reference in a new issue