Fix date being used in mail packets, timezone was effectively being to a timestamp with the timezone already
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m49s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
Deon George 2024-06-25 13:09:48 +10:00
parent 11b7dc4229
commit ad0ad73b0c
11 changed files with 17 additions and 15 deletions

View File

@ -497,7 +497,7 @@ class Message extends FTNBase
$this->mo->tftn->host_id, // Destination Net $this->mo->tftn->host_id, // Destination Net
$this->mo->flags&~(self::FLAG_INTRANSIT|self::FLAG_LOCAL), // Turn off our local/intransit bits $this->mo->flags&~(self::FLAG_INTRANSIT|self::FLAG_LOCAL), // Turn off our local/intransit bits
$this->mo->cost, $this->mo->cost,
$this->mo->date->format('d M y H:i:s'), $this->mo->datetime->format('d M y H:i:s'),
); );
$return .= $this->mo->to."\00"; $return .= $this->mo->to."\00";
@ -523,7 +523,7 @@ class Message extends FTNBase
$return .= sprintf("AREA:%s\r",strtoupper($this->mo->echoarea->name)); $return .= sprintf("AREA:%s\r",strtoupper($this->mo->echoarea->name));
// Add some kludges // Add some kludges
$return .= sprintf("\01TZUTC: %s\r",str_replace('+','',$this->mo->date->getOffsetString(''))); $return .= sprintf("\01TZUTC: %s\r",str_replace('+','',$this->mo->datetime->getOffsetString('')));
if ($this->mo->msgid) if ($this->mo->msgid)
$return .= sprintf("\01MSGID: %s\r",$this->mo->msgid); $return .= sprintf("\01MSGID: %s\r",$this->mo->msgid);

View File

@ -97,7 +97,7 @@ class PacketInfo extends Command
} }
foreach ($pkt->errors as $msg) { foreach ($pkt->errors as $msg) {
$this->error(sprintf('- Date: %s',$msg->date)); $this->error(sprintf('- Date: %s',$msg->datetime));
$this->error(sprintf(' - FLAGS: %s',$msg->flags()->filter()->keys()->join(', '))); $this->error(sprintf(' - FLAGS: %s',$msg->flags()->filter()->keys()->join(', ')));
$this->error(sprintf(' - From: %s (%s)',$msg->from,$msg->fftn)); $this->error(sprintf(' - From: %s (%s)',$msg->from,$msg->fftn));
$this->error(sprintf(' - To: %s (%s)',$msg->to,$msg->tftn)); $this->error(sprintf(' - To: %s (%s)',$msg->to,$msg->tftn));
@ -112,4 +112,4 @@ class PacketInfo extends Command
return self::SUCCESS; return self::SUCCESS;
} }
} }

View File

@ -62,8 +62,8 @@ class Test extends Echomails
$msg->addText( $msg->addText(
sprintf("Your test was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r\r", sprintf("Your test was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r\r",
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
$this->mo->date->diffForHumans(['parts'=>3,'syntax'=>CarbonInterface::DIFF_ABSOLUTE]) $this->mo->datetime->diffForHumans(['parts'=>3,'syntax'=>CarbonInterface::DIFF_ABSOLUTE])
) )
); );

View File

@ -53,7 +53,7 @@ class EchoareaNoWrite extends Netmails
$this->mo->msgid, $this->mo->msgid,
$this->mo->to, $this->mo->to,
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
) )
); );

View File

@ -55,7 +55,7 @@ class EchoareaNotExist extends Netmails
$this->mo->msgid, $this->mo->msgid,
$this->mo->to, $this->mo->to,
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
) )
); );

View File

@ -53,7 +53,7 @@ class EchoareaNotSubscribed extends Netmails
$this->mo->msgid, $this->mo->msgid,
$this->mo->to, $this->mo->to,
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
) )
); );

View File

@ -53,7 +53,7 @@ class EchomailBadAddress extends Netmails
$this->mo->msgid, $this->mo->msgid,
$this->mo->to, $this->mo->to,
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
) )
); );

View File

@ -55,7 +55,7 @@ class NetmailHubNoUser extends Netmails
$this->mo->msgid, $this->mo->msgid,
$this->mo->to, $this->mo->to,
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
) )
); );

View File

@ -55,8 +55,8 @@ class Ping extends Netmails
$msg->addText( $msg->addText(
sprintf("Your ping was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r\r", sprintf("Your ping was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r\r",
Carbon::now()->utc()->toDateTimeString(), Carbon::now()->utc()->toDateTimeString(),
$this->mo->date->utc()->toDateTimeString(), $this->mo->datetime->utc()->toDateTimeString(),
$this->mo->date->diffForHumans(['parts'=>3,'syntax'=>CarbonInterface::DIFF_ABSOLUTE]) $this->mo->datetime->diffForHumans(['parts'=>3,'syntax'=>CarbonInterface::DIFF_ABSOLUTE])
) )
); );

View File

@ -59,9 +59,11 @@ trait MessageAttributes
return ($this->msg_src) ? $this->msg_src : $this->rebuildMessage(); return ($this->msg_src) ? $this->msg_src : $this->rebuildMessage();
} }
/** @deprecated use datetime? */
public function getDateAttribute(): Carbon public function getDateAttribute(): Carbon
{ {
return $this->datetime->utcOffset($this->tzoffset); Log::alert(sprintf('%s:! This function is deprecated',self::LOGKEY),['class'=>get_class($this)]);
return $this->datetime;
} }
public function getOriginAttribute(string $val=NULL): ?string public function getOriginAttribute(string $val=NULL): ?string

View File

@ -19,7 +19,7 @@ trait MessagePath
$reply .= str_replace("\r---","\r#--",$mo->msg)."\r"; $reply .= str_replace("\r---","\r#--",$mo->msg)."\r";
$reply .= "+------------------------------------[ CONTROL LINES ]-+\r"; $reply .= "+------------------------------------[ CONTROL LINES ]-+\r";
$reply .= sprintf("DATE: %s\r",$mo->date->format('Y-m-d H:i:s')); $reply .= sprintf("DATE: %s\r",$mo->datetime->format('Y-m-d H:i:s'));
if ($mo->msgid) if ($mo->msgid)
$reply .= sprintf("MSGID: %s\r",$mo->msgid); $reply .= sprintf("MSGID: %s\r",$mo->msgid);
if ($mo->replyid) if ($mo->replyid)