X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=67071db31817d315b25b7a10b00d8f9b23cf3387;hb=2b0610eaf5ea67cc6b6a8e59b4f9c08249f90370;hp=cffa25397c850df81bd3a1e57d091cdec3edefe8;hpb=ad9c67663d8206315c649be3b27bf5418fb91ad3;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index cffa25397c..67071db318 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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?