From 22952f88ca6aec54240038fb5484dd35b9369841 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 Feb 2022 19:45:27 +0000 Subject: [PATCH] SImplify code --- src/Protocol/ActivityPub/Transmitter.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index c65265396..0e16884b4 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -702,15 +702,13 @@ class Transmitter } foreach (['to' => Tag::TO, 'cc' => Tag::CC, 'bcc' => Tag::BCC] as $element => $type) { - if (!empty($receivers[$element])) { - foreach ($receivers[$element] as $receiver) { - if ($receiver == ActivityPub::PUBLIC_COLLECTION) { - $name = Receiver::PUBLIC_COLLECTION; - } else { - $name = trim(parse_url($receiver, PHP_URL_PATH), '/'); - } - Tag::store($item['uri-id'], $type, $name, $receiver); + foreach ($receivers[$element] as $receiver) { + if ($receiver == ActivityPub::PUBLIC_COLLECTION) { + $name = Receiver::PUBLIC_COLLECTION; + } else { + $name = trim(parse_url($receiver, PHP_URL_PATH), '/'); } + Tag::store($item['uri-id'], $type, $name, $receiver); } }