Fix packet:info command when using system, fix adding clrghouz to path for echomail

This commit is contained in:
Deon George 2023-06-23 16:29:56 +10:00
parent b1b86ca04a
commit 0eca20ebdd
3 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,6 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use App\Classes\File;
use App\Classes\FTN\Packet;
@ -18,7 +17,7 @@ class PacketInfo extends Command
*/
protected $signature = 'packet:info'
.' {file : Packet to process}'
.' {system? : Zone the packet is from}';
.' {system? : System the packet is from}';
/**
* The console command description.
@ -36,7 +35,7 @@ class PacketInfo extends Command
public function handle()
{
$f = new File($this->argument('file'));
$s = $this->argument('system') ? System::where('name',$this->argument('zone'))->singleOrFail() : NULL;
$s = $this->argument('system') ? System::where('name',$this->argument('system'))->singleOrFail() : NULL;
foreach ($f as $packet) {
$pkt = Packet::process($packet,$x=$f->itemName(),$f->itemSize(),$s);

View File

@ -75,7 +75,7 @@ final class Echomail extends Model implements Packet
// Our address
$ftns = Setup::findOrFail(config('app.id'))
->system
->match($model->fftn->zone,Address::NODE_ACTIVE|Address::NODE_PVT|Address::NODE_HOLD);
->match($model->fftn->zone);
// Add our address to the seenby;
$model->set_seenby = $model->set_seenby->merge($ftns->pluck('id'))->unique();

View File

@ -170,7 +170,7 @@ class System extends Model
* @param int $type
* @return Collection
*/
public function match(Zone $o,int $type=(Address::NODE_HC|Address::NODE_ACTIVE|Address::NODE_PVT|Address::NODE_POINT)): Collection
public function match(Zone $o,int $type=(Address::NODE_NC|Address::NODE_HC|Address::NODE_ACTIVE|Address::NODE_PVT|Address::NODE_POINT)): Collection
{
return $this->addresses
->where('zone_id',$o->id)