Disallow posting to restricted groups

This commit is contained in:
Michael 2024-08-24 14:07:59 +00:00
parent a3a8b6c9ec
commit dace658d5d
3 changed files with 29 additions and 15 deletions

View file

@ -86,7 +86,7 @@ class Conversations extends BaseModule
throw new NotFoundException($this->t('Contact not found.'));
}
$contact = Model\Contact::getById($pcid);
$contact = Model\Contact::getAccountById($pcid);
if (empty($contact)) {
throw new NotFoundException($this->t('Contact not found.'));
}
@ -111,13 +111,15 @@ class Conversations extends BaseModule
Nav::setSelected('contact');
$options = [
'lockstate' => ACL::getLockstateForUserId($this->userSession->getLocalUserId()) ? 'lock' : 'unlock',
'acl' => ACL::getFullSelectorHTML($this->page, $this->userSession->getLocalUserId(), true, []),
'bang' => '',
'content' => ($contact['contact-type'] == ModelContact::TYPE_COMMUNITY ? '!' : '@') . ($contact['addr'] ?: $contact['url']),
];
$o = $this->conversation->statusEditor($options);
if (!$contact['ap-posting-restricted']) {
$options = [
'lockstate' => ACL::getLockstateForUserId($this->userSession->getLocalUserId()) ? 'lock' : 'unlock',
'acl' => ACL::getFullSelectorHTML($this->page, $this->userSession->getLocalUserId(), true, []),
'bang' => '',
'content' => ($contact['contact-type'] == ModelContact::TYPE_COMMUNITY ? '!' : '@') . ($contact['addr'] ?: $contact['url']),
];
$o = $this->conversation->statusEditor($options);
}
$o .= Contact::getTabsHTML($contact, Contact::TAB_CONVERSATIONS);
$o .= Model\Contact::getThreadsFromId($contact['id'], $this->userSession->getLocalUserId(), 0, 0, $request['last_created'] ?? '');