Reduce the need for Mailer::class in protocols

This commit is contained in:
2024-11-08 23:13:04 +11:00
parent ff4ecddb76
commit f0f2d74a14
5 changed files with 42 additions and 30 deletions

View File

@@ -14,7 +14,7 @@ use App\Classes\Protocol as BaseProtocol;
use App\Classes\Sock\Exception\SocketException;
use App\Classes\Sock\SocketClient;
use App\Exceptions\{FileGrewException,InvalidFTNException};
use App\Models\{Address,Mailer,Setup};
use App\Models\{Address,Setup};
final class Binkp extends BaseProtocol
{
@@ -155,7 +155,7 @@ final class Binkp extends BaseProtocol
if (! parent::onConnect($client)) {
Log::withContext(['pid'=>getmypid()]);
$this->session(Mailer::where('name','BINKP')->singleOrFail(),$client,(new Address));
$this->session($client,(new Address));
$this->client->close();
exit(0);
}

View File

@@ -11,7 +11,7 @@ use App\Classes\Sock\SocketClient;
use App\Exceptions\InvalidFTNException;
use App\Interfaces\CRC as CRCInterface;
use App\Interfaces\Zmodem as ZmodemInterface;
use App\Models\{Address,Mailer,Setup};
use App\Models\{Address,Setup};
use App\Traits\CRC as CRCTrait;
// http://ftsc.org/docs/fsc-0056.001
@@ -95,7 +95,7 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
if (! parent::onConnect($client)) {
Log::withContext(['pid'=>getmypid()]);
$this->session(Mailer::where('name','EMSI')->singleOrFail(),$client,(new Address));
$this->session($client,(new Address));
$this->client->close();
exit(0);
}

View File

@@ -10,7 +10,7 @@ use App\Classes\Sock\Exception\SocketException;
use App\Classes\Sock\SocketClient;
use App\Interfaces\CRC as CRCInterface;
use App\Interfaces\Zmodem as ZmodemInterface;
use App\Models\{Address,Mailer};
use App\Models\Address;
use App\Traits\CRC as CRCTrait;
/**
@@ -213,7 +213,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
if (! parent::onConnect($client)) {
Log::withContext(['pid'=>getmypid()]);
$this->session(Mailer::where('name','ZMODEM')->singleOrFail(),$client);
$this->session($client);
$this->client->close();
Log::info(sprintf('%s:= onConnect - Connection closed [%s]',self::LOGKEY,$client->address_remote));