mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
VKAPI: Fix Groups.get unworkability if owner id is less than zero
This commit is contained in:
parent
da41006ddb
commit
307b7709cc
1 changed files with 3 additions and 12 deletions
|
@ -10,7 +10,7 @@ final class Groups extends VKAPIRequestHandler
|
|||
$this->requireUser();
|
||||
|
||||
if($user_id == 0) {
|
||||
foreach($this->getUser()->getClubs($offset+1) as $club)
|
||||
foreach($this->getUser()->getClubs((int) floor($offset/$count)+1) as $club)
|
||||
$clbs[] = $club;
|
||||
$clbsCount = $this->getUser()->getClubCount();
|
||||
} else {
|
||||
|
@ -37,13 +37,7 @@ final class Groups extends VKAPIRequestHandler
|
|||
|
||||
for($i=0; $i < $ic; $i++) {
|
||||
$usr = $clbs[$i];
|
||||
if(is_null($usr)) {
|
||||
$rClubs[$i] = (object)[
|
||||
"id" => $clbs[$i],
|
||||
"name" => "DELETED",
|
||||
"deactivated" => "deleted"
|
||||
];
|
||||
} else if($clbs[$i] == NULL) {
|
||||
if(is_null($usr)) {
|
||||
|
||||
} else {
|
||||
$rClubs[$i] = (object) [
|
||||
|
@ -151,6 +145,7 @@ final class Groups extends VKAPIRequestHandler
|
|||
"screen_name" => $clb->getShortCode() ?? "club".$clb->getId(),
|
||||
"is_closed" => false,
|
||||
"type" => "group",
|
||||
"is_member" => !is_null($this->getUser()) ? (int) $clb->getSubscriptionStatus($this->getUser()) : 0,
|
||||
"can_access_closed" => true,
|
||||
];
|
||||
|
||||
|
@ -213,10 +208,6 @@ final class Groups extends VKAPIRequestHandler
|
|||
else
|
||||
$response[$i]->can_post = $clb->canPost();
|
||||
break;
|
||||
case "is_member":
|
||||
if(!is_null($this->getUser()))
|
||||
$response[$i]->is_member = (int) $clb->getSubscriptionStatus($this->getUser());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue