From fb2471a05bba91e69ff9dd3511dbacead09828ec Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 29 Jul 2023 17:48:09 +1000 Subject: [PATCH] Fix our echomail sender is not the message originator --- app/Jobs/MessageProcess.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Jobs/MessageProcess.php b/app/Jobs/MessageProcess.php index 9f5e8f1..6cf3798 100644 --- a/app/Jobs/MessageProcess.php +++ b/app/Jobs/MessageProcess.php @@ -196,7 +196,7 @@ class MessageProcess implements ShouldQueue if (! $ea) { Log::alert(sprintf('%s:! Echoarea [%s] doesnt exist for zone [%d]',self::LOGKEY,$this->msg->echoarea,$this->msg->fboss_o->zone->zone_id)); - Notification::route('netmail',$this->msg->fftn_o)->notify(new EchoareaNotExist($this->msg)); + Notification::route('netmail',$this->sender)->notify(new EchoareaNotExist($this->msg)); return; } @@ -255,15 +255,14 @@ class MessageProcess implements ShouldQueue // @todo Can the sender create it if it doesnt exist? // Can the system send messages to this area? - if (! $ea->sec_write || ($this->msg->fftn_o->security < $ea->sec_write)) { - Notification::route('netmail',$this->msg->fftn_o)->notify(new EchoareaNoWrite($this->msg)); + if (! $ea->sec_write || ($this->sender->security < $ea->sec_write)) { + Notification::route('netmail',$this->sender)->notify(new EchoareaNoWrite($this->msg)); return; } // If the node is not subsccribed - if ($this->msg->fftn_o->echoareas->search(function($item) use ($ea) { return $item->id === $ea->id; }) === FALSE) { - Notification::route('netmail',$this->msg->fftn_o)->notify(new EchoareaNotSubscribed($this->msg)); - } + if ($this->sender->echoareas->search(function($item) use ($ea) { return $item->id === $ea->id; }) === FALSE) + Notification::route('netmail',$this->sender)->notify(new EchoareaNotSubscribed($this->msg)); // We know about this area, store it $o = new Echomail;