1
1
Fork 0

Issue 7315: Changed handling of "Group" posts

This commit is contained in:
Michael 2019-07-15 20:05:36 +00:00
parent b0e06699da
commit 1a213bd8e8

View file

@ -386,15 +386,14 @@ class Receiver
case 'as:Announce': case 'as:Announce':
if (in_array($object_data['object_type'], self::CONTENT_TYPES)) { if (in_array($object_data['object_type'], self::CONTENT_TYPES)) {
$profile = APContact::getByURL($object_data['actor']); $profile = APContact::getByURL($object_data['actor']);
if ($profile['type'] == 'Person') {
// Reshared posts from persons appear as summary at the bottom // Reshared posts from persons appear as summary at the bottom
// If this isn't set, then a single reshare appears on top. This is used for groups. // If this isn't set, then a single reshare appears on top. This is used for groups.
$object_data['thread-completion'] = true; $object_data['thread-completion'] = ($profile['type'] != 'Group');
}
ActivityPub\Processor::createItem($object_data); ActivityPub\Processor::createItem($object_data);
// Add the bottom reshare information only for persons // Add the bottom reshare information only for persons
if ($profile['type'] == 'Person') { if ($profile['type'] != 'Group') {
$announce_object_data = self::processObject($activity); $announce_object_data = self::processObject($activity);
$announce_object_data['name'] = $type; $announce_object_data['name'] = $type;
$announce_object_data['author'] = JsonLD::fetchElement($activity, 'as:actor', '@id'); $announce_object_data['author'] = JsonLD::fetchElement($activity, 'as:actor', '@id');