X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=include%2Flike.php;h=ae344d4269a3358ea03e7304832697efa6eeaef8;hb=df7bdbfc66566a5063fa754fdcc83ec9230f9b6e;hp=a53b90c0398ce11f215ad1b9d660eb6fbf0c2c01;hpb=9f9497f2ca5c9b0ce93607aaf623d9a2120ed90b;p=friendica.git diff --git a/include/like.php b/include/like.php index a53b90c039..ae344d4269 100644 --- a/include/like.php +++ b/include/like.php @@ -1,5 +1,15 @@ $like_item['id']]); $like_item_id = $like_item['id']; - proc_run(PRIORITY_HIGH, "include/notifier.php", "like", $like_item_id); + Worker::add(PRIORITY_HIGH, "Notifier", "like", $like_item_id); if (!$event_verb_flag || $like_item['verb'] == $activity) { return true; @@ -175,12 +188,12 @@ function do_like($item_id, $verb) { } // Else or if event verb different from existing row, create a new item row - $post_type = (($item['resource-id']) ? t('photo') : t('status')); + $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status')); if ($item['object-type'] === ACTIVITY_OBJ_EVENT) { - $post_type = t('event'); + $post_type = L10n::t('event'); } $objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ; - $link = xmlify('' . "\n") ; + $link = xmlify('' . "\n") ; $body = $item['body']; $obj = <<< EOT @@ -197,9 +210,9 @@ EOT; $ulink = '[url=' . $author_contact['url'] . ']' . $author_contact['name'] . '[/url]'; $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; - $plink = '[url=' . App::get_baseurl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; + $plink = '[url=' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; - $new_item = array( + $new_item = [ 'guid' => get_guid(32), 'uri' => item_new_uri($a->get_hostname(), $item['uid']), 'uid' => $item['uid'], @@ -229,27 +242,25 @@ EOT; 'deny_gid' => $item['deny_gid'], 'visible' => 1, 'unseen' => 1, - 'last-child' => 0 - ); + ]; $new_item_id = item_store($new_item); // @todo: Explain this block if (! $item['visible']) { - q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d", - intval($item['id']), - intval($item['uid']) + q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d", + intval($item['id']) ); } // Save the author information for the like in case we need to relay to Diaspora - Diaspora::store_like_signature($item_contact, $new_item_id); + Diaspora::storeLikeSignature($item_contact, $new_item_id); $new_item['id'] = $new_item_id; - call_hooks('post_local_end', $new_item); + Addon::callHooks('post_local_end', $new_item); - proc_run(PRIORITY_HIGH, "include/notifier.php", "like", $new_item_id); + Worker::add(PRIORITY_HIGH, "Notifier", "like", $new_item_id); return true; }