Fix permissions reporting (can_create_topic, can_post) for clubs in vk api

This commit is contained in:
celestora 2023-07-06 11:44:46 +03:00
parent 2e76ca16df
commit 070ea16536

View file

@ -382,9 +382,9 @@ class Club extends RowModel
$res->photo_100 = $this->getAvatarUrl("tiny"); $res->photo_100 = $this->getAvatarUrl("tiny");
$res->photo_200 = $this->getAvatarUrl("normal"); $res->photo_200 = $this->getAvatarUrl("normal");
$res->can_create_topic = $this->canBeModifiedBy($user) ? 1 : $this->isEveryoneCanCreateTopics() ? 1 : 0; $res->can_create_topic = $this->canBeModifiedBy($user) ? 1 : ($this->isEveryoneCanCreateTopics() ? 1 : 0);
$res->can_post = $this->canBeModifiedBy($user) ? 1 : $this->canPost() ? 1 : 0; $res->can_post = $this->canBeModifiedBy($user) ? 1 : ($this->canPost() ? 1 : 0);
return (object) $res; return (object) $res;
} }