X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FContact%2FPoke.php;h=6e8920c5cf36cfd13ea402b4b69568587af798d3;hb=afe3c8954c92d386fef3cb74217dd7ad593500cf;hp=0f289b529105211d631c2b9e1fbcafdbc30c75d8;hpb=d9c6a46ffee7f0544a8da195243f524623ddc107;p=friendica.git diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php index 0f289b5291..6e8920c5cf 100644 --- a/src/Module/Contact/Poke.php +++ b/src/Module/Contact/Poke.php @@ -3,6 +3,7 @@ namespace Friendica\Module\Contact; use Friendica\BaseModule; +use Friendica\Content\Widget; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -44,14 +45,14 @@ class Poke extends BaseModule Logger::info('verb ' . $verb . ' contact ' . $contact_id); - $contact = DBA::selectFirst('contact', ['id', 'name'], ['id' => $parameters['id'], 'uid' => local_user()]); + $contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => $parameters['id'], 'uid' => local_user()]); if (!DBA::isResult($contact)) { return self::postReturn(false); } $a = DI::app(); - $private = (!empty($_GET['private']) ? intval($_GET['private']) : Model\Item::PUBLIC); + $private = !empty($_POST['private']) ? Model\Item::PRIVATE : Model\Item::PUBLIC; $allow_cid = ($private ? '<' . $contact['id']. '>' : $a->user['allow_cid']); $allow_gid = ($private ? '' : $a->user['allow_gid']); @@ -67,7 +68,6 @@ class Poke extends BaseModule $arr['guid'] = System::createUUID(); $arr['uid'] = $uid; $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; $arr['wall'] = 1; $arr['contact-id'] = $actor['id']; $arr['owner-name'] = $actor['name']; @@ -87,7 +87,7 @@ class Poke extends BaseModule $arr['object-type'] = Activity\ObjectType::PERSON; $arr['origin'] = 1; - $arr['body'] = '[url=' . $actor['url'] . ']' . $actor['name'] . '[/url]' . ' ' . $verbs[$verb][2] . ' ' . '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; + $arr['body'] = '@[url=' . $actor['url'] . ']' . $actor['name'] . '[/url]' . ' ' . $verbs[$verb][2] . ' ' . '@[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; $arr['object'] = '' . Activity\ObjectType::PERSON . '' . XML::escape($contact['name']) . '' . XML::escape($contact['url']) . ''; $arr['object'] .= '' . XML::escape('') . "\n"; @@ -110,9 +110,7 @@ class Poke extends BaseModule */ private static function postReturn(bool $success) { - if ($success) { - info(DI::l10n()->t('Poke successfully sent.')); - } else { + if (!$success) { notice(DI::l10n()->t('Error while sending poke, please retry.')); } @@ -138,7 +136,7 @@ class Poke extends BaseModule throw new HTTPException\NotFoundException(); } - Model\Profile::load(DI::app(), '', Model\Contact::getByURL($contact["url"], 0, [], false)); + DI::page()['aside'] = Widget\VCard::getHTML(Model\Contact::getByURL($contact["url"], false)); $verbs = []; foreach (DI::l10n()->getPokeVerbs() as $verb => $translations) {