Added filefix %LIST

This commit is contained in:
2024-11-26 12:44:21 +11:00
parent b67ae28b98
commit a161b8fc5e
4 changed files with 146 additions and 4 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Classes\FTN\Process\Netmail\Robot\Filefix;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use App\Classes\FTN\Process\Netmail\Robot\Areafix\Base;
use App\Notifications\Netmails\Filefix\AreaList as AreaListNotification;
// LIST - List echoareas in a domain
class AreaList extends Base
{
private const LOGKEY = 'AFS';
private const command = '%LIST';
public static function help(): array
{
return [
self::command,
' List the available fileareas in this network',
];
}
public function process(): string
{
Log::debug(sprintf('%s:- Filefix [%s] for [%s] for [%s]',self::LOGKEY,self::command,$this->mo->fftn->ftn,join('|',$this->arguments)));
if (count($this->arguments) > 1)
return sprintf('%-25s <-- INVALID COMMAND',self::command);
else {
Notification::route('netmail',$this->mo->fftn)
->notify(new AreaListNotification($this->mo));
return sprintf('%-25s <-- COMMAND PROCESSED',self::command);
}
}
}