Compare commits

...

8 commits

8 changed files with 18 additions and 12 deletions

View file

@ -18,6 +18,7 @@ define("NANOTON", 1000000000);
class FetchToncoinTransactions extends Command class FetchToncoinTransactions extends Command
{ {
private $images; private $images;
private $transactions;
protected static $defaultName = "fetch-ton"; protected static $defaultName = "fetch-ton";

View file

@ -13,6 +13,7 @@ class Wall implements Handler
protected $user; protected $user;
protected $posts; protected $posts;
protected $notes; protected $notes;
protected $videos;
public function __construct(?User $user) public function __construct(?User $user)
{ {

View file

@ -248,8 +248,9 @@ final class Board extends VKAPIRequestHandler
return 1; return 1;
} }
public function editComment(int $comment_id, int $group_id = 0, int $topic_id = 0, string $message, string $attachments) public function editComment(string $message, string $attachments, int $comment_id, int $group_id = 0, int $topic_id = 0)
{ {
# FIXME
/* /*
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();

View file

@ -45,7 +45,7 @@ final class Groups extends VKAPIRequestHandler
$clbsCount = $user->getClubCount(); $clbsCount = $user->getClubCount();
} }
$rClubs; $rClubs = array();
$ic = sizeof($clbs); $ic = sizeof($clbs);
if (sizeof($clbs) > $count) { if (sizeof($clbs) > $count) {

View file

@ -52,7 +52,7 @@ final class Newsfeed extends VKAPIRequestHandler
return $response; return $response;
} }
public function getGlobal(string $fields = "", int $start_from = 0, int $start_time = 0, int $end_time = 0, int $offset = 0, int $count = 30, int $extended = 0, int $rss = 0) public function getGlobal(string $fields = "", int $start_from = 0, int $start_time = 0, int $end_time = 0, int $offset = 0, int $count = 30, int $extended = 0, int $rss = 0, int $return_banned = 0)
{ {
$this->requireUser(); $this->requireUser();

View file

@ -185,12 +185,14 @@ final class Notes extends VKAPIRequestHandler
$this->fail(15, "Access denied"); $this->fail(15, "Access denied");
} }
$nodez = (object) [
"count" => 0,
"notes" => [],
];
if (empty($note_ids)) { if (empty($note_ids)) {
$nodez->count = (new NotesRepo())->getUserNotesCount($user);
$notes = array_slice(iterator_to_array((new NotesRepo())->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset); $notes = array_slice(iterator_to_array((new NotesRepo())->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset);
$nodez = (object) [
"count" => (new NotesRepo())->getUserNotesCount((new UsersRepo())->get($user_id)),
"notes" => [],
];
foreach ($notes as $note) { foreach ($notes as $note) {
if ($note->isDeleted()) { if ($note->isDeleted()) {
@ -210,6 +212,7 @@ final class Notes extends VKAPIRequestHandler
$note = (new NotesRepo())->getNoteById((int) $id[0], (int) $id[1]); $note = (new NotesRepo())->getNoteById((int) $id[0], (int) $id[1]);
if ($note && !$note->isDeleted()) { if ($note && !$note->isDeleted()) {
$nodez->notes[] = $note->toVkApiStruct(); $nodez->notes[] = $note->toVkApiStruct();
$nodez->count++;
} }
} }
} }

View file

@ -20,7 +20,7 @@ abstract class VKAPIRequestHandler
$this->platform = $platform; $this->platform = $platform;
} }
protected function fail(int $code, string $message): void protected function fail(int $code, string $message): never
{ {
throw new APIErrorException($message, $code); throw new APIErrorException($message, $code);
} }

View file

@ -478,8 +478,8 @@ return (function () {
define('YEAR', 365 * DAY); define('YEAR', 365 * DAY);
define("nullptr", null); define("nullptr", null);
define("OPENVK_DEFAULT_INSTANCE_NAME", "OpenVK", false); define("OPENVK_DEFAULT_INSTANCE_NAME", "OpenVK");
define("OPENVK_VERSION", "Altair Preview ($ver)", false); define("OPENVK_VERSION", "Altair Preview ($ver)");
define("OPENVK_DEFAULT_PER_PAGE", 10, false); define("OPENVK_DEFAULT_PER_PAGE", 10);
define("__OPENVK_ERROR_CLOCK_IN_FUTURE", "Server clock error: FK1200-DTF", false); define("__OPENVK_ERROR_CLOCK_IN_FUTURE", "Server clock error: FK1200-DTF");
}); });