mirror of https://github.com/Lukibeg/OmniBoard.git
Compare commits
No commits in common. "67b35bdf3ed12150cc390fe5c8774e97d370eac6" and "3d7bb226194de147ee57b2a161221b51d84e228b" have entirely different histories.
67b35bdf3e
...
3d7bb22619
|
|
@ -51,6 +51,7 @@ public function handle(Request $request)
|
|||
return response()->json(['error' => 'Fila não encontrada'], 404);
|
||||
}
|
||||
|
||||
// Recupera Agente (se aplicável e se não for canal Local)
|
||||
$agent = $this->findAgent($tenant->id, $data);
|
||||
|
||||
|
||||
|
|
@ -248,6 +249,10 @@ private function handleJoin($queue, $data)
|
|||
|
||||
private function saveAgent($interface, $tenant)
|
||||
{
|
||||
// Ignora canais locais para não sujar o banco
|
||||
if (str_starts_with($interface, 'Local/')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$exists = Agent::where('tenant_id', $tenant->id)
|
||||
->where('interface', $interface)
|
||||
|
|
@ -291,6 +296,10 @@ private function findAgent($tenantId, $data)
|
|||
{
|
||||
$interface = $data['Interface'] ?? $data['MemberName'] ?? null;
|
||||
|
||||
// Se for canal Local/ ou nulo, retorna null para não processar
|
||||
if (!$interface || str_starts_with($interface, 'Local/')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Agent::where('tenant_id', $tenantId)
|
||||
->where('interface', $interface)
|
||||
|
|
|
|||
Loading…
Reference in New Issue