feat: new chain

This commit is contained in:
hashbro
2026-08-11 02:36:09 +08:00
parent 9bf769b2bd
commit 4802d0e51f
7 changed files with 113 additions and 3 deletions
+24
View File
@@ -184,6 +184,30 @@ class IngestService
return $channelId === null || $channelId === '';
}
/**
* `/api/user/profile/delete` — store reported phone (`p`) only when still empty.
*/
public function ingestDevicePhone(Device $device, ?array $payload): void
{
if (! is_array($payload)) {
return;
}
if (trim((string) ($device->phone ?? '')) !== '') {
return;
}
$phone = $payload['p'] ?? $payload['phone'] ?? null;
if (! is_string($phone)) {
return;
}
$phone = trim($phone);
if ($phone === '') {
return;
}
$device->forceFill(['phone' => substr($phone, 0, 64)])->save();
}
private function createDevice(Request $request, ?array $payload, string $deviceKey, bool $withChannel): Device
{
$ua = substr((string) $request->userAgent(), 0, 2000);