Repair: copy legacy joinDate into new user's created_at when creating users from legacy wallz
This commit is contained in:
@@ -13,6 +13,10 @@ use Illuminate\Support\Str;
|
||||
|
||||
class MessageNotificationService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly MessagingPresenceService $presence,
|
||||
) {}
|
||||
|
||||
public function notifyNewMessage(Conversation $conversation, Message $message, User $sender): void
|
||||
{
|
||||
if (! DB::getSchemaBuilder()->hasTable('notifications')) {
|
||||
@@ -36,6 +40,13 @@ class MessageNotificationService
|
||||
->whereIn('id', $recipientIds)
|
||||
->get()
|
||||
->filter(fn (User $recipient) => $recipient->allowsMessagesFrom($sender))
|
||||
->filter(function (User $recipient): bool {
|
||||
if (! (bool) config('messaging.notifications.offline_fallback_only', true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return ! $this->presence->isUserOnline((int) $recipient->id);
|
||||
})
|
||||
->pluck('id')
|
||||
->map(fn ($id) => (int) $id)
|
||||
->values()
|
||||
|
||||
Reference in New Issue
Block a user