Update AP Inbox

This commit is contained in:
Daniel Supernault 2024-09-30 05:12:52 -06:00
parent bae0632e34
commit cc897bc427
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1
1 changed files with 13 additions and 1 deletions

View File

@ -15,6 +15,7 @@ use App\Jobs\MovePipeline\MoveMigrateFollowersPipeline;
use App\Jobs\MovePipeline\ProcessMovePipeline; use App\Jobs\MovePipeline\ProcessMovePipeline;
use App\Jobs\MovePipeline\UnfollowLegacyAccountMovePipeline; use App\Jobs\MovePipeline\UnfollowLegacyAccountMovePipeline;
use App\Jobs\ProfilePipeline\HandleUpdateActivity; use App\Jobs\ProfilePipeline\HandleUpdateActivity;
use App\Jobs\PushNotificationPipeline\MentionPushNotifyPipeline;
use App\Jobs\StatusPipeline\RemoteStatusDelete; use App\Jobs\StatusPipeline\RemoteStatusDelete;
use App\Jobs\StatusPipeline\StatusRemoteUpdatePipeline; use App\Jobs\StatusPipeline\StatusRemoteUpdatePipeline;
use App\Jobs\StoryPipeline\StoryExpire; use App\Jobs\StoryPipeline\StoryExpire;
@ -27,7 +28,9 @@ use App\Notification;
use App\Profile; use App\Profile;
use App\Services\AccountService; use App\Services\AccountService;
use App\Services\FollowerService; use App\Services\FollowerService;
use App\Services\NotificationAppGatewayService;
use App\Services\PollService; use App\Services\PollService;
use App\Services\PushNotificationService;
use App\Services\ReblogService; use App\Services\ReblogService;
use App\Services\UserFilterService; use App\Services\UserFilterService;
use App\Status; use App\Status;
@ -242,7 +245,7 @@ class Inbox
$cc = isset($activity['cc']) ? $activity['cc'] : []; $cc = isset($activity['cc']) ? $activity['cc'] : [];
if ($activity['type'] == 'Question') { if ($activity['type'] == 'Question') {
$this->handlePollCreate(); //$this->handlePollCreate();
return; return;
} }
@ -531,6 +534,15 @@ class Inbox
$notification->item_id = $dm->id; $notification->item_id = $dm->id;
$notification->item_type = "App\DirectMessage"; $notification->item_type = "App\DirectMessage";
$notification->save(); $notification->save();
if (NotificationAppGatewayService::enabled()) {
if (PushNotificationService::check('mention', $profile->id)) {
$user = User::whereProfileId($profile->id)->first();
if ($user && $user->expo_token && $user->notify_enabled) {
MentionPushNotifyPipeline::dispatch($user->expo_token, $actor->username)->onQueue('pushnotify');
}
}
}
} }
} }