diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 8ed3be375..adcb32dee 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -552,6 +552,7 @@ class PublicApiController extends Controller 'reblogs_count', 'scope', 'local', + 'cw_summary', 'created_at', 'updated_at' )->whereProfileId($profile->id) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index af46fee5e..ba3517314 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -327,6 +327,8 @@ class Helpers { $status->is_nsfw = $cw; $status->scope = $scope; $status->visibility = $scope; + $status->cw_summary = $cw == true && isset($res['summary']) ? + Purify::clean(strip_tags($res['summary'])) : null; $status->save(); if($reply_to == null) { self::importNoteAttachment($res, $status); @@ -404,7 +406,8 @@ class Helpers { if(empty($username)) { return; } - $remoteUsername = "@{$username}@{$domain}"; + $remoteUsername = $username; + $webfinger = "@{$username}@{$domain}"; abort_if(!self::validateUrl($res['inbox']), 400); abort_if(!self::validateUrl($res['id']), 400); @@ -422,6 +425,8 @@ class Helpers { $profile->remote_url = strtolower($res['id']); $profile->public_key = $res['publicKey']['publicKeyPem']; $profile->key_id = $res['publicKey']['id']; + $profile->webfinger = strtolower(Purify::clean($webfinger)); + $profile->last_fetched_at = now(); $profile->save(); if($runJobs == true) { // RemoteFollowImportRecent::dispatch($res, $profile); diff --git a/resources/assets/js/components/RemoteProfile.vue b/resources/assets/js/components/RemoteProfile.vue index 866c6e101..dc4250509 100644 --- a/resources/assets/js/components/RemoteProfile.vue +++ b/resources/assets/js/components/RemoteProfile.vue @@ -73,16 +73,16 @@
-

CW / NSFW / Hidden Media

+

{{status.spoiler_text ? status.spoiler_text : 'CW / NSFW / Hidden Media'}}

(click to show)

- +
- + @@ -241,7 +241,8 @@ type: status.pf_type, url: status.url, sensitive: status.sensitive, - cw: status.sensitive + cw: status.sensitive, + spoiler_text: status.spoiler_text } }); let ids = data.map(status => status.id);