Compare commits

...

12 commits

Author SHA1 Message Date
ZAZiOs
4909a6f245
Merge 1aec136842 into a3634c19cf 2025-06-18 21:53:34 +00:00
ZAZiOs
1aec136842
Remove JSON_PRETTY_PRINT flag 2025-06-19 00:53:32 +03:00
ZAZiOs
1a3ffa6507
Trying to fix lint issues 2025-06-19 00:34:57 +03:00
ZAZiOs
bc07c9bfe7
лучше оставить айди группы 2025-06-12 16:29:35 +03:00
ZAZiOs
caad031315 Added OVK Native to clients.xml 2025-06-12 16:11:20 +03:00
ZAZiOs
d56cc74f7d
to snake case 2025-06-12 15:49:05 +03:00
ZAZiOs
dc9b448505
to snake case 2025-06-12 15:48:05 +03:00
ZAZiOs
de0a0937b1
tabulation fix 2025-06-12 00:51:28 +03:00
ZAZiOs
0d2a015ae7 API: can_edit can_delete comments 2025-06-12 00:42:27 +03:00
ZAZiOs
ad94b770e1 API: add field bdate to users 2025-06-12 00:20:01 +03:00
ZAZiOs
317945eabc add /.well-known/assetlinks.json
Needed by android apps to automatically verify if the app is allowed to open links from this instance.
2025-06-11 23:47:05 +03:00
ZAZiOs
7cde47f2ac add openvk native support 2025-06-11 23:41:12 +03:00
8 changed files with 60 additions and 1 deletions

View file

@ -317,6 +317,32 @@ final class Users extends VKAPIRequestHandler
$response[$i]->custom_fields = $append_array;
break;
case "bdate":
if (!$canView) {
$response[$i]->bdate = "01.01.1970";
break;
}
$visibility = $usr->getBirthdayPrivacy();
$response[$i]->bdate_visibility = $visibility;
$birthday = $usr->getBirthday();
if ($birthday) {
switch ($visibility) {
case 1:
$response[$i]->bdate = $birthday->format('%d.%m');
break;
case 2:
$response[$i]->bdate = $birthday->format('%d.%m.%Y');
break;
case 0:
default:
$response[$i]->bdate = null;
break;
}
} else {
$response[$i]->bdate = null;
}
break;
}
}

View file

@ -873,6 +873,8 @@ final class Wall extends VKAPIRequestHandler
"id" => $comment->getId(),
"from_id" => $oid,
"date" => $comment->getPublicationTime()->timestamp(),
"can_edit" => $post->canBeEditedBy($this->getUser()),
"can_delete" => $post->canBeDeletedBy($this->getUser()),
"text" => $comment->getText(false),
"post_id" => $post->getVirtualId(),
"owner_id" => method_exists($post, 'isPostedOnBehalfOfGroup') && $post->isPostedOnBehalfOfGroup() ? $post->getOwner()->getId() * -1 : $post->getOwner()->getId(),

View file

@ -176,11 +176,13 @@ class Post extends Postable
$platform = $this->getRecord()->api_source_name;
if ($forAPI) {
switch ($platform) {
case 'openvk_native':
case 'openvk_refresh_android':
case 'openvk_legacy_android':
return 'android';
break;
case 'openvk_native_ios':
case 'openvk_ios':
case 'openvk_legacy_ios':
return 'iphone';

View file

@ -971,11 +971,13 @@ class User extends RowModel
$platform = $this->getRecord()->client_name;
if ($forAPI) {
switch ($platform) {
case 'openvk_native':
case 'openvk_refresh_android':
case 'openvk_legacy_android':
return 'android';
break;
case 'openvk_native_ios':
case 'openvk_ios':
case 'openvk_legacy_ios':
return 'iphone';

View file

@ -147,6 +147,29 @@ final class AboutPresenter extends OpenVKPresenter
$this->redirect("https://github.com/openvk/openvk#readme");
}
public function renderAssetLinksJSON(): void
{
# Необходимо любому андроид приложению для автоматического разрешения принимать ссылки с этого сайта.
# Не шарю как писать норм на php поэтому тут чутка на вайбкодил - искренне ваш, ZAZiOs.
header("Content-Type: application/json");
$data = [
[
"relation" => ["delegate_permission/common.handle_all_urls"],
"target" => [
"namespace" => "android_app",
"package_name" => "oss.OpenVK.Native",
"sha256_cert_fingerprints" => [
"79:67:14:23:DC:6E:FA:49:64:1F:F1:81:0E:B0:A3:AE:6E:88:AB:0D:CF:BC:02:96:F3:6D:76:6B:82:94:D6:9C",
],
],
],
];
echo json_encode($data, JSON_UNESCAPED_SLASHES);
exit;
}
public function renderDev(): void
{
$this->redirect("https://docs.ovk.to/");

View file

@ -407,6 +407,8 @@ routes:
handler: "About->robotsTxt"
- url: "/humans.txt"
handler: "About->humansTxt"
- url: "/.well-known/assetlinks.json"
handler: "About->AssetLinksJSON"
- url: "/dev"
handler: "About->dev"
- url: "/iapi/getPhotosFromPost/{num}_{num}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -3,4 +3,6 @@
<Client tag="vk4me" name="VK4ME" url="http://vk4me.crx.moe/" img="/assets/packages/static/openvk/img/app_icons/vk4me.png" />
<Client tag="openvk_legacy_android" name="OpenVK Legacy" url="https://f-droid.org/packages/uk.openvk.android.legacy/" img="/assets/packages/static/openvk/img/app_icons/openvk_legacy.png" />
<Client tag="openvk_refresh_android" name="OpenVK Refresh" url="https://github.com/openvk/mobile-android-refresh" img="/assets/packages/static/openvk/img/app_icons/openvk_refresh.png" />
</Clients>
<Client tag="openvk_native" name="OpenVK Native" url="https://ovk.to/club9628" img="/assets/packages/static/openvk/img/app_icons/openvk_native.png" />
<Client tag="openvk_native_ios" name="OpenVK Native" url="https://ovk.to/club9628" img="/assets/packages/static/openvk/img/app_icons/openvk_native.png" />
</Clients>