]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Ensure *toArray returns an array
[friendica.git] / mod / item.php
index 1fccbca4d6b85fa072729b6bad8005027998c26d..fff4f712c3bea2a4387aaa77e8f00c72a4bcb988 100644 (file)
@@ -163,7 +163,7 @@ function item_post(App $a) {
        }
 
        // 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) {
@@ -604,8 +604,6 @@ function item_post(App $a) {
                $origin = $_REQUEST['origin'];
        }
 
-       $notify_type = ($toplevel_item_id ? Delivery::COMMENT : Delivery::POST);
-
        $uri = ($message_id ? $message_id : Item::newURI($api_source ? $profile_uid : $uid, $guid));
 
        // Fallback so that we alway have a parent uri
@@ -870,7 +868,7 @@ function item_post(App $a) {
        // 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');