Fix filefix FILELIST command when area not provided
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m32s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
Deon George 2025-01-07 15:58:23 +11:00
parent 2c1ab88bbd
commit aeea49abe7
2 changed files with 9 additions and 6 deletions

View File

@ -41,26 +41,29 @@ class Filelist extends Base
if ($days > 365)
$days = 365;
if (! ($area=Arr::get($this->arguments,0)))
return sprintf('%-25s <-- INVALID, AN AREA IS REQUIRED',$command);
// Area exists
if ($fa=$this->mo->fftn->domain->fileareas->where('name',$this->arguments[0])->pop()) {
if ($fa=$this->mo->fftn->domain->fileareas->where('name',$area)->pop()) {
// If already subscribed
if ($this->mo->fftn->fileareas->pluck('name')->contains($this->arguments[0])) {
if ($this->mo->fftn->fileareas->pluck('name')->contains($area)) {
Notification::route('netmail',$this->mo->fftn)
->notify(new FileListNotification($this->mo,$fa,$days));
Log::debug(sprintf('%s:- FTN [%s] FILELIST [%s] DAYS [%d]',self::LOGKEY,$this->mo->fftn->ftn,$this->arguments[0],$days));
Log::debug(sprintf('%s:- FTN [%s] FILELIST [%s] DAYS [%d]',self::LOGKEY,$this->mo->fftn->ftn,$area,$days));
return sprintf('%-25s <-- FILELIST [%d] DAYS',$command,$days);
// If not subscribed
} else {
Log::debug(sprintf('%s:- FTN [%s] is NOT subscribed to [%s], NO ACTION taken',self::LOGKEY,$this->mo->fftn->ftn,$this->arguments[0]));
Log::debug(sprintf('%s:- FTN [%s] is NOT subscribed to [%s], NO ACTION taken',self::LOGKEY,$this->mo->fftn->ftn,$area));
return sprintf('%-25s <-- NOT subscribed, NO ACTION taken',$command);
}
} else {
Log::debug(sprintf('%s:- FILE [%s] area UNKNOWN [%s], NO ACTION taken',self::LOGKEY,$this->mo->fftn->ftn,$this->arguments[0]));
Log::debug(sprintf('%s:- FILE [%s] area UNKNOWN [%s], NO ACTION taken',self::LOGKEY,$this->mo->fftn->ftn,$area));
return sprintf('%-25s <-- AREA UNKNOWN, NO ACTION TAKEN',$command);
}

View File

@ -34,7 +34,7 @@ class Resend extends Base
if (count($this->arguments) < 2)
return sprintf('%-25s <-- INVALID, NOT ENOUGH ARGUMENTS',$command);
elseif (count($this->arguments) > 2)
return sprintf('%-25s <-- INVALID, TOO MANU ARGUMENTS',$command);
return sprintf('%-25s <-- INVALID, TOO MANY ARGUMENTS',$command);
Log::debug(sprintf('%s:- Resending [%s] from [%s] to [%s]',self::LOGKEY,$this->arguments[1],$this->arguments[0],$this->mo->fftn->ftn));