diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php index 3aa91312..26748d73 100644 --- a/Web/Models/Entities/Club.php +++ b/Web/Models/Entities/Club.php @@ -130,6 +130,11 @@ class Club extends RowModel return $this->getRecord()->administrators_list_display; } + function isEveryoneCanCreateTopics(): bool + { + return (bool) $this->getRecord()->everyone_can_create_topics; + } + function getType(): int { return $this->getRecord()->type; diff --git a/Web/Models/Entities/Comment.php b/Web/Models/Entities/Comment.php index f9422761..884fdf47 100644 --- a/Web/Models/Entities/Comment.php +++ b/Web/Models/Entities/Comment.php @@ -34,8 +34,13 @@ class Comment extends Post */ function getOwner(bool $honourFlags = true, bool $real = false): RowModel { - if($honourFlags && $this->isPostedOnBehalfOfGroup() && $this->getTarget() instanceof Post) - return (new Clubs)->get(abs($this->getTarget()->getTargetWall())); + if($honourFlags && $this->isPostedOnBehalfOfGroup()) { + if($this->getTarget() instanceof Post) + return (new Clubs)->get(abs($this->getTarget()->getTargetWall())); + + if($this->getTarget() instanceof Topic) + return $this->getTarget()->getClub(); + } return parent::getOwner($honourFlags, $real); }