Set the group as owner for "group only" postings
This commit is contained in:
@@ -537,6 +537,14 @@ class Item
|
|||||||
$item['private'] = $private_group ? ItemModel::PRIVATE : ItemModel::UNLISTED;
|
$item['private'] = $private_group ? ItemModel::PRIVATE : ItemModel::UNLISTED;
|
||||||
|
|
||||||
if ($only_to_group) {
|
if ($only_to_group) {
|
||||||
|
$cdata = Contact::getPublicAndUserContactID($group_contact['id'], $item['uid']);
|
||||||
|
if (!empty($cdata['user'])) {
|
||||||
|
$item['owner-id'] = $cdata['user'];
|
||||||
|
unset($item['owner-link']);
|
||||||
|
unset($item['owner-name']);
|
||||||
|
unset($item['owner-avatar']);
|
||||||
|
}
|
||||||
|
|
||||||
$item['postopts'] = '';
|
$item['postopts'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -440,7 +440,8 @@ class Processor
|
|||||||
if (($actor['type'] ?? 'Person') == 'Group') {
|
if (($actor['type'] ?? 'Person') == 'Group') {
|
||||||
Logger::debug('Group post detected via audience.', ['audience' => $audience, 'actor' => $activity['actor'], 'author' => $activity['author']]);
|
Logger::debug('Group post detected via audience.', ['audience' => $audience, 'actor' => $activity['actor'], 'author' => $activity['author']]);
|
||||||
$item['isGroup'] = true;
|
$item['isGroup'] = true;
|
||||||
$item['group-link'] = $audience;
|
$item['group-link'] = $item['owner-link'] = $audience;
|
||||||
|
$item['owner-id'] = Contact::getIdForURL($audience);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user