mirror of
https://github.com/flarum/core.git
synced 2025-08-08 17:36:38 +02:00
fixed more attributes to match beta 8
This commit is contained in:
@@ -176,7 +176,7 @@ class Discussion extends AbstractModel
|
||||
public function hide(User $actor = null)
|
||||
{
|
||||
if (! $this->hidden_at) {
|
||||
$this->hidden_at = time();
|
||||
$this->hidden_at = Carbon::now();
|
||||
$this->hidden_user_id = $actor ? $actor->id : null;
|
||||
|
||||
$this->raise(new Hidden($this));
|
||||
|
@@ -92,7 +92,7 @@ class DiscussionPolicy extends AbstractPolicy
|
||||
// user, or the current user has permission to view hidden discussions.
|
||||
if (! $actor->hasPermission('discussion.hide')) {
|
||||
$query->where(function ($query) use ($actor) {
|
||||
$query->whereNull('discussions.hide_time')
|
||||
$query->whereNull('discussions.hidden_at')
|
||||
->orWhere('user_id', $actor->id)
|
||||
->orWhere(function ($query) use ($actor) {
|
||||
$this->events->fire(
|
||||
|
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Flarum\Discussion;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Flarum\Database\AbstractModel;
|
||||
use Flarum\Discussion\Event\UserRead;
|
||||
use Flarum\Foundation\EventGeneratorTrait;
|
||||
@@ -56,7 +57,7 @@ class UserState extends AbstractModel
|
||||
{
|
||||
if ($number > $this->last_read_at) {
|
||||
$this->last_read_at = $number;
|
||||
$this->last_read_at = time();
|
||||
$this->last_read_at = Carbon::now();
|
||||
|
||||
$this->raise(new UserRead($this));
|
||||
}
|
||||
|
Reference in New Issue
Block a user