Separatly handle areafix/filefix
This commit is contained in:
@@ -8,7 +8,8 @@ use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\FTN\Process;
|
||||
use App\Classes\FTN\Process\Netmail\Robot\Unknown;
|
||||
use App\Models\{Echomail,Netmail};
|
||||
use App\Notifications\Netmails\Areafix as AreafixNotification;
|
||||
use App\Notifications\Netmails\FixCantHandle;
|
||||
use App\Notifications\Netmails\Areafix\{CommandsProcessed,InvalidPassword,NotConfiguredHere};
|
||||
|
||||
/**
|
||||
* Process messages to Ping
|
||||
@@ -26,22 +27,33 @@ final class Areafix extends Process
|
||||
if (((strtolower($mo->to) !== 'areafix') || (strtolower($mo->to) !== 'filefix')) && (! ($mo instanceof Netmail)))
|
||||
return FALSE;
|
||||
|
||||
Log::info(sprintf('%s:- Processing AREAFIX message from (%s) [%s]',self::LOGKEY,$mo->from,$mo->fftn->ftn));
|
||||
Log::info(sprintf('%s:- Processing *FIX [%s] message from (%s) [%s]',self::LOGKEY,$mo->to,$mo->from,$mo->fftn->ftn));
|
||||
|
||||
// If this is not a node we manage, then respond with a sorry can help you
|
||||
if (! $mo->fftn->system->sessions->count()) {
|
||||
Notification::route('netmail',$mo->fftn)->notify(new AreafixNotification\NotConfiguredHere($mo));
|
||||
Notification::route('netmail',$mo->fftn)->notify(new NotConfiguredHere($mo));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// If this nodes password is not correct
|
||||
if ($mo->fftn->pass_fix !== strtoupper($mo->subject)) {
|
||||
Notification::route('netmail',$mo->fftn)->notify(new AreafixNotification\InvalidPassword($mo));
|
||||
Notification::route('netmail',$mo->fftn)->notify(new InvalidPassword($mo));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((strtolower($mo->to) === 'areafix'))
|
||||
return self::areafix($mo);
|
||||
|
||||
if ((strtolower($mo->to) === 'filefix'))
|
||||
return self::filefix($mo);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public static function areafix(Netmail $mo): bool
|
||||
{
|
||||
$result = collect();
|
||||
$result->push('--> BEGIN <--');
|
||||
|
||||
@@ -87,7 +99,14 @@ final class Areafix extends Process
|
||||
}
|
||||
|
||||
// Reply with a confirmation of what commands were processed
|
||||
Notification::route('netmail',$mo->fftn)->notify(new AreafixNotification\CommandsProcessed($mo,$result));
|
||||
Notification::route('netmail',$mo->fftn)->notify(new CommandsProcessed($mo,$result));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public static function filefix(Netmail $mo): bool
|
||||
{
|
||||
Notification::route('netmail',$mo->fftn)->notify(new FixCantHandle($mo));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user