From 7ec01d778a30e5c2927027ec5812875f4b54bb03 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 8 Aug 2021 23:53:56 +1000 Subject: [PATCH] System::match() now returns an array --- app/Classes/FTN/Packet.php | 2 +- app/Classes/FTN/Process/Ping.php | 4 ++-- app/Classes/FTN/Process/Test.php | 2 +- app/Traits/MsgID.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Classes/FTN/Packet.php b/app/Classes/FTN/Packet.php index c6baa0e..13a1575 100644 --- a/app/Classes/FTN/Packet.php +++ b/app/Classes/FTN/Packet.php @@ -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 = [ diff --git a/app/Classes/FTN/Process/Ping.php b/app/Classes/FTN/Process/Ping.php index 225d493..6f91112 100644 --- a/app/Classes/FTN/Process/Ping.php +++ b/app/Classes/FTN/Process/Ping.php @@ -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; diff --git a/app/Classes/FTN/Process/Test.php b/app/Classes/FTN/Process/Test.php index 3b51dae..3e8d76a 100644 --- a/app/Classes/FTN/Process/Test.php +++ b/app/Classes/FTN/Process/Test.php @@ -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(), diff --git a/app/Traits/MsgID.php b/app/Traits/MsgID.php index bb417ea..d224d5f 100644 --- a/app/Traits/MsgID.php +++ b/app/Traits/MsgID.php @@ -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());