mirror of
https://github.com/openvk/openvk
synced 2025-05-05 08:36:38 +03:00
fix: resolve issues related to API listens field, anonymous notifications, and UX bugs (#1279)
- Исправлено #1278 по идее - Добавил поле listens в апи (показывается только для своих треков) - Исправлен старинный баг, связанный с анонимкой (в уведомлении виден реальный автор) - Было неправильно добавлять ссылку на "избранное" в навигационное меню, поэтому она перенесена в настройки на довольно логичное место - Удалены некоторые импульсивности в коде и некоторые баги ux --------- Co-authored-by: Alexander Minkin <weryskok@gmail.com>
This commit is contained in:
parent
c54ccf6e28
commit
1d06a41b39
15 changed files with 48 additions and 23 deletions
|
@ -722,7 +722,7 @@ final class Wall extends VKAPIRequestHandler
|
|||
$post->attach($attachment);
|
||||
}
|
||||
|
||||
if ($owner_id > 0 && $owner_id !== $this->user->identity->getId()) {
|
||||
if ($owner_id > 0 && $owner_id !== $this->getUser()->getId()) {
|
||||
(new WallPostNotification($wallOwner, $post, $this->user->identity))->emit();
|
||||
}
|
||||
|
||||
|
@ -1176,8 +1176,9 @@ final class Wall extends VKAPIRequestHandler
|
|||
if ($from_group == 1 && $wallOwner instanceof Club && $wallOwner->canBeModifiedBy($this->getUser())) {
|
||||
$flags |= 0b10000000;
|
||||
}
|
||||
/*if($signed == 1)
|
||||
$flags |= 0b01000000;*/
|
||||
if ($post->isSigned() && $from_group == 1) {
|
||||
$flags |= 0b01000000;
|
||||
}
|
||||
|
||||
$post->setFlags($flags);
|
||||
$post->save(true);
|
||||
|
|
|
@ -435,6 +435,10 @@ class Audio extends Media
|
|||
$obj->keys = $this->getKeys();
|
||||
}
|
||||
|
||||
if ($obj->editable) {
|
||||
$obj->listens = $this->getListens();
|
||||
}
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,14 +168,13 @@ class Notification
|
|||
case 19:
|
||||
$info["type"] = "comment_video";
|
||||
$info["parent"] = $this->getModel(0)->toNotifApiStruct();
|
||||
$info["feedback"] = null; # айди коммента не сохраняется в бд( ну пиздец блять
|
||||
$info["feedback"] = null; # comment id is not saving at db
|
||||
break;
|
||||
case 13:
|
||||
$info["type"] = "comment_photo";
|
||||
$info["parent"] = $this->getModel(0)->toNotifApiStruct();
|
||||
$info["feedback"] = null;
|
||||
break;
|
||||
# unstandart (vk forgor about notes)
|
||||
case 10:
|
||||
$info["type"] = "comment_note";
|
||||
$info["parent"] = $this->getModel(0)->toVkApiStruct();
|
||||
|
|
|
@ -508,7 +508,7 @@ final class AudioPresenter extends OpenVKPresenter
|
|||
$title = $this->postParam("title");
|
||||
$description = $this->postParam("description");
|
||||
$is_unlisted = (int) $this->postParam('is_unlisted');
|
||||
$new_audios = !empty($this->postParam("audios")) ? explode(",", rtrim($this->postParam("audios"), ",")) : [];
|
||||
$new_audios = !empty($this->postParam("audios")) ? explode(",", rtrim($this->postParam("audios"), ",")) : null;
|
||||
|
||||
if (empty($title) || iconv_strlen($title) < 1) {
|
||||
$this->flashFail("err", tr("error"), tr("set_playlist_name"));
|
||||
|
@ -538,13 +538,15 @@ final class AudioPresenter extends OpenVKPresenter
|
|||
"collection" => $playlist->getId(),
|
||||
])->delete();
|
||||
|
||||
foreach ($new_audios as $new_audio) {
|
||||
$audio = (new Audios())->get((int) $new_audio);
|
||||
if (!$audio || $audio->isDeleted()) {
|
||||
continue;
|
||||
}
|
||||
if (!is_null($new_audios)) {
|
||||
foreach ($new_audios as $new_audio) {
|
||||
$audio = (new Audios())->get((int) $new_audio);
|
||||
if (!$audio || $audio->isDeleted()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$playlist->add($audio);
|
||||
$playlist->add($audio);
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_ajax) {
|
||||
|
|
|
@ -165,7 +165,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
|
|||
if ($type == 'post') {
|
||||
$this->template->_template = 'components/post.xml';
|
||||
$this->template->post = $post;
|
||||
$this->template->commentSection = false;
|
||||
$this->template->commentSection = true;
|
||||
} elseif ($type == 'comment') {
|
||||
$this->template->_template = 'components/comment.xml';
|
||||
$this->template->comment = $post;
|
||||
|
|
|
@ -321,7 +321,7 @@ final class PhotosPresenter extends OpenVKPresenter
|
|||
|
||||
$photos = [];
|
||||
if ((int) $this->postParam("count") > 10) {
|
||||
$this->flashFail("err", tr("no_photo"), "ты еблан", 500, true);
|
||||
$this->flashFail("err", tr("no_photo"), "Too many photos (max is 7-8)", 500, true);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $this->postParam("count"); $i++) {
|
||||
|
|
|
@ -42,7 +42,6 @@ final class SearchPresenter extends OpenVKPresenter
|
|||
$page = (int) ($this->queryParam("p") ?? 1);
|
||||
|
||||
# https://youtu.be/pSAWM5YuXx8
|
||||
# https://youtu.be/FfNZRhIn2Vk
|
||||
|
||||
$repos = [
|
||||
"groups" => "clubs",
|
||||
|
|
|
@ -409,7 +409,12 @@ final class WallPresenter extends OpenVKPresenter
|
|||
}
|
||||
|
||||
if ($wall > 0 && $wall !== $this->user->identity->getId()) {
|
||||
(new WallPostNotification($wallOwner, $post, $this->user->identity))->emit();
|
||||
$disturber = $this->user->identity;
|
||||
if ($anon) {
|
||||
$disturber = $post->getOwner();
|
||||
}
|
||||
|
||||
(new WallPostNotification($wallOwner, $post, $disturber))->emit();
|
||||
}
|
||||
|
||||
$excludeMentions = [$this->user->identity->getId()];
|
||||
|
|
|
@ -198,11 +198,11 @@
|
|||
</a>
|
||||
<a href="/settings" class="link">{_my_settings}</a>
|
||||
|
||||
{if $thisUser->getLeftMenuItemStatus('docs') || $thisUser->getLeftMenuItemStatus('apps') || $thisUser->getLeftMenuItemStatus('fave')}
|
||||
{if $thisUser->getLeftMenuItemStatus('docs') || $thisUser->getLeftMenuItemStatus('apps')}
|
||||
<div class="menu_divider"></div>
|
||||
<a n:if="$thisUser->getLeftMenuItemStatus('apps')" href="/apps?act=installed" class="link">{_apps}</a>
|
||||
<a n:if="$thisUser->getLeftMenuItemStatus('docs')" href="/docs" class="link">{_my_documents}</a>
|
||||
<a n:if="$thisUser->getLeftMenuItemStatus('fave')" href="/fave" class="link">{_bookmarks_tab}</a>
|
||||
{*<a n:if="$thisUser->getLeftMenuItemStatus('fave')" href="/fave" class="link">{_bookmarks_tab}</a>*}
|
||||
{/if}
|
||||
|
||||
{var $canAccessAdminPanel = $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}
|
||||
|
|
|
@ -120,6 +120,10 @@
|
|||
|
||||
<br/>
|
||||
<div class="settings_delete">
|
||||
<a href="/fave">{_bookmarks_tab}</a>
|
||||
•
|
||||
<a href="/search?section=posts&from_me=1">{_s_posts}</a>
|
||||
<br><br>
|
||||
{_you_can_also} <a onClick="showProfileDeactivateDialog({$csrfToken})">{_delete_your_page}</a>.
|
||||
</div>
|
||||
|
||||
|
@ -707,7 +711,7 @@
|
|||
<span class="nobold">{_my_documents}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr style="display:none;">
|
||||
<td width="120" valign="top" align="right" align="right">
|
||||
<input
|
||||
n:attr="checked => $user->getLeftMenuItemStatus('fave')"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{if !$attachment->isDeleted()}
|
||||
{var $link = "/photo" . ($attachment->isAnonymous() ? ("s/" . base_convert((string) $attachment->getId(), 10, 32)) : $attachment->getPrettyId())}
|
||||
<a href="{$link}" onclick="OpenMiniature(event, {$attachment->getURLBySizeId('larger')}, {$parent->getPrettyId()}, {$attachment->getPrettyId()}, {$parentType})">
|
||||
<img class="media media_makima" src="{$attachment->getURLBySizeId('normal')}" alt="{$attachment->getDescription()}" loading=lazy />
|
||||
<img n:class="media, $tilesCount > 1 ? media_makima" src="{$attachment->getURLBySizeId('normal')}" alt="{$attachment->getDescription()}" loading=lazy />
|
||||
</a>
|
||||
{else}
|
||||
<a href="javascript:alert('{_attach_no_longer_available}');">
|
||||
|
|
|
@ -11,6 +11,7 @@ body {
|
|||
font-size: 11px;
|
||||
word-break: break-word;
|
||||
word-wrap: break-word;
|
||||
line-height: 1.19;
|
||||
}
|
||||
|
||||
body, .ovk-fullscreen-dimmer, .ovk-photo-view-dimmer {
|
||||
|
|
|
@ -330,7 +330,9 @@ window.player = new class {
|
|||
this.__updateFace()
|
||||
u(this.audioPlayer).trigger('volumechange')
|
||||
|
||||
document.title = ovk_proc_strtr(escapeHtml(`${window.player.currentTrack.performer} — ${window.player.currentTrack.name}`), 255)
|
||||
if(this.isAtAudiosPage()) {
|
||||
document.title = ovk_proc_strtr(escapeHtml(`${window.player.currentTrack.performer} — ${window.player.currentTrack.name}`), 255)
|
||||
}
|
||||
}
|
||||
|
||||
hasContext() {
|
||||
|
|
|
@ -2470,8 +2470,7 @@ u(document).on('click', '#__sourceAttacher', (e) => {
|
|||
// Checking link
|
||||
const __checkCopyrightLinkRes = await fetch(`/method/wall.checkCopyrightLink?auth_mechanism=roaming&link=${encodeURIComponent(source_value)}`)
|
||||
const checkCopyrightLink = await __checkCopyrightLinkRes.json()
|
||||
|
||||
// todo переписать блять мессенджбоксы чтоб они классами были
|
||||
|
||||
if(checkCopyrightLink.error_code) {
|
||||
__removeDialog()
|
||||
switch(checkCopyrightLink.error_code) {
|
||||
|
|
|
@ -674,3 +674,12 @@ ul {
|
|||
.ovk-modal-player-window #ovk-player-info {
|
||||
background: #0e0b1a;
|
||||
}
|
||||
|
||||
.header_navigation #search_box #searchBoxFastTips {
|
||||
background: #181826;
|
||||
border-color: #2c2640;
|
||||
}
|
||||
|
||||
.header_navigation #search_box #searchBoxFastTips a:hover, .header_navigation #search_box #searchBoxFastTips a:focus {
|
||||
background: #111322;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue