requireUser in getCounters and createComment

This commit is contained in:
NoPlagiarism 2022-12-12 04:13:55 +05:00
parent 5c734498c7
commit 2e327433a6
2 changed files with 4 additions and 0 deletions

View file

@ -67,6 +67,8 @@ final class Account extends VKAPIRequestHandler
function getCounters(string $filter = ""): object
{
$this->requireUser();
return (object) [
"friends" => $this->getUser()->getFollowersCount(),
"notifications" => $this->getUser()->getNotificationsCount(),

View file

@ -542,6 +542,8 @@ final class Wall extends VKAPIRequestHandler
}
function createComment(int $owner_id, int $post_id, string $message, int $from_group = 0) {
$this->requireUser();
$post = (new PostsRepo)->getPostById($owner_id, $post_id);
if(!$post || $post->isDeleted()) $this->fail(100, "One of the parameters specified was missing or invalid");