mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-21 12:33:17 +00:00
Merge pull request #4137 from pixelfed/staging
Update SharePipeline, fix ReblogService and undo handling
This commit is contained in:
commit
3e89d8b273
5 changed files with 23 additions and 10 deletions
|
@ -86,6 +86,8 @@
|
||||||
- Update ComposeModal, add Alt Text button to caption screen ([4db48188](https://github.com/pixelfed/pixelfed/commit/4db48188))
|
- Update ComposeModal, add Alt Text button to caption screen ([4db48188](https://github.com/pixelfed/pixelfed/commit/4db48188))
|
||||||
- Update AccountService, fix actor cache invalidation ([498b46f7](https://github.com/pixelfed/pixelfed/commit/498b46f7))
|
- Update AccountService, fix actor cache invalidation ([498b46f7](https://github.com/pixelfed/pixelfed/commit/498b46f7))
|
||||||
- Update SharePipeline, fix share handling and notification generation ([83e1e203](https://github.com/pixelfed/pixelfed/commit/83e1e203))
|
- Update SharePipeline, fix share handling and notification generation ([83e1e203](https://github.com/pixelfed/pixelfed/commit/83e1e203))
|
||||||
|
- Update SharePipeline, fix ReblogService and undo handling ([016c6e41](https://github.com/pixelfed/pixelfed/commit/016c6e41))
|
||||||
|
- Update AP Helpers, fix media validation bug that would reject media with alttext/name longer than 255 chars and store remote alt text if set ([a7f58349](https://github.com/pixelfed/pixelfed/commit/a7f58349))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
||||||
|
|
|
@ -63,7 +63,7 @@ class SharePipeline implements ShouldQueue
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReblogService::addPostReblog($parent->id, $status->id);
|
ReblogService::addPostReblog($parent->profile_id, $status->id);
|
||||||
|
|
||||||
$parent->reblogs_count = $parent->reblogs_count + 1;
|
$parent->reblogs_count = $parent->reblogs_count + 1;
|
||||||
$parent->save();
|
$parent->save();
|
||||||
|
|
|
@ -37,7 +37,7 @@ class UndoSharePipeline implements ShouldQueue
|
||||||
|
|
||||||
if($parent) {
|
if($parent) {
|
||||||
$target = $parent->profile_id;
|
$target = $parent->profile_id;
|
||||||
ReblogService::removePostReblog($parent->id, $status->id);
|
ReblogService::removePostReblog($parent->profile_id, $status->id);
|
||||||
|
|
||||||
if($parent->reblogs_count > 0) {
|
if($parent->reblogs_count > 0) {
|
||||||
$parent->reblogs_count = $parent->reblogs_count - 1;
|
$parent->reblogs_count = $parent->reblogs_count - 1;
|
||||||
|
|
|
@ -101,13 +101,13 @@ class Helpers {
|
||||||
'string',
|
'string',
|
||||||
Rule::in($mediaTypes)
|
Rule::in($mediaTypes)
|
||||||
],
|
],
|
||||||
'*.url' => 'required|url|max:255',
|
'*.url' => 'required|url',
|
||||||
'*.mediaType' => [
|
'*.mediaType' => [
|
||||||
'required',
|
'required',
|
||||||
'string',
|
'string',
|
||||||
Rule::in($mimeTypes)
|
Rule::in($mimeTypes)
|
||||||
],
|
],
|
||||||
'*.name' => 'sometimes|nullable|string|max:255'
|
'*.name' => 'sometimes|nullable|string'
|
||||||
])->passes();
|
])->passes();
|
||||||
|
|
||||||
return $valid;
|
return $valid;
|
||||||
|
@ -665,12 +665,13 @@ class Helpers {
|
||||||
foreach($attachments as $media) {
|
foreach($attachments as $media) {
|
||||||
$type = $media['mediaType'];
|
$type = $media['mediaType'];
|
||||||
$url = $media['url'];
|
$url = $media['url'];
|
||||||
$blurhash = isset($media['blurhash']) ? $media['blurhash'] : null;
|
|
||||||
$license = isset($media['license']) ? License::nameToId($media['license']) : null;
|
|
||||||
$valid = self::validateUrl($url);
|
$valid = self::validateUrl($url);
|
||||||
if(in_array($type, $allowed) == false || $valid == false) {
|
if(in_array($type, $allowed) == false || $valid == false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$blurhash = isset($media['blurhash']) ? $media['blurhash'] : null;
|
||||||
|
$license = isset($media['license']) ? License::nameToId($media['license']) : null;
|
||||||
|
$caption = $media['name'] ? Purify::clean($media['name']) : null;
|
||||||
|
|
||||||
$media = new Media();
|
$media = new Media();
|
||||||
$media->blurhash = $blurhash;
|
$media->blurhash = $blurhash;
|
||||||
|
@ -680,6 +681,7 @@ class Helpers {
|
||||||
$media->user_id = null;
|
$media->user_id = null;
|
||||||
$media->media_path = $url;
|
$media->media_path = $url;
|
||||||
$media->remote_url = $url;
|
$media->remote_url = $url;
|
||||||
|
$media->caption = $caption;
|
||||||
if($license) {
|
if($license) {
|
||||||
$media->license = $license;
|
$media->license = $license;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ use App\Util\ActivityPub\Validator\UndoFollow as UndoFollowValidator;
|
||||||
|
|
||||||
use App\Services\PollService;
|
use App\Services\PollService;
|
||||||
use App\Services\FollowerService;
|
use App\Services\FollowerService;
|
||||||
|
use App\Services\ReblogService;
|
||||||
use App\Services\StatusService;
|
use App\Services\StatusService;
|
||||||
use App\Services\UserFilterService;
|
use App\Services\UserFilterService;
|
||||||
use App\Services\NetworkTimelineService;
|
use App\Services\NetworkTimelineService;
|
||||||
|
@ -602,6 +603,8 @@ class Inbox
|
||||||
$parent->reblogs_count = $parent->reblogs_count + 1;
|
$parent->reblogs_count = $parent->reblogs_count + 1;
|
||||||
$parent->save();
|
$parent->save();
|
||||||
|
|
||||||
|
ReblogService::addPostReblog($parent->profile_id, $status->id);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -789,17 +792,23 @@ class Inbox
|
||||||
if(is_array($obj) && isset($obj['object'])) {
|
if(is_array($obj) && isset($obj['object'])) {
|
||||||
$obj = $obj['object'];
|
$obj = $obj['object'];
|
||||||
}
|
}
|
||||||
if(!is_string($obj) || !Helpers::validateLocalUrl($obj)) {
|
if(!is_string($obj)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$status = Status::whereUri($obj)->exists();
|
if(Helpers::validateLocalUrl($obj)) {
|
||||||
|
$parsedId = last(explode('/', $obj));
|
||||||
|
$status = Status::find($parsedId);
|
||||||
|
} else {
|
||||||
|
$status = Status::whereUri($obj)->first();
|
||||||
|
}
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Status::whereProfileId($profile->id)
|
Status::whereProfileId($profile->id)
|
||||||
->whereReblogOfId($status->id)
|
->whereReblogOfId($status->id)
|
||||||
->forceDelete();
|
->delete();
|
||||||
Notification::whereProfileId($status->profile->id)
|
ReblogService::removePostReblog($profile->id, $status->id);
|
||||||
|
Notification::whereProfileId($status->profile_id)
|
||||||
->whereActorId($profile->id)
|
->whereActorId($profile->id)
|
||||||
->whereAction('share')
|
->whereAction('share')
|
||||||
->whereItemId($status->reblog_of_id)
|
->whereItemId($status->reblog_of_id)
|
||||||
|
|
Loading…
Reference in a new issue