Code cleanup, no functional changes

This commit is contained in:
2023-06-27 19:39:11 +12:00
parent b70a36003a
commit ad36da0bb1
64 changed files with 466 additions and 438 deletions

View File

@@ -52,21 +52,21 @@ class Message extends FTNBase
];
// Flags for messages
public const FLAG_PRIVATE = 1<<0;
public const FLAG_CRASH = 1<<1;
public const FLAG_RECD = 1<<2;
public const FLAG_SENT = 1<<3;
public const FLAG_FILEATTACH = 1<<4;
public const FLAG_INTRANSIT = 1<<5;
public const FLAG_ORPHAN = 1<<6;
public const FLAG_KILLSENT = 1<<7;
public const FLAG_LOCAL = 1<<8;
public const FLAG_HOLD = 1<<9;
public const FLAG_UNUSED_10 = 1<<10;
public const FLAG_FREQ = 1<<11;
public const FLAG_RETRECEIPT = 1<<12;
public const FLAG_ISRETRECEIPT = 1<<13;
public const FLAG_AUDITREQ = 1<<14;
public const FLAG_PRIVATE = 1<<0;
public const FLAG_CRASH = 1<<1;
public const FLAG_RECD = 1<<2;
public const FLAG_SENT = 1<<3;
public const FLAG_FILEATTACH = 1<<4;
public const FLAG_INTRANSIT = 1<<5;
public const FLAG_ORPHAN = 1<<6;
public const FLAG_KILLSENT = 1<<7;
public const FLAG_LOCAL = 1<<8;
public const FLAG_HOLD = 1<<9;
public const FLAG_UNUSED_10 = 1<<10;
public const FLAG_FREQ = 1<<11;
public const FLAG_RETRECEIPT = 1<<12;
public const FLAG_ISRETRECEIPT = 1<<13;
public const FLAG_AUDITREQ = 1<<14;
public const FLAG_FILEUPDATEREQ = 1<<15;
public const FLAG_ECHOMAIL = 1<<16;
@@ -220,14 +220,14 @@ class Message extends FTNBase
switch ($key) {
// From Addresses
case 'fz': return Arr::get($this->src,'z');
case 'fn': return $this->src ? Arr::get($this->src,'n') : Arr::get($this->header,'onet');;
case 'ff': return $this->src ? Arr::get($this->src,'f') : Arr::get($this->header,'onode');;
case 'fn': return $this->src ? Arr::get($this->src,'n') : Arr::get($this->header,'onet');
case 'ff': return $this->src ? Arr::get($this->src,'f') : Arr::get($this->header,'onode');
case 'fp': return Arr::get($this->src,'p');
case 'fd': return Arr::get($this->src,'d');
case 'fdomain':
// We'll use the zone's domain if this method class was called with a zone
if ($this->zone && (($this->zone->domain->name == Arr::get($this->src,'d')) || ! Arr::get($this->src,'d')))
if ($this->zone && (($this->zone->domain->name === Arr::get($this->src,'d')) || ! Arr::get($this->src,'d')))
return $this->zone->domain;
// If we get the domain from the packet, we'll find it
@@ -239,7 +239,7 @@ class Message extends FTNBase
case 'tdomain':
// We'll use the zone's domain if this method class was called with a zone
if ($this->zone && (($this->zone->domain->name == Arr::get($this->dst,'d')) || ! Arr::get($this->dst,'d')))
if ($this->zone && (($this->zone->domain->name === Arr::get($this->dst,'d')) || ! Arr::get($this->dst,'d')))
return $this->zone->domain;
// If we get the domain from the packet, we'll find it
@@ -252,11 +252,11 @@ class Message extends FTNBase
case 'fzone':
// Use the zone if this class was called with it.
if ($this->zone && ($this->fz == $this->zone->zone_id))
if ($this->zone && ($this->fz === $this->zone->zone_id))
return $this->zone;
if ($this->fdomain) {
if (($x=$this->fdomain->zones->search(function($item) { return $item->zone_id == $this->fz; })) !== FALSE)
if (($x=$this->fdomain->zones->search(function($item) { return $item->zone_id === $this->fz; })) !== FALSE)
return $this->fdomain->zones->get($x);
}
@@ -267,11 +267,11 @@ class Message extends FTNBase
case 'tzone':
// Use the zone if this class was called with it.
if ($this->zone && ($this->tz == $this->zone->zone_id))
if ($this->zone && ($this->tz === $this->zone->zone_id))
return $this->zone;
if ($this->tdomain) {
if (($x=$this->tdomain->zones->search(function($item) { return $item->zone_id == $this->tz; })) !== FALSE)
if (($x=$this->tdomain->zones->search(function($item) { return $item->zone_id === $this->tz; })) !== FALSE)
return $this->tdomain->zones->get($x);
}
@@ -285,7 +285,7 @@ class Message extends FTNBase
case 'tz': return Arr::get($this->echoarea ? $this->src : $this->dst,'z');
case 'tn': return Arr::get($this->header,'dnet');
case 'tf': return Arr::get($this->header,'dnode');
case 'tp': ;return Arr::get($this->dst,'p',0); // @todo this wont work for netmails, since dst is not set for in transit messages
case 'tp': return Arr::get($this->dst,'p',0); // @todo this wont work for netmails, since dst is not set for in transit messages
case 'fftn':
case 'fftn_o':
@@ -658,7 +658,7 @@ class Message extends FTNBase
} else {
$node = (int)$item;
};
}
$ftn = sprintf('%d:%d/%d',$this->fz,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX);
// @todo This should be enhanced to include the address at the time of the message.