[GROUP] Simplify logic by making Actor::Organisation a type of Actor::Group

Some minor bug fixes
This commit is contained in:
2022-02-10 04:31:06 +00:00
parent 35e907f7b2
commit 1f1524c2b3
12 changed files with 106 additions and 402 deletions

View File

@@ -32,7 +32,6 @@ use App\Entity\Activity;
use App\Entity\Actor;
use App\Entity\LocalUser;
use Component\FreeNetwork\FreeNetwork;
use Component\Group\Entity\GroupInbox;
use Component\Notification\Controller\Feed;
class Notification extends Component
@@ -75,17 +74,9 @@ class Notification extends Component
$remote_targets = [];
foreach ($targets as $target) {
if ($target->getIsLocal()) {
if ($target->isGroup()) {
// FIXME: Make sure we check (for both local and remote) users are in the groups they send to!
DB::persist(GroupInbox::create([
'group_id' => $target->getId(),
'activity_id' => $activity->getId(),
]));
} else {
if ($target->hasBlocked($activity->getActor())) {
Log::info("Not saving reply to actor {$target->getId()} from sender {$sender->getId()} because of a block.");
continue;
}
if ($target->hasBlocked($activity->getActor())) {
Log::info("Not saving reply to actor {$target->getId()} from sender {$sender->getId()} because of a block.");
continue;
}
if (Event::handle('NewNotificationShould', [$activity, $target]) === Event::next) {
// TODO: use https://symfony.com/doc/current/notifier.html