Optimise the setting of our configuration via Setup::class, optimise the calculation of our_addresses()

This commit is contained in:
2024-11-02 23:30:42 +11:00
parent 1b228a58c9
commit 3b7ce4b9ce
9 changed files with 72 additions and 66 deletions

View File

@@ -504,8 +504,6 @@ class Message extends FTNBase
*/
public function __toString(): string
{
$s = Setup::findOrFail(config('app.id'));
$return = pack(collect(self::HEADER)->pluck(1)->join(''),
$this->mo->fftn->node_id, // Originating Node
$this->mo->tftn->node_id, // Destination Node
@@ -529,7 +527,7 @@ class Message extends FTNBase
$this->mo->kludges->put('TOPT',$this->mo->tftn->point_id);
}
$this->mo->kludges->put($this->mo->isFlagSet(self::FLAG_LOCAL) ? 'PID:' : 'TID:',sprintf('%s %s',Setup::PRODUCT_NAME_SHORT,$s->version));
$this->mo->kludges->put($this->mo->isFlagSet(self::FLAG_LOCAL) ? 'PID:' : 'TID:',sprintf('%s %s',Setup::PRODUCT_NAME_SHORT,Setup::version()));
$this->mo->kludges->put('DBID:',$this->mo->id);
if ($this->mo instanceof Echomail)
@@ -561,7 +559,7 @@ class Message extends FTNBase
$return .= sprintf("\x01Via %s @%s.UTC %s %s\r",
$this->us->ftn3d,
Carbon::now()->format('Ymd.His'),
Setup::PRODUCT_NAME_SHORT,$s->version);
Setup::PRODUCT_NAME_SHORT,Setup::version());
} else {
// FTS-0004.001/FSC-0068.001 The message SEEN-BY lines