From d81c1d81b3388649ac85d65434ce75b66109e7e6 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 18 May 2019 20:37:37 +0200 Subject: [PATCH] correct notice redirect --- src/Model/ItemUser.php | 36 --------------------------------- src/Module/GnuSocial/Notice.php | 8 +++++--- 2 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 src/Model/ItemUser.php diff --git a/src/Model/ItemUser.php b/src/Model/ItemUser.php deleted file mode 100644 index c157150339..0000000000 --- a/src/Model/ItemUser.php +++ /dev/null @@ -1,36 +0,0 @@ - $id]); - if (empty($item)) { - return false; - } - - $user = DBA::selectFirst('user', $fields, ['uid' => $item['uid']]); - if (!empty($user)) { - return $user; - } else { - return false; - } - } -} diff --git a/src/Module/GnuSocial/Notice.php b/src/Module/GnuSocial/Notice.php index a364fa79f0..5df28a1f0d 100644 --- a/src/Module/GnuSocial/Notice.php +++ b/src/Module/GnuSocial/Notice.php @@ -4,6 +4,8 @@ namespace Friendica\Module\GnuSocial; use Friendica\BaseModule; use Friendica\Core\L10n; +use Friendica\Database\DBA; +use Friendica\Model\Item; use Friendica\Model\ItemUser; use Friendica\Network\HTTPException; @@ -23,12 +25,12 @@ class Notice extends BaseModule throw new HTTPException\NotFoundException(L10n::t('Item not found.')); } - $user = ItemUser::getUserForItemId($id, ['nickname']); + $item = DBA::selectFirst('item', ['guid'], ['id' => $id]); - if (empty($user)) { + if (empty($item )) { throw new HTTPException\NotFoundException(L10n::t('Item not found.')); } else { - $a->internalRedirect('display/' . $user['nickname'] . '/' . $id); + $a->internalRedirect('display/' . $item['guid']); } } } -- 2.39.5