feat: new chain
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user