System::match() now returns an array

This commit is contained in:
Deon George 2021-08-08 23:53:56 +10:00
parent 7922bc6a7a
commit 7ec01d778a
4 changed files with 5 additions and 5 deletions

View File

@ -317,7 +317,7 @@ class Packet extends FTNBase
private function newHeader(Address $o): void
{
$date = Carbon::now();
$ao = Setup::findOrFail(config('app.id'))->system->match($o->zone);
$ao = Setup::findOrFail(config('app.id'))->system->match($o->zone)->first();
// Create Header
$this->header = [

View File

@ -28,7 +28,7 @@ final class Ping extends Process
return FALSE;
Log::info(sprintf('Processing PING message from (%s) [%s]',$msg->user_from,$msg->fftn));
$ftns = Setup::findOrFail(config('app.id'))->system->match($msg->fftn_o->zone);
$ftns = Setup::findOrFail(config('app.id'))->system->match($msg->fftn_o->zone)->first();
$reply = sprintf("Your ping was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r",
$msg->date->toDateTimeString(),
@ -50,7 +50,7 @@ final class Ping extends Process
$o->tzoffset = $o->datetime->utcOffset();
$o->reply = $msg->msgid;
$o->fftn_id = $ftns->first()->id;
$o->fftn_id = $ftns->id;
$o->tftn_id = ($x=$msg->fftn_o) ? $x->id : NULL;
$o->flags = Message::FLAG_LOCAL;
$o->cost = 0;

View File

@ -30,7 +30,7 @@ final class Test extends Process
return FALSE;
Log::info(sprintf('Processing TEST message from (%s) [%s]',$msg->user_from,$msg->fftn));
$ftns = Setup::findOrFail(config('app.id'))->system->match($msg->fftn_o->zone);
$ftns = Setup::findOrFail(config('app.id'))->system->match($msg->fftn_o->zone)->first();
$reply = sprintf("Your test was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r",
$msg->date->toDateTimeString(),

View File

@ -14,7 +14,7 @@ trait MsgID
public function save(array $options = [])
{
if (! $this->exists) {
$ftns = Setup::findOrFail(config('app.id'))->system->match($this->fftn->zone);
$ftns = Setup::findOrFail(config('app.id'))->system->match($this->fftn->zone)->first();
if (is_null(Arr::get($this->attributes,'msgid')))
$this->attributes['msgid'] = sprintf('%s %08x',$ftns->ftn4d,timew());