X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoke.php;h=69fd42c72cf1d19cfce6f0a3c3075f6278b2e6d2;hb=39a537c415fad16c51e1422ff32ab60ac76da6b8;hp=fb1fae85d6727db111a98371171417d8b85bbebf;hpb=7efde8e334d6ca52fd1608fb9a78babcea4bdc9f;p=friendica.git diff --git a/mod/poke.php b/mod/poke.php index fb1fae85d6..69fd42c72c 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -14,14 +14,14 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; -use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Item; +use Friendica\Protocol\Activity; use Friendica\Util\Strings; use Friendica\Util\XML; @@ -45,7 +45,7 @@ function poke_init(App $a) return; } - $activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]); + $activity = Activity::POKE . '#' . urlencode($verbs[$verb][0]); $contact_id = intval($_GET['cid']); if (!$contact_id) { @@ -118,20 +118,20 @@ function poke_init(App $a) $arr['visible'] = 1; $arr['verb'] = $activity; $arr['private'] = $private; - $arr['object-type'] = ACTIVITY_OBJ_PERSON; + $arr['object-type'] = Activity\ObjectType::PERSON; $arr['origin'] = 1; $arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . L10n::t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]'; - $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . $target['url'] . ''; + $arr['object'] = '' . Activity\ObjectType::PERSON . '' . $target['name'] . '' . $target['url'] . ''; $arr['object'] .= '' . XML::escape('' . "\n"); $arr['object'] .= XML::escape('' . "\n"); $arr['object'] .= '' . "\n"; - $item_id = Item::insert($arr); + Item::insert($arr); - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); return; } @@ -143,9 +143,6 @@ function poke_content(App $a) return; } - $name = ''; - $id = ''; - if (empty($_GET['c'])) { return; } @@ -158,15 +155,11 @@ function poke_content(App $a) $name = $contact['name']; $id = $contact['id']; - $base = System::baseUrl(); - $head_tpl = Renderer::getMarkupTemplate('poke_head.tpl'); $a->page['htmlhead'] .= Renderer::replaceMacros($head_tpl,[ '$baseurl' => System::baseUrl(true), - '$base' => $base ]); - $parent = (!empty($_GET['parent']) ? intval($_GET['parent']) : '0');