use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
+use Friendica\Model\Attach;
use Friendica\Model\Contact;
use Friendica\Model\Conversation;
use Friendica\Model\FileTag;
use Friendica\Model\Item;
use Friendica\Model\Photo;
-use Friendica\Model\Attach;
use Friendica\Model\Term;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\Email;
use Friendica\Util\Emailer;
use Friendica\Util\Security;
use Friendica\Util\Strings;
+use Friendica\Worker\Delivery;
require_once 'include/items.php';
}
// 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::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA, Protocol::DFRN]);
+ $allow_comment = local_user() && ($profile_uid == 0) && $toplevel_item_id && in_array($toplevel_item['network'], Protocol::FEDERATED);
// Now check that valid personal details have been provided
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
}
}
- if (!empty($categories))
- {
+ if (!empty($categories)) {
// get the "fileas" tags for this post
- $filedas = FileTag::fileToList($categories, 'file');
+ $filedas = FileTag::fileToArray($categories);
}
// save old and new categories, so we can determine what needs to be deleted from pconfig
$categories = FileTag::listToFile(trim(defaults($_REQUEST, 'category', '')), 'category');
$categories_new = $categories;
- if (!empty($filedas))
- {
+ if (!empty($filedas) && is_array($filedas)) {
// append the fileas stuff to the new categories list
- $categories .= FileTag::listToFile($filedas, 'file');
+ $categories .= FileTag::arrayToFile($filedas);
}
// get contact info for poster
$origin = $_REQUEST['origin'];
}
- $notify_type = ($toplevel_item_id ? 'comment-new' : 'wall-new');
-
$uri = ($message_id ? $message_id : Item::newURI($api_source ? $profile_uid : $uid, $guid));
// Fallback so that we alway have a parent uri
// When we are doing some forum posting via ! we have to start the notifier manually.
// These kind of posts don't initiate the notifier call in the item class.
if ($only_to_forum) {
- Worker::add(PRIORITY_HIGH, "Notifier", $notify_type, $post_id);
+ Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post_id);
}
Logger::log('post_complete');