Process packet seenby/path/via lines when saving echomail/netmail

This commit is contained in:
2023-09-20 20:29:23 +10:00
parent 7fedf88d8c
commit 612efda945
11 changed files with 337 additions and 230 deletions

View File

@@ -6,7 +6,7 @@ use Illuminate\Console\Command;
use App\Classes\File;
use App\Classes\FTN\Packet;
use App\Models\System;
use App\Models\Address;
class PacketInfo extends Command
{
@@ -17,7 +17,7 @@ class PacketInfo extends Command
*/
protected $signature = 'packet:info'
.' {file : Packet to process}'
.' {system? : System the packet is from}';
.' {ftn? : FTN the packet is from}';
/**
* The console command description.
@@ -35,10 +35,10 @@ class PacketInfo extends Command
public function handle()
{
$f = new File($this->argument('file'));
$s = $this->argument('system') ? System::where('name',$this->argument('system'))->singleOrFail() : NULL;
$a = $this->argument('ftn') ? Address::findFTN($this->argument('ftn')) : NULL;
foreach ($f as $packet) {
$pkt = Packet::process($packet,$x=$f->itemName(),$f->itemSize(),$s);
$pkt = Packet::process($packet,$x=$f->itemName(),$f->itemSize(),$a->zone->domain);
$this->alert(sprintf('File Name: %s',$x));