Changed to using new Address Model, Implemented Setup, Some minor CSS changes
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\Protocol\Binkd as BinkdClass;
|
||||
use App\Classes\Sock\SocketClient;
|
||||
use App\Models\Node;
|
||||
use App\Models\{Address,Setup};
|
||||
|
||||
class BinkpSend extends Command
|
||||
{
|
||||
@@ -36,11 +36,19 @@ class BinkpSend extends Command
|
||||
{
|
||||
Log::info('Call BINKP send');
|
||||
|
||||
$no = Node::findFTN($this->argument('ftn'));
|
||||
$no = Address::findFTN($this->argument('ftn'));
|
||||
if (! $no)
|
||||
throw new ModelNotFoundException('Unknown node: '.$this->argument('ftn'));
|
||||
|
||||
$client = SocketClient::create($no->address,$no->port);
|
||||
if ($no->system->mailer_type != Setup::O_BINKP)
|
||||
throw new \Exception(sprintf('Node [%s] doesnt support BINKD',$this->argument('ftn')));
|
||||
|
||||
$o = new BinkdClass;
|
||||
if ((! $no->system->mailer_address) || (! $no->system->mailer_port))
|
||||
throw new \Exception(sprintf('Unable to poll [%s] missing mailer details',$this->argument('ftn')));
|
||||
|
||||
$client = SocketClient::create($no->system->mailer_address,$no->system->mailer_port);
|
||||
|
||||
$o = new BinkdClass(Setup::findOrFail(config('app.id')));
|
||||
$o->session(BinkdClass::SESSION_BINKP,$client,$no);
|
||||
|
||||
Log::info(sprintf('Connection ended: %s',$client->getAddress()),['m'=>__METHOD__]);
|
||||
|
Reference in New Issue
Block a user