mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
Prevent sending forum posts via AP
This commit is contained in:
parent
2c97e2190b
commit
25ea15de64
2 changed files with 35 additions and 5 deletions
|
@ -475,7 +475,7 @@ class Notifier
|
|||
continue;
|
||||
}
|
||||
|
||||
if (self::skipDFRN($rr, $target_item, $parent, $thr_parent, $cmd)) {
|
||||
if (self::skipDFRN($rr, $target_item, $parent, $thr_parent, $owner, $cmd)) {
|
||||
Logger::info('Contact can be delivered via AP, so skip delivery via legacy DFRN/Diaspora', ['id' => $target_id, 'url' => $rr['url']]);
|
||||
continue;
|
||||
}
|
||||
|
@ -530,7 +530,7 @@ class Notifier
|
|||
continue;
|
||||
}
|
||||
|
||||
if (self::skipDFRN($contact, $target_item, $parent, $thr_parent, $cmd)) {
|
||||
if (self::skipDFRN($contact, $target_item, $parent, $thr_parent, $owner, $cmd)) {
|
||||
Logger::info('Contact can be delivered via AP, so skip delivery via legacy DFRN/Diaspora', ['target' => $target_id, 'url' => $contact['url']]);
|
||||
continue;
|
||||
}
|
||||
|
@ -648,12 +648,13 @@ class Notifier
|
|||
* @param array $item The post
|
||||
* @param array $parent The parent
|
||||
* @param array $thr_parent The thread parent
|
||||
* @param array $owner Owner array
|
||||
* @param string $cmd Notifier command
|
||||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
private static function skipDFRN($contact, $item, $parent, $thr_parent, $cmd)
|
||||
private static function skipDFRN($contact, $item, $parent, $thr_parent, $owner, $cmd)
|
||||
{
|
||||
if (empty($parent['network'])) {
|
||||
return false;
|
||||
|
@ -684,6 +685,12 @@ class Notifier
|
|||
return false;
|
||||
}
|
||||
|
||||
// For the time being we always deliver forum post via DFRN if possible
|
||||
// This can be removed possible at the end of 2020 when hopefully most system can process AP forum posts
|
||||
if ($owner['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We deliver reshares via AP whenever possible
|
||||
if (ActivityPub\Transmitter::isAnnounce($item)) {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue