From 27edcddc9b36fbe5edb53a6b8291739d09394b07 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 28 Oct 2018 13:59:09 -0400 Subject: [PATCH] Simplify NCNv1 userStatus call --- lib/REST/NextCloudNews/V1_2.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/lib/REST/NextCloudNews/V1_2.php b/lib/REST/NextCloudNews/V1_2.php index 0ae19792..dacb86b2 100644 --- a/lib/REST/NextCloudNews/V1_2.php +++ b/lib/REST/NextCloudNews/V1_2.php @@ -651,24 +651,12 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler { } protected function userStatus(array $url, array $data): ResponseInterface { - $data = Arsse::$user->propertiesGet(Arsse::$user->id, true); - // construct the avatar structure, if an image is available - if (isset($data['avatar'])) { - $avatar = [ - 'data' => base64_encode($data['avatar']['data']), - 'mime' => (string) $data['avatar']['type'], - ]; - } else { - $avatar = null; - } - // construct the rest of the structure - $out = [ + return new Response([ 'userId' => (string) Arsse::$user->id, - 'displayName' => (string) ($data['name'] ?? Arsse::$user->id), + 'displayName' => (string) Arsse::$user->id, 'lastLoginTimestamp' => time(), - 'avatar' => $avatar, - ]; - return new Response($out); + 'avatar' => null, + ]); } protected function cleanupBefore(array $url, array $data): ResponseInterface {