From 09967cc6642de58796a16a03a92c4b11ebd97b3a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 5 May 2019 22:03:22 -0400 Subject: [PATCH] [various] Remove /display/{nick}/{id} URL structure publishing --- mailstream/mailstream.php | 4 ++-- statusnet/statusnet.php | 2 +- twitter/twitter.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 4f86e7045..99574f6d0 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -254,7 +254,7 @@ function mailstream_subject($item) { return L10n::t("Friendica Item"); } -function mailstream_send($a, $message_id, $item, $user) { +function mailstream_send(\Friendica\App $a, $message_id, $item, $user) { if (!$item['visible']) { return; } @@ -293,7 +293,7 @@ function mailstream_send($a, $message_id, $item, $user) { $mail->CharSet = 'utf-8'; $template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/'); $item['body'] = BBCode::convert($item['body']); - $item['url'] = $a->getBaseURL() . '/display/' . $user['nickname'] . '/' . $item['id']; + $item['url'] = $a->getBaseURL() . '/display/' . $item['guid']; $mail->Body = Renderer::replaceMacros($template, [ '$upstream' => L10n::t('Upstream'), '$local' => L10n::t('Local'), diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index ab4cceb74..5638a7991 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -735,7 +735,7 @@ function statusnet_prepare_body(App $a, &$b) } $item = $b["item"]; - $item["plink"] = $a->getBaseURL() . "/display/" . $a->user["nickname"] . "/" . $item["parent"]; + $item["plink"] = $a->getBaseURL() . "/display/" . $item["guid"]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; $orig_post = Item::selectFirst(['author-link', 'uri'], $condition); diff --git a/twitter/twitter.php b/twitter/twitter.php index f6d5912dd..166c99ef9 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -814,7 +814,7 @@ function twitter_prepare_body(App $a, array &$b) if ($b["preview"]) { $max_char = 280; $item = $b["item"]; - $item["plink"] = $a->getBaseURL() . "/display/" . $a->user["nickname"] . "/" . $item["parent"]; + $item["plink"] = $a->getBaseURL() . "/display/" . $item["guid"]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; $orig_post = Item::selectFirst(['author-link'], $condition);