use Friendica\Network\HTTPException;
use Friendica\Object\EMail\ItemCCEMail;
use Friendica\Protocol\Activity;
-use Friendica\Protocol\Diaspora;
use Friendica\Security\Security;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\ParseUrl;
}
// Allow commenting if it is an answer to a public post
- $allow_comment = local_user() && ($profile_uid == 0) && $toplevel_item_id && in_array($toplevel_item['network'], Protocol::FEDERATED);
+ $allow_comment = local_user() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
// Now check that valid personal details have been provided
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
+ Logger::notice('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
notice(DI::l10n()->t('Permission denied.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
$filedas = FileTag::fileToArray($categories);
}
- $categories = FileTag::listToFile(trim($_REQUEST['category'] ?? ''), 'category');
+ $list_array = explode(',', trim($_REQUEST['category'] ?? ''));
+ $categories = FileTag::arrayToFile($list_array, 'category');
if (!empty($filedas) && is_array($filedas)) {
// append the fileas stuff to the new categories list
$datarray["uri-id"] = -1;
$datarray["author-network"] = Protocol::DFRN;
- $o = conversation($a, [array_merge($contact_record, $datarray)], 'search', false, true);
+ $o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true);
System::jsonExit(['preview' => $o]);
}
Hook::callAll('post_local',$datarray);
if (!empty($_REQUEST['scheduled_at'])) {
- $scheduled_at = DateTimeFormat::convert($_REQUEST['scheduled_at'], 'UTC', $a->getTimezone());
+ $scheduled_at = DateTimeFormat::convert($_REQUEST['scheduled_at'], 'UTC', $a->getTimeZone());
if ($scheduled_at > DateTimeFormat::utcNow()) {
unset($datarray['created']);
unset($datarray['edited']);
// These notifications are sent if someone else is commenting other your wall
if ($contact_record != $author) {
if ($toplevel_item_id) {
- notification([
+ DI::notify()->createFromArray([
'type' => Notification\Type::COMMENT,
'otype' => Notification\ObjectType::ITEM,
'verb' => Activity::POST,
'link' => DI::baseUrl() . '/display/' . urlencode($datarray['guid']),
]);
} elseif (empty($forum_contact)) {
- notification([
+ DI::notify()->createFromArray([
'type' => Notification\Type::WALL,
'otype' => Notification\ObjectType::ITEM,
'verb' => Activity::POST,
item_redirect_after_action($item, $return);
} else {
+ Logger::notice('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']);
//NOTREACHED