mirror of
https://github.com/openvk/openvk
synced 2025-07-07 16:29:50 +03:00
requireUser in getCounters and createComment
This commit is contained in:
parent
5c734498c7
commit
2e327433a6
2 changed files with 4 additions and 0 deletions
|
@ -67,6 +67,8 @@ final class Account extends VKAPIRequestHandler
|
||||||
|
|
||||||
function getCounters(string $filter = ""): object
|
function getCounters(string $filter = ""): object
|
||||||
{
|
{
|
||||||
|
$this->requireUser();
|
||||||
|
|
||||||
return (object) [
|
return (object) [
|
||||||
"friends" => $this->getUser()->getFollowersCount(),
|
"friends" => $this->getUser()->getFollowersCount(),
|
||||||
"notifications" => $this->getUser()->getNotificationsCount(),
|
"notifications" => $this->getUser()->getNotificationsCount(),
|
||||||
|
|
|
@ -542,6 +542,8 @@ final class Wall extends VKAPIRequestHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
function createComment(int $owner_id, int $post_id, string $message, int $from_group = 0) {
|
function createComment(int $owner_id, int $post_id, string $message, int $from_group = 0) {
|
||||||
|
$this->requireUser();
|
||||||
|
|
||||||
$post = (new PostsRepo)->getPostById($owner_id, $post_id);
|
$post = (new PostsRepo)->getPostById($owner_id, $post_id);
|
||||||
if(!$post || $post->isDeleted()) $this->fail(100, "One of the parameters specified was missing or invalid");
|
if(!$post || $post->isDeleted()) $this->fail(100, "One of the parameters specified was missing or invalid");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue