[PLUGIN][ActivityPub][Model][Note] Federate attentions out

This commit is contained in:
Diogo Peralta Cordeiro 2022-02-19 04:45:33 +00:00
parent 8cf60275e6
commit 8f60fc4685
No known key found for this signature in database
GPG Key ID: 18D2D35001FBFAB0

View File

@ -40,6 +40,7 @@ use App\Core\Event;
use App\Core\GSFile;
use App\Core\HTTPClient;
use App\Entity\NoteType;
use Component\Notification\Entity\Attention;
use function App\Core\I18n\_m;
use App\Core\Log;
use App\Core\Router\Router;
@ -370,6 +371,11 @@ class Note extends Model
throw new ServerException('Found an unknown visibility scope which cannot federate.');
}
$attention_cc = DB::findBy(Attention::class, ['note_id' => $object->getId()]);
foreach($attention_cc as $cc_id) {
$attr['cc'][] = \App\Entity\Actor::getById($cc_id->getTargetId())->getUri(Router::ABSOLUTE_URL);
}
// Mentions
foreach ($object->getNotificationTargets() as $mention) {
$attr['tag'][] = [