Fix wall bugs spawned after recent change in chandler

This commit is contained in:
celestora 2022-10-11 21:08:21 +03:00
parent 499ab3f758
commit 5b5f64997b
3 changed files with 6 additions and 9 deletions

View file

@ -45,9 +45,6 @@ final class WallPresenter extends OpenVKPresenter
function renderWall(int $user, bool $embedded = false): void
{
if(false)
exit(tr("forbidden") . ": " . (string) random_int(0, 255));
$owner = ($user < 0 ? (new Clubs) : (new Users))->get(abs($user));
if(is_null($this->user)) {
$canPost = false;
@ -66,7 +63,10 @@ final class WallPresenter extends OpenVKPresenter
}
if ($embedded == true) $this->template->_template = "components/wall.xml";
$this->template->oObj = $owner;
$this->template->oObj = $owner;
if($user < 0)
$this->template->club = $owner;
$this->template->owner = $user;
$this->template->canPost = $canPost;
$this->template->count = $this->posts->getPostCountOnUserWall($user);
@ -89,9 +89,6 @@ final class WallPresenter extends OpenVKPresenter
function renderRSS(int $user): void
{
if(false)
exit(tr("forbidden") . ": " . (string) random_int(0, 255));
$owner = ($user < 0 ? (new Clubs) : (new Users))->get(abs($user));
if(is_null($this->user)) {
$canPost = false;

View file

@ -16,7 +16,7 @@
</div>
<div n:class="postFeedWrapper, $thisUser->hasMicroblogEnabled() ? postFeedWrapperMicroblog">
{include "../components/textArea.xml", route => "/wall" . $thisUser->getId() . "/makePost"}
{include "../components/textArea.xml", route => "/wall" . $thisUser->getId() . "/makePost", graffiti => true, polls => true}
</div>
{foreach $posts as $post}

View file

@ -16,7 +16,6 @@
</div>
<div n:if="$postOpts ?? true" class="post-opts">
{var $anonEnabled = OPENVK_ROOT_CONF['openvk']['preferences']['wall']['anonymousPosting']['enable']}
{if !is_null($thisUser) && !is_null($club ?? NULL) && $owner < 0}
{if $club->canBeModifiedBy($thisUser)}
<script>
@ -46,6 +45,7 @@
<input type="checkbox" name="nsfw" /> {_contains_nsfw}
</label>
</div>
<div n:if="!($postOpts ?? true) && !is_null($thisUser) && !is_null($club ?? NULL) && $club->canBeModifiedBy($thisUser)" class="post-opts">
<label>
<input type="checkbox" name="as_group" /> {_comment_as_group}