1
0
Fork 0

Private forums are now working via ActivityPub

This commit is contained in:
Michael 2022-02-12 18:38:36 +00:00
commit e394143148
13 changed files with 97 additions and 154 deletions

View file

@ -223,10 +223,6 @@ class Notifier
$relay_to_owner = true;
}
if (($cmd === Delivery::UPLINK) && (intval($parent['forum_mode']) == 1) && !$top_level) {
$relay_to_owner = true;
}
// until the 'origin' flag has been in use for several months
// we will just use it as a fallback test
// later we will be able to use it as the primary test of whether or not to relay.
@ -333,15 +329,6 @@ class Notifier
$deny_people = $aclFormatter->expand($parent['deny_cid']);
$deny_groups = Group::expand($uid, $aclFormatter->expand($parent['deny_gid']));
// if our parent is a public forum (forum_mode == 1), uplink to the origional author causing
// a delivery fork. private groups (forum_mode == 2) do not uplink
/// @todo Possibly we should not uplink when the author is the forum itself?
if ((intval($parent['forum_mode']) == 1) && !$top_level && ($cmd !== Delivery::UPLINK)
&& ($target_item['verb'] != Activity::ANNOUNCE)) {
Worker::add($a->getQueueValue('priority'), 'Notifier', Delivery::UPLINK, $post_uriid, $sender_uid);
}
foreach ($items as $item) {
$recipients[] = $item['contact-id'];
// pull out additional tagged people to notify (if public message)
@ -813,15 +800,4 @@ class Notifier
return ['count' => $delivery_queue_count, 'contacts' => $contacts];
}
/**
* Check if the delivered item is a forum post
*
* @param array $item
* @return boolean
*/
public static function isForumPost(array $item)
{
return ($item['gravity'] == GRAVITY_PARENT) && !empty($item['forum_mode']);
}
}