[COMPONENT][Attachment] Vinculate note information with attachment controllers

Various minor bug fixes
This commit is contained in:
2021-12-27 02:47:04 +00:00
parent fd44bc3ac5
commit c4dacd7626
18 changed files with 95 additions and 63 deletions

View File

@@ -380,7 +380,7 @@ class Note extends Entity
return false;
case VisibilityScope::GROUP:
// Only for the group to see
return DB::dql(
return !\is_null($actor) && DB::dql(
<<<'EOF'
select m from group_member m
join group_inbox i with m.group_id = i.group_id
@@ -392,7 +392,7 @@ class Note extends Entity
case VisibilityScope::COLLECTION:
case VisibilityScope::MESSAGE:
// Only for the collection to see
return in_array($actor->getId(), $this->getNotificationTargetIds());
return !\is_null($actor) && in_array($actor->getId(), $this->getNotificationTargetIds());
default:
Log::error("Unknown scope found: {$this->getScope()}.");
}