Compare commits

..

2 commits

4 changed files with 23 additions and 6 deletions

View file

@ -45,9 +45,7 @@ final class Account extends VKAPIRequestHandler
{
$this->requireUser();
$this->getUser()->setOnline(time());
$this->getUser()->setClient_name($this->getPlatform());
$this->getUser()->save();
$this->getUser()->updOnline($this->getPlatform());
return 1;
}

View file

@ -65,11 +65,16 @@ final class Messages extends VKAPIRequestHandler
];
}
function send(int $user_id = -1, int $peer_id = -1, string $domain = "", int $chat_id = -1, string $user_ids = "", string $message = "", int $sticker_id = -1)
function send(int $user_id = -1, int $peer_id = -1, string $domain = "", int $chat_id = -1, string $user_ids = "", string $message = "", int $sticker_id = -1, int $forGodSakePleaseDoNotReportAboutMyOnlineActivity = 0)
{
$this->requireUser();
$this->willExecuteWriteAction();
if($forGodSakePleaseDoNotReportAboutMyOnlineActivity == 0)
{
$this->getUser()->updOnline($this->getPlatform());
}
if($chat_id !== -1)
$this->fail(946, "Chats are not implemented");
else if($sticker_id !== -1)

View file

@ -7,9 +7,14 @@ use openvk\VKAPI\Handlers\Wall;
final class Newsfeed extends VKAPIRequestHandler
{
function get(string $fields = "", int $start_from = 0, int $offset = 0, int $count = 30, int $extended = 0)
function get(string $fields = "", int $start_from = 0, int $offset = 0, int $count = 30, int $extended = 0, int $forGodSakePleaseDoNotReportAboutMyOnlineActivity = 0)
{
$this->requireUser();
if($forGodSakePleaseDoNotReportAboutMyOnlineActivity == 0)
{
$this->getUser()->updOnline($this->getPlatform());
}
$id = $this->getUser()->getId();
$subs = DatabaseConnection::i()

View file

@ -1009,6 +1009,15 @@ class User extends RowModel
return true;
}
function updOnline(string $platform): bool
{
$this->setOnline(time());
$this->setClient_name($platform);
$this->save();
return true;
}
function changeEmail(string $email): void
{
DatabaseConnection::i()->getContext()->table("ChandlerUsers")