mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Merge pull request #4801 from pixelfed/staging
Update Inbox handler, fix missing object_url and uri fields for direc…
This commit is contained in:
commit
a4030faa9d
3 changed files with 47 additions and 4 deletions
|
@ -63,6 +63,9 @@
|
||||||
- Update StoryApiV1Controller, add self-carousel endpoint. Fixes ([#4352](https://github.com/pixelfed/pixelfed/issues/4352)) ([bcb88d5b](https://github.com/pixelfed/pixelfed/commit/bcb88d5b))
|
- Update StoryApiV1Controller, add self-carousel endpoint. Fixes ([#4352](https://github.com/pixelfed/pixelfed/issues/4352)) ([bcb88d5b](https://github.com/pixelfed/pixelfed/commit/bcb88d5b))
|
||||||
- Update FollowServiceWarmCache, use more efficient query ([fe9b4c5a](https://github.com/pixelfed/pixelfed/commit/fe9b4c5a))
|
- Update FollowServiceWarmCache, use more efficient query ([fe9b4c5a](https://github.com/pixelfed/pixelfed/commit/fe9b4c5a))
|
||||||
- Update HomeFeedPipeline, observe mutes/blocks during fanout ([8548294c](https://github.com/pixelfed/pixelfed/commit/8548294c))
|
- Update HomeFeedPipeline, observe mutes/blocks during fanout ([8548294c](https://github.com/pixelfed/pixelfed/commit/8548294c))
|
||||||
|
- Update FederationController, add proper following/follower counts ([3204fb96](https://github.com/pixelfed/pixelfed/commit/3204fb96))
|
||||||
|
- Update FederationController, add proper statuses counts ([3204fb96](https://github.com/pixelfed/pixelfed/commit/3204fb96))
|
||||||
|
- Update Inbox handler, fix missing object_url and uri fields for direct statuses ([a0157fce](https://github.com/pixelfed/pixelfed/commit/a0157fce))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9)
|
## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9)
|
||||||
|
|
|
@ -282,8 +282,8 @@ class Inbox
|
||||||
}
|
}
|
||||||
|
|
||||||
if($actor->followers_count == 0) {
|
if($actor->followers_count == 0) {
|
||||||
if(config('federation.activitypub.ingest.store_notes_without_followers')) {
|
if(config('federation.activitypub.ingest.store_notes_without_followers')) {
|
||||||
} else if(FollowerService::followerCount($actor->id, true) == 0) {
|
} else if(FollowerService::followerCount($actor->id, true) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,6 +401,8 @@ class Inbox
|
||||||
$status->visibility = 'direct';
|
$status->visibility = 'direct';
|
||||||
$status->scope = 'direct';
|
$status->scope = 'direct';
|
||||||
$status->url = $activity['id'];
|
$status->url = $activity['id'];
|
||||||
|
$status->uri = $activity['id'];
|
||||||
|
$status->object_url = $activity['id'];
|
||||||
$status->in_reply_to_profile_id = $profile->id;
|
$status->in_reply_to_profile_id = $profile->id;
|
||||||
$status->save();
|
$status->save();
|
||||||
|
|
||||||
|
@ -703,12 +705,17 @@ class Inbox
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$status = Status::whereProfileId($profile->id)
|
$status = Status::whereProfileId($profile->id)
|
||||||
->whereObjectUrl($id)
|
->where(function($q) use($id) {
|
||||||
|
return $q->where('object_url', $id)
|
||||||
|
->orWhere('url', $id);
|
||||||
|
})
|
||||||
->first();
|
->first();
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FeedRemoveRemotePipeline::dispatch($status->id, $status->profile_id)->onQueue('feed');
|
if($status->scope && $status->scope != 'direct') {
|
||||||
|
FeedRemoveRemotePipeline::dispatch($status->id, $status->profile_id)->onQueue('feed');
|
||||||
|
}
|
||||||
RemoteStatusDelete::dispatch($status)->onQueue('high');
|
RemoteStatusDelete::dispatch($status)->onQueue('high');
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Status;
|
||||||
|
use Illuminate\Database\UniqueConstraintViolationException;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
foreach(Status::whereScope('direct')->whereNotNull('url')->whereNull('object_url')->lazyById(50, 'id') as $status) {
|
||||||
|
try {
|
||||||
|
$status->object_url = $status->url;
|
||||||
|
$status->uri = $status->url;
|
||||||
|
$status->save();
|
||||||
|
} catch (Exception | UniqueConstraintViolationException $e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue