Improvements to working out region for new addresses, Bounce netmails to a invalid address (that we would host)
This commit is contained in:
@@ -355,7 +355,6 @@ class Address extends Model
|
||||
// Work out region
|
||||
$region_id = NULL;
|
||||
$zone_id = NULL;
|
||||
|
||||
// We can only work out region/zone if we have a domain - this is for 2D parsing
|
||||
if ($matches[5] ?? NULL) {
|
||||
$o = new self;
|
||||
@@ -1357,7 +1356,7 @@ class Address extends Model
|
||||
case self::NODE_HC: // NC
|
||||
return self::active()
|
||||
->where('zone_id',$this->zone_id)
|
||||
->where('region_id',$this->region_id)
|
||||
->when($this->region_id,fn($q)=>$q->where('region_id',$this->region_id))
|
||||
->where('host_id',$this->host_id)
|
||||
->where('node_id',0)
|
||||
->where('point_id',0)
|
||||
@@ -1393,7 +1392,7 @@ class Address extends Model
|
||||
*/
|
||||
private function session(string $type): ?string
|
||||
{
|
||||
return ($this->exists && ($x=$this->system->sessions->where('id',$this->zone_id)->first())) ? ($x->pivot->{$type} ?: '') : NULL;
|
||||
return ($x=$this->system?->sessions->where('id',$this->zone_id)->first()) ? ($x->pivot->{$type} ?: '') : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user