Merge pull request #4533 from pixelfed/staging

Staging
This commit is contained in:
daniel 2023-07-11 00:09:56 -06:00 committed by GitHub
commit cc561c0522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 506 additions and 527 deletions

View file

@ -25,6 +25,7 @@
- Update StatusRemoteUpdatePipeline, fix missing mime and size attributes that cause empty media previews on our mobile app ([ea54413e](https://github.com/pixelfed/pixelfed/commit/ea54413e)) - Update StatusRemoteUpdatePipeline, fix missing mime and size attributes that cause empty media previews on our mobile app ([ea54413e](https://github.com/pixelfed/pixelfed/commit/ea54413e))
- Update ComposeModal.vue, fix scroll issue and dont hide scrollbar ([2d959fb3](https://github.com/pixelfed/pixelfed/commit/2d959fb3)) - Update ComposeModal.vue, fix scroll issue and dont hide scrollbar ([2d959fb3](https://github.com/pixelfed/pixelfed/commit/2d959fb3))
- Update AccountImport, add select first 100 posts button ([625a76a5](https://github.com/pixelfed/pixelfed/commit/625a76a5)) - Update AccountImport, add select first 100 posts button ([625a76a5](https://github.com/pixelfed/pixelfed/commit/625a76a5))
- Update ApiV1Controller, add include_reblogs attribute to home timeline ([37fd0342](https://github.com/pixelfed/pixelfed/commit/37fd0342))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8) ## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8)

View file

@ -2132,7 +2132,8 @@ class ApiV1Controller extends Controller
'page' => 'sometimes|integer|max:40', 'page' => 'sometimes|integer|max:40',
'min_id' => 'sometimes|integer|min:0|max:' . PHP_INT_MAX, 'min_id' => 'sometimes|integer|min:0|max:' . PHP_INT_MAX,
'max_id' => 'sometimes|integer|min:0|max:' . PHP_INT_MAX, 'max_id' => 'sometimes|integer|min:0|max:' . PHP_INT_MAX,
'limit' => 'sometimes|integer|min:1|max:100' 'limit' => 'sometimes|integer|min:1|max:100',
'include_reblogs' => 'sometimes',
]); ]);
$napi = $request->has(self::PF_API_ENTITY_KEY); $napi = $request->has(self::PF_API_ENTITY_KEY);
@ -2141,6 +2142,13 @@ class ApiV1Controller extends Controller
$max = $request->input('max_id'); $max = $request->input('max_id');
$limit = $request->input('limit') ?? 20; $limit = $request->input('limit') ?? 20;
$pid = $request->user()->profile_id; $pid = $request->user()->profile_id;
$includeReblogs = $request->filled('include_reblogs');
$nullFields = $includeReblogs ?
['in_reply_to_id'] :
['in_reply_to_id', 'reblog_of_id'];
$inTypes = $includeReblogs ?
['photo', 'photo:album', 'video', 'video:album', 'photo:video:album', 'share'] :
['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'];
$following = Cache::remember('profile:following:'.$pid, 1209600, function() use($pid) { $following = Cache::remember('profile:following:'.$pid, 1209600, function() use($pid) {
$following = Follower::whereProfileId($pid)->pluck('following_id'); $following = Follower::whereProfileId($pid)->pluck('following_id');
@ -2159,9 +2167,9 @@ class ApiV1Controller extends Controller
'reblog_of_id' 'reblog_of_id'
) )
->where('id', $dir, $id) ->where('id', $dir, $id)
->whereNull(['in_reply_to_id', 'reblog_of_id']) ->whereNull($nullFields)
->whereIntegerInRaw('profile_id', $following) ->whereIntegerInRaw('profile_id', $following)
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) ->whereIn('type', $inTypes)
->whereIn('visibility',['public', 'unlisted', 'private']) ->whereIn('visibility',['public', 'unlisted', 'private'])
->orderByDesc('id') ->orderByDesc('id')
->take(($limit * 2)) ->take(($limit * 2))
@ -2202,9 +2210,9 @@ class ApiV1Controller extends Controller
'in_reply_to_id', 'in_reply_to_id',
'reblog_of_id', 'reblog_of_id',
) )
->whereNull(['in_reply_to_id', 'reblog_of_id']) ->whereNull($nullFields)
->whereIntegerInRaw('profile_id', $following) ->whereIntegerInRaw('profile_id', $following)
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) ->whereIn('type', $inTypes)
->whereIn('visibility',['public', 'unlisted', 'private']) ->whereIn('visibility',['public', 'unlisted', 'private'])
->orderByDesc('id') ->orderByDesc('id')
->take(($limit * 2)) ->take(($limit * 2))

View file

@ -10,6 +10,7 @@ use App\Services\HashidService;
use App\Services\LikeService; use App\Services\LikeService;
use App\Services\MediaService; use App\Services\MediaService;
use App\Services\MediaTagService; use App\Services\MediaTagService;
use App\Services\StatusService;
use App\Services\StatusHashtagService; use App\Services\StatusHashtagService;
use App\Services\StatusLabelService; use App\Services\StatusLabelService;
use App\Services\StatusMentionService; use App\Services\StatusMentionService;
@ -32,7 +33,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
'url' => $status->url(), 'url' => $status->url(),
'in_reply_to_id' => $status->in_reply_to_id ? (string) $status->in_reply_to_id : null, 'in_reply_to_id' => $status->in_reply_to_id ? (string) $status->in_reply_to_id : null,
'in_reply_to_account_id' => $status->in_reply_to_profile_id ? (string) $status->in_reply_to_profile_id : null, 'in_reply_to_account_id' => $status->in_reply_to_profile_id ? (string) $status->in_reply_to_profile_id : null,
'reblog' => null, 'reblog' => $status->reblog_of_id ? StatusService::get($status->reblog_of_id) : null,
'content' => $status->rendered ?? $status->caption, 'content' => $status->rendered ?? $status->caption,
'content_text' => $status->caption, 'content_text' => $status->caption,
'created_at' => str_replace('+00:00', 'Z', $status->created_at->format(DATE_RFC3339_EXTENDED)), 'created_at' => str_replace('+00:00', 'Z', $status->created_at->format(DATE_RFC3339_EXTENDED)),

View file

@ -10,6 +10,7 @@ use App\Services\HashidService;
use App\Services\LikeService; use App\Services\LikeService;
use App\Services\MediaService; use App\Services\MediaService;
use App\Services\MediaTagService; use App\Services\MediaTagService;
use App\Services\StatusService;
use App\Services\StatusHashtagService; use App\Services\StatusHashtagService;
use App\Services\StatusLabelService; use App\Services\StatusLabelService;
use App\Services\StatusMentionService; use App\Services\StatusMentionService;
@ -35,7 +36,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
'url' => $status->url(), 'url' => $status->url(),
'in_reply_to_id' => (string) $status->in_reply_to_id, 'in_reply_to_id' => (string) $status->in_reply_to_id,
'in_reply_to_account_id' => (string) $status->in_reply_to_profile_id, 'in_reply_to_account_id' => (string) $status->in_reply_to_profile_id,
'reblog' => null, 'reblog' => $status->reblog_of_id ? StatusService::get($status->reblog_of_id) : null,
'content' => $status->rendered ?? $status->caption, 'content' => $status->rendered ?? $status->caption,
'content_text' => $status->caption, 'content_text' => $status->caption,
'created_at' => str_replace('+00:00', 'Z', $status->created_at->format(DATE_RFC3339_EXTENDED)), 'created_at' => str_replace('+00:00', 'Z', $status->created_at->format(DATE_RFC3339_EXTENDED)),

1008
composer.lock generated

File diff suppressed because it is too large Load diff