mirror of
https://github.com/openvk/openvk
synced 2024-11-11 09:29:29 +03:00
VKAPI: Fix wall.get unworkability if owner id is less than zero
I was wrong about last commit. I just fixed is_member field to show up by force
This commit is contained in:
parent
307b7709cc
commit
7b1182f4e8
1 changed files with 10 additions and 3 deletions
|
@ -21,10 +21,17 @@ final class Wall extends VKAPIRequestHandler
|
||||||
$groups = [];
|
$groups = [];
|
||||||
$cnt = $posts->getPostCountOnUserWall($owner_id);
|
$cnt = $posts->getPostCountOnUserWall($owner_id);
|
||||||
|
|
||||||
$wallOnwer = (new UsersRepo)->get($owner_id);
|
if ($owner_id > 0)
|
||||||
|
$wallOnwer = (new UsersRepo)->get($owner_id);
|
||||||
|
else
|
||||||
|
$wallOnwer = (new ClubsRepo)->get($owner_id * -1);
|
||||||
|
|
||||||
if(!$wallOnwer || $wallOnwer->isDeleted() || $wallOnwer->isDeleted())
|
if ($owner_id > 0)
|
||||||
$this->fail(18, "User was deleted or banned");
|
if(!$wallOnwer || $wallOnwer->isDeleted())
|
||||||
|
$this->fail(18, "User was deleted or banned");
|
||||||
|
else
|
||||||
|
if(!$wallOnwer)
|
||||||
|
$this->fail(15, "Access denied: wall is disabled"); // Don't search for logic here pls
|
||||||
|
|
||||||
foreach($posts->getPostsFromUsersWall($owner_id, 1, $count, $offset) as $post) {
|
foreach($posts->getPostsFromUsersWall($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();
|
$from_id = get_class($post->getOwner()) == "openvk\Web\Models\Entities\Club" ? $post->getOwner()->getId() * (-1) : $post->getOwner()->getId();
|
||||||
|
|
Loading…
Reference in a new issue