Fix our echomail sender is not the message originator

This commit is contained in:
Deon George 2023-07-29 17:48:09 +10:00
parent 944ae41fba
commit fb2471a05b
1 changed files with 5 additions and 6 deletions

View File

@ -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;