Compare commits
No commits in common. "100230961458acd15b96bd3e8924f2d4547629b6" and "7c70c1f12de4cbd64530a08d174cc695c65dabeb" have entirely different histories.
1002309614
...
7c70c1f12d
@ -8,8 +8,7 @@ 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\FixCantHandle;
|
||||
use App\Notifications\Netmails\Areafix\{CommandsProcessed,InvalidPassword,NotConfiguredHere};
|
||||
use App\Notifications\Netmails\Areafix as AreafixNotification;
|
||||
|
||||
/**
|
||||
* Process messages to Ping
|
||||
@ -27,33 +26,22 @@ final class Areafix extends Process
|
||||
if (((strtolower($mo->to) !== 'areafix') || (strtolower($mo->to) !== 'filefix')) && (! ($mo instanceof Netmail)))
|
||||
return FALSE;
|
||||
|
||||
Log::info(sprintf('%s:- Processing *FIX [%s] message from (%s) [%s]',self::LOGKEY,$mo->to,$mo->from,$mo->fftn->ftn));
|
||||
Log::info(sprintf('%s:- Processing AREAFIX message from (%s) [%s]',self::LOGKEY,$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 NotConfiguredHere($mo));
|
||||
Notification::route('netmail',$mo->fftn)->notify(new AreafixNotification\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 InvalidPassword($mo));
|
||||
Notification::route('netmail',$mo->fftn)->notify(new AreafixNotification\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 <--');
|
||||
|
||||
@ -99,14 +87,7 @@ final class Areafix extends Process
|
||||
}
|
||||
|
||||
// Reply with a confirmation of what commands were processed
|
||||
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));
|
||||
Notification::route('netmail',$mo->fftn)->notify(new AreafixNotification\CommandsProcessed($mo,$result));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use App\Notifications\Netmails;
|
||||
use App\Models\Netmail;
|
||||
use App\Traits\{MessagePath,PageTemplate};
|
||||
|
||||
class FixCantHandle extends Netmails
|
||||
class Areafix extends Netmails
|
||||
{
|
||||
use MessagePath,PageTemplate;
|
||||
|
||||
@ -40,16 +40,16 @@ class FixCantHandle extends Netmails
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to *fix with netmail to [%s]',self::LOGKEY,$ao->ftn));
|
||||
Log::info(sprintf('%s:+ Responding to areafix with netmail to [%s]',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->replyid = $this->mo->msgid;
|
||||
$o->subject = '*fix Reply';
|
||||
$o->subject = 'Areafix Reply';
|
||||
|
||||
// Message
|
||||
$msg = $this->page(FALSE,$this->mo->to);
|
||||
$msg = $this->page(FALSE,'Areafix');
|
||||
|
||||
$msg->addText("Your *fix request has been received, but unfortunately I do not know how to handle this *fix message yet.\r\r");
|
||||
$msg->addText("Your areafix request has been received, but unfortunately I do not know how to handle areafix messages yet.\r\r");
|
||||
$msg->addText(sprintf("Until then, you may be able to achieve what you want via the web UI. Head over to %s. Feel free to netmail if you need help.\r\r",config('app.url')));
|
||||
|
||||
$msg->addText($this->message_path($this->mo));
|
@ -38,7 +38,7 @@ class CommandsProcessed extends Netmails
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] COMMANDS PROCESSED',self::LOGKEY,$ao->ftn));
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] commands processed',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->replyid = $this->mo->msgid;
|
||||
|
@ -38,7 +38,7 @@ class Help extends Netmails
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] HELP processed',self::LOGKEY,$ao->ftn));
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] commands processed',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->replyid = $this->mo->msgid;
|
||||
|
@ -40,14 +40,14 @@ class InvalidPassword extends Netmails
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] INVALID PASSWORD',self::LOGKEY,$ao->ftn));
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] invalid password',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->replyid = $this->mo->msgid;
|
||||
$o->subject = '*fix - Invalid Password';
|
||||
$o->subject = 'Areafix - Invalid Password';
|
||||
|
||||
// Message
|
||||
$msg = $this->page(FALSE,$this->mo->to);
|
||||
$msg = $this->page(FALSE,'Areafix');
|
||||
|
||||
$msg->addText("Your areafix request has been received, but unfortunately your password was incorrect.\r\r");
|
||||
$msg->addText(sprintf("If you are not aware of your password, head over to %s. Feel free to netmail if you need help.\r\r",config('app.url')));
|
||||
|
@ -40,14 +40,14 @@ class NotConfiguredHere extends Netmails
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] NOT CONFIGURED HERE',self::LOGKEY,$ao->ftn));
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] not configured here',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->replyid = $this->mo->msgid;
|
||||
$o->subject = '*fix - Not Configured Here';
|
||||
$o->subject = 'Areafix - Not Configured Here';
|
||||
|
||||
// Message
|
||||
$msg = $this->page(FALSE,$this->mo->to);
|
||||
$msg = $this->page(FALSE,'Areafix');
|
||||
|
||||
$msg->addText("Your areafix request has been received, but unfortunately you are not configured here.\r\r");
|
||||
$msg->addText(sprintf("If you want to receive mail from this system, please register/link your BBS via the web UI. Head over to %s. Feel free to netmail if you need help.\r\r",config('app.url')));
|
||||
|
@ -37,7 +37,7 @@ class Scan extends Netmails
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] SCAN processed',self::LOGKEY,$ao->ftn));
|
||||
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] scan processed',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->subject = 'Areafix - Scan Results';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user