mirror of
https://github.com/friendica/friendica
synced 2025-05-01 09:44:23 +02:00
More rework to make private communities working
This commit is contained in:
parent
6c0dbc1775
commit
9ac24a0f36
8 changed files with 79 additions and 67 deletions
|
@ -235,13 +235,13 @@ class Notifier
|
|||
}
|
||||
|
||||
// Special treatment for forum posts
|
||||
if (Item::isForumPost($target_item, $owner)) {
|
||||
if (Item::isForumPost($target_item['uri-id'])) {
|
||||
$relay_to_owner = true;
|
||||
$direct_forum_delivery = true;
|
||||
}
|
||||
|
||||
// Avoid that comments in a forum thread are sent to OStatus
|
||||
if (Item::isForumPost($parent, $owner)) {
|
||||
if (Item::isForumPost($parent['uri-id'])) {
|
||||
$direct_forum_delivery = true;
|
||||
}
|
||||
|
||||
|
@ -729,6 +729,14 @@ class Notifier
|
|||
|
||||
$uid = $target_item['contact-uid'] ?: $target_item['uid'];
|
||||
|
||||
// Update the locally stored follower list when we deliver to a forum
|
||||
foreach (Tag::getByURIId($target_item['uri-id'], [Tag::EXCLUSIVE_MENTION]) as $tag) {
|
||||
$target_contact = Contact::getByURL(Strings::normaliseLink($tag['url']), null, [], $uid);
|
||||
if (($target_contact['contact-type'] == Contact::TYPE_COMMUNITY) && $target_contact['manually-approve']) {
|
||||
Group::getMembersForForum($target_contact['id']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($target_item['origin']) {
|
||||
$inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid);
|
||||
|
||||
|
@ -738,9 +746,6 @@ class Notifier
|
|||
}
|
||||
|
||||
Logger::info('Origin item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.');
|
||||
} elseif (Item::isForumPost($target_item, $owner)) {
|
||||
$inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid, false, 0, true);
|
||||
Logger::info('Forum item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.');
|
||||
} elseif (!DBA::exists('conversation', ['item-uri' => $target_item['uri'], 'protocol' => Conversation::PARCEL_ACTIVITYPUB])) {
|
||||
Logger::info('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' is no AP post. It will not be distributed.');
|
||||
return ['count' => 0, 'contacts' => []];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue