Code improvement to our_address(), reducing arguments

This commit is contained in:
2024-04-21 21:40:55 +10:00
parent 1c270025cf
commit bba6f93fbc
9 changed files with 39 additions and 20 deletions

View File

@@ -829,7 +829,7 @@ class Address extends Model
public function getPacket(Collection $msgs,string $passwd=NULL): ?Packet
{
$s = Setup::findOrFail(config('app.id'));
$ao = our_address($this->zone->domain,$this);
$ao = our_address($this);
// If we dont match on the address, we cannot pack mail for that system
if (! $ao) {

View File

@@ -214,7 +214,7 @@ final class Echomail extends Model implements Packet
{
Log::info(sprintf('%s:+ Bundling [%s]',self::LOGKEY,$this->id));
$sysaddress = our_address($this->fftn->zone->domain,$this->fftn);
$sysaddress = our_address($this->fftn);
if (! $sysaddress)
throw new \Exception(sprintf('%s:! We dont have an address in this network? (%s)',self::LOGKEY,$this->fftn->zone->domain->name));

View File

@@ -210,7 +210,7 @@ final class Netmail extends Model implements Packet
// Add our address to the VIA line
$via->push(
sprintf('%s @%s.UTC %s %d.%d/%s %s',
our_address($this->fftn->zone->domain,$this->fftn)->ftn3d,
our_address($this->fftn)->ftn3d,
Carbon::now()->utc()->format('Ymd.His'),
str_replace(' ','_',Setup::PRODUCT_NAME),
Setup::PRODUCT_VERSION_MAJ,