mirror of
https://github.com/friendica/friendica
synced 2024-12-23 12:40:17 +00:00
Use the follower collection
This commit is contained in:
parent
b7744ae3eb
commit
71cbe56293
1 changed files with 16 additions and 6 deletions
|
@ -216,7 +216,7 @@ class ActivityPub
|
|||
return $data;
|
||||
}
|
||||
|
||||
private static function fetchTargetInboxesFromConversation($item)
|
||||
private static function fetchTargetInboxesFromConversation($item, $uid)
|
||||
{
|
||||
if (empty($item['thr-parent'])) {
|
||||
return [];
|
||||
|
@ -244,6 +244,15 @@ class ActivityPub
|
|||
$activity[$element] = [$activity[$element]];
|
||||
}
|
||||
foreach ($activity[$element] as $receiver) {
|
||||
if ($receiver == $profile['followers']) {
|
||||
$contacts = DBA::select('contact', ['notify', 'batch'], ['uid' => $uid,
|
||||
'rel' => [Contact::FOLLOWER, Contact::FRIEND], 'network' => Protocol::ACTIVITYPUB]);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
$contact = defaults($contact, 'batch', $contact['notify']);
|
||||
$inboxes[$contact] = $contact;
|
||||
}
|
||||
DBA::close($contacts);
|
||||
} else {
|
||||
$profile = self::fetchprofile($receiver);
|
||||
if (!empty($profile)) {
|
||||
$target = defaults($profile, 'sharedinbox', $profile['inbox']);
|
||||
|
@ -251,12 +260,13 @@ class ActivityPub
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $inboxes;
|
||||
}
|
||||
|
||||
public static function fetchTargetInboxes($item, $uid)
|
||||
{
|
||||
$inboxes = self::fetchTargetInboxesFromConversation($item);
|
||||
$inboxes = self::fetchTargetInboxesFromConversation($item, $uid);
|
||||
|
||||
$parents = Item::select(['author-link', 'owner-link'], ['parent' => $item['parent']]);
|
||||
while ($parent = Item::fetch($parents)) {
|
||||
|
|
Loading…
Reference in a new issue