From f1fdb15bb9f3647490869ce6616d8f0413f285c2 Mon Sep 17 00:00:00 2001
From: lalka2016 <99399973+lalka2016@users.noreply.github.com>
Date: Thu, 10 Aug 2023 11:28:48 +0300
Subject: [PATCH] Fihes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Теперь уведомление о принятии поста не приходит, если вы приняли свой же пост
Пофикшен баг перехода в предложку
Добавлен старый вид постов в предложке
Теперь счётчик постов в предложке у прикреплённой группы обновляется при принятии или отклонении поста
Убрано всплывающее уведомление об отклонении поста (оно раздражает)
Теперь если вы посмотрели все посты на одной странице (не на первой) и на ней не осталось постов, вас телепортирует на предыдущую страницу
---
ServiceAPI/Wall.php | 3 +-
VKAPI/Handlers/Wall.php | 4 +-
Web/Presenters/templates/@layout.xml | 2 +-
Web/Presenters/templates/Group/Suggested.xml | 7 ++-
.../components/notifications/7/_18_5_.xml | 2 +-
.../templates/components/post/oldpost.xml | 8 ++-
Web/static/js/al_wall.js | 53 ++++++++++++++++---
7 files changed, 65 insertions(+), 14 deletions(-)
diff --git a/ServiceAPI/Wall.php b/ServiceAPI/Wall.php
index 69397e2d..9c4b5e0e 100644
--- a/ServiceAPI/Wall.php
+++ b/ServiceAPI/Wall.php
@@ -155,7 +155,8 @@ class Wall implements Handler
$post->save();
- (new PostAcceptedNotification($author, $post, $post->getWallOwner()))->emit();
+ if($author->getId() != $this->user->getId())
+ (new PostAcceptedNotification($author, $post, $post->getWallOwner()))->emit();
$resolve(["id" => $post->getPrettyId(), "new_count" => $this->posts->getSuggestedPostsCount($post->getWallOwner()->getId())]);
}
diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php
index a8bf9721..058b40e6 100644
--- a/VKAPI/Handlers/Wall.php
+++ b/VKAPI/Handlers/Wall.php
@@ -472,7 +472,9 @@ final class Wall extends VKAPIRequestHandler
$post->setContent($message);
$post->save();
- (new PostAcceptedNotification($author, $post, $post->getWallOwner()))->emit();
+
+ if($author->getId() != $this->getUser()->getId())
+ (new PostAcceptedNotification($author, $post, $post->getWallOwner()))->emit();
return (object)["post_id" => $post->getVirtualId()];
}
diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml
index e9aecafb..8955daf0 100644
--- a/Web/Presenters/templates/@layout.xml
+++ b/Web/Presenters/templates/@layout.xml
@@ -219,7 +219,7 @@
{$club->getName()}
diff --git a/Web/Presenters/templates/Group/Suggested.xml b/Web/Presenters/templates/Group/Suggested.xml
index b3e4ad20..56e836ef 100644
--- a/Web/Presenters/templates/Group/Suggested.xml
+++ b/Web/Presenters/templates/Group/Suggested.xml
@@ -13,8 +13,13 @@
{else}