]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Merge pull request #6515 from annando/connector-posts
[friendica.git] / src / Model / Item.php
index f18ca088f97778641ce0321bf311d4def44d98c6..67071db31817d315b25b7a10b00d8f9b23cf3387 100644 (file)
@@ -1252,6 +1252,8 @@ class Item extends BaseObject
        {
                $orig_item = $item;
 
+               $priority = PRIORITY_HIGH;
+
                // If it is a posting where users should get notifications, then define it as wall posting
                if ($notify) {
                        $item['wall'] = 1;
@@ -1261,8 +1263,6 @@ class Item extends BaseObject
 
                        if (is_int($notify)) {
                                $priority = $notify;
-                       } else {
-                               $priority = PRIORITY_HIGH;
                        }
                } else {
                        $item['network'] = trim(defaults($item, 'network', Protocol::PHANTOM));
@@ -1790,13 +1790,13 @@ class Item extends BaseObject
                        DBA::insert('diaspora-interaction', ['uri-id' => $item['uri-id'], 'interaction' => $diaspora_signed_text], true);
                }
 
-               $deleted = self::tagDeliver($item['uid'], $current_post);
+               self::tagDeliver($item['uid'], $current_post);
 
                /*
                 * current post can be deleted if is for a community page and no mention are
                 * in it.
                 */
-               if (!$deleted && !$dontcache) {
+               if (!$dontcache) {
                        $posted_item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $current_post]);
                        if (DBA::isResult($posted_item)) {
                                if ($notify) {
@@ -1850,7 +1850,7 @@ class Item extends BaseObject
                                $cmd = 'wall-new';
                        }
 
-                       Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', $cmd, $current_post);
+                       Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $cmd, $current_post);
                }
 
                return $current_post;
@@ -2019,7 +2019,7 @@ class Item extends BaseObject
                $condition = ['id' => $itemid, 'uid' => 0,
                        'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, ""],
                        'visible' => true, 'deleted' => false, 'moderated' => false, 'private' => false];
-               $item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $itemid]);
+               $item = self::selectFirst(self::ITEM_FIELDLIST, $condition);
                if (!DBA::isResult($item)) {
                        return;
                }
@@ -2476,7 +2476,7 @@ class Item extends BaseObject
                $id = 0;
 
                if ($uid == 0) {
-                       $uid == local_user();
+                       $uid = local_user();
                }
 
                // Does the given user have this item?
@@ -2526,8 +2526,8 @@ class Item extends BaseObject
                        return;
                }
 
-               $community_page = (($user['page-flags'] == Contact::PAGE_COMMUNITY) ? true : false);
-               $prvgroup = (($user['page-flags'] == Contact::PAGE_PRVGROUP) ? true : false);
+               $community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
+               $prvgroup = (($user['page-flags'] == User::PAGE_FLAGS_PRVGROUP) ? true : false);
 
                $item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id]);
                if (!DBA::isResult($item)) {