Create TO ftn (for netmails), identify REPLYID, add file:list
This commit is contained in:
42
app/Console/Commands/FilesList.php
Normal file
42
app/Console/Commands/FilesList.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\File;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class FilesList extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'files:list';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'List files';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->table([
|
||||
'files.id' => 'ID',
|
||||
'file' => 'Filename',
|
||||
'area' => 'Filearea'
|
||||
],File::select(['files.id','file',DB::raw('fileareas.name AS filearea')])
|
||||
->join('fileareas',['fileareas.id'=>'files.filearea_id'])
|
||||
->cursor());
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
@@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\File\File;
|
||||
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Jobs\MessageProcess as Job;
|
||||
use App\Models\Zone;
|
||||
use App\Models\Address;
|
||||
|
||||
class PacketProcess extends Command
|
||||
{
|
||||
@@ -19,7 +19,7 @@ class PacketProcess extends Command
|
||||
protected $signature = 'packet:process'
|
||||
.' {pkt : Packet to process}'
|
||||
.' {--N|nobot : Dont process bots}'
|
||||
.' {system? : Zone the packet is from}';
|
||||
.' {ftn? : System the packet is from}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -37,7 +37,7 @@ class PacketProcess extends Command
|
||||
public function handle()
|
||||
{
|
||||
$f = new File($this->argument('pkt'));
|
||||
$s = $this->argument('system') ? Zone::where('name',$this->argument('system'))->singleOrFail() : NULL;
|
||||
$s = $this->argument('ftn') ? Address::findFTN($this->argument('ftn'))->system : NULL;
|
||||
|
||||
foreach (Packet::open($f,$s) as $msg) {
|
||||
// @todo Quick check that the packet should be processed by us.
|
||||
|
Reference in New Issue
Block a user