From 26b9c1401ceedbcfe1bae21e802129f333dcaf0b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Jul 2021 21:30:59 -0600 Subject: [PATCH 1/8] Update ActivityPub helpers, fix comment threading in statusFetch() method --- app/Http/Controllers/SearchController.php | 14 ++++++++++++-- app/Util/ActivityPub/Helpers.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index c273e95d9..cbf21518b 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -321,13 +321,18 @@ class SearchController extends Controller if(Status::whereUri($tag)->whereLocal(false)->exists()) { $item = Status::whereUri($tag)->first(); + $media = $item->firstMedia(); + $url = null; + if($media) { + $url = $media->remote_url; + } $this->tokens['posts'] = [[ 'count' => 0, 'url' => "/i/web/post/_/$item->profile_id/$item->id", 'type' => 'status', 'username' => $item->profile->username, 'caption' => $item->rendered ?? $item->caption, - 'thumb' => $item->firstMedia()->remote_url, + 'thumb' => $url, 'timestamp' => $item->created_at->diffForHumans() ]]; } @@ -336,13 +341,18 @@ class SearchController extends Controller if(isset($remote['type']) && $remote['type'] == 'Note') { $item = Helpers::statusFetch($tag); + $media = $item->firstMedia(); + $url = null; + if($media) { + $url = $media->remote_url; + } $this->tokens['posts'] = [[ 'count' => 0, 'url' => "/i/web/post/_/$item->profile_id/$item->id", 'type' => 'status', 'username' => $item->profile->username, 'caption' => $item->rendered ?? $item->caption, - 'thumb' => $item->firstMedia()->remote_url, + 'thumb' => $url, 'timestamp' => $item->created_at->diffForHumans() ]]; } diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 58876bc2c..48d37615e 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -351,7 +351,7 @@ class Helpers { } $profile = self::profileFirstOrNew($activity['object']['attributedTo']); - if(isset($activity['object']['inReplyTo']) && !empty($activity['object']['inReplyTo']) && $replyTo == true) { + if(isset($activity['object']['inReplyTo']) && !empty($activity['object']['inReplyTo']) || $replyTo == true) { $reply_to = self::statusFirstOrFetch($activity['object']['inReplyTo'], false); $reply_to = optional($reply_to)->id; } else { From dd8661a09af5f140fbb167e34abe86970cdb8452 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Jul 2021 21:31:40 -0600 Subject: [PATCH 2/8] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a32e5e2b..463f66ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ - Updated PublicApiController, impr home timeline perf. ([4fe42e5b](https://github.com/pixelfed/pixelfed/commit/4fe42e5b)) - Updated Timeline.vue, fix comment button. ([b6b5ce7c](https://github.com/pixelfed/pixelfed/commit/b6b5ce7c)) - Updated StatusEntityLexer, only add specific status types to PublicTimelineService. ([1fdcbe5b](https://github.com/pixelfed/pixelfed/commit/1fdcbe5b)) +- Updated ActivityPub helpers, fix comment threading in statusFetch() method ([26b9c140](https://github.com/pixelfed/pixelfed/commit/26b9c140)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0) From b37bb426a24a505f97d4338273f1e29ccfbe5db7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Jul 2021 22:20:28 -0600 Subject: [PATCH 3/8] Update NotificationCard, fix typo in mention, share and comments. Fixes #2848 --- resources/assets/js/components/NotificationCard.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/assets/js/components/NotificationCard.vue b/resources/assets/js/components/NotificationCard.vue index a71af0ee9..a52bde62f 100644 --- a/resources/assets/js/components/NotificationCard.vue +++ b/resources/assets/js/components/NotificationCard.vue @@ -131,13 +131,13 @@ axios.get('/api/pixelfed/v1/notifications?pg=true') .then(res => { let data = res.data.filter(n => { - if(n.type == 'share' && !status) { + if(n.type == 'share' && !n.status) { return false; } - if(n.type == 'comment' && !status) { + if(n.type == 'comment' && !n.status) { return false; } - if(n.type == 'mention' && !status) { + if(n.type == 'mention' && !n.status) { return false; } return true; @@ -162,13 +162,13 @@ }).then(res => { if(res.data.length) { let data = res.data.filter(n => { - if(n.type == 'share' && !status) { + if(n.type == 'share' && !n.status) { return false; } - if(n.type == 'comment' && !status) { + if(n.type == 'comment' && !n.status) { return false; } - if(n.type == 'mention' && !status) { + if(n.type == 'mention' && !n.status) { return false; } if(_.find(this.notifications, {id: n.id})) { From 0f542065bdbd987c828fa05be3bc83093766d8e3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Jul 2021 22:20:59 -0600 Subject: [PATCH 4/8] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 463f66ec1..86db8401c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ - Updated Timeline.vue, fix comment button. ([b6b5ce7c](https://github.com/pixelfed/pixelfed/commit/b6b5ce7c)) - Updated StatusEntityLexer, only add specific status types to PublicTimelineService. ([1fdcbe5b](https://github.com/pixelfed/pixelfed/commit/1fdcbe5b)) - Updated ActivityPub helpers, fix comment threading in statusFetch() method ([26b9c140](https://github.com/pixelfed/pixelfed/commit/26b9c140)) +- Updated NotificationCard, fix typo in mention, share and comments. Fixes #2848. ([b37bb426](https://github.com/pixelfed/pixelfed/commit/b37bb426)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0) From 9607243ff721c37fd5085ed1f0946e7f593ee6a7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Jul 2021 22:21:47 -0600 Subject: [PATCH 5/8] Update StatusCard.vue, add togglecw events to other presenters --- resources/assets/js/components/partials/StatusCard.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/components/partials/StatusCard.vue b/resources/assets/js/components/partials/StatusCard.vue index 6bf7b9609..77ab028cc 100644 --- a/resources/assets/js/components/partials/StatusCard.vue +++ b/resources/assets/js/components/partials/StatusCard.vue @@ -40,19 +40,19 @@
- +
- +
- +
- +
From fc56acb835b3b107af5c0b41b22db5d03f040dc2 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Jul 2021 22:23:55 -0600 Subject: [PATCH 6/8] Update presenters, fix content warning layout --- .../components/presenter/PhotoPresenter.vue | 4 +- .../components/presenter/VideoPresenter.vue | 67 +++++++++++++++---- 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/resources/assets/js/components/presenter/PhotoPresenter.vue b/resources/assets/js/components/presenter/PhotoPresenter.vue index 4dd1f2626..79e89aac3 100644 --- a/resources/assets/js/components/presenter/PhotoPresenter.vue +++ b/resources/assets/js/components/presenter/PhotoPresenter.vue @@ -54,12 +54,14 @@ border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; } + .content-label-wrapper { + position: relative; + } .content-label { margin: 0; position: absolute; top:50%; left:50%; - z-index: 2; transform: translate(-50%, -50%); display: flex; flex-direction: column; diff --git a/resources/assets/js/components/presenter/VideoPresenter.vue b/resources/assets/js/components/presenter/VideoPresenter.vue index 527d849a1..49146bb1c 100644 --- a/resources/assets/js/components/presenter/VideoPresenter.vue +++ b/resources/assets/js/components/presenter/VideoPresenter.vue @@ -1,16 +1,25 @@ + +