<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Module\Item;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Item;
{
$l10n = DI::l10n();
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
}
throw new HTTPException\NotFoundException();
}
- $ignored = !Post\ThreadUser::getIgnored($thread['uri-id'], local_user());
+ $ignored = !Post\ThreadUser::getIgnored($thread['uri-id'], DI::userSession()->getLocalUserId());
- if (in_array($thread['uid'], [0, local_user()])) {
- Post\ThreadUser::setIgnored($thread['uri-id'], local_user(), $ignored);
+ if (in_array($thread['uid'], [0, DI::userSession()->getLocalUserId()])) {
+ Post\ThreadUser::setIgnored($thread['uri-id'], DI::userSession()->getLocalUserId(), $ignored);
} else {
throw new HTTPException\BadRequestException();
}