Store datetime in UTC format now, and fix presentation of TZUTC. Also standardise message summaries on Notifications
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 42s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m51s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
2024-06-28 23:27:06 +10:00
parent fc930ba6c2
commit 4d7af7c7e3
17 changed files with 51 additions and 58 deletions

View File

@@ -8,7 +8,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use App\Classes\FTN\Message;
use App\Models\{Echoarea,Echomail,Setup};
use App\Models\{Echoarea,Echomail,Netmail,Setup};
abstract class Echomails extends Notification //implements ShouldQueue
{
@@ -53,8 +53,8 @@ abstract class Echomails extends Notification //implements ShouldQueue
$o->echoarea_id = $eo->id;
$o->datetime = Carbon::now();
$o->tzoffset = $o->datetime->utcOffset();
$o->datetime = Carbon::now()->utc();
$o->tzoffset = Carbon::now()->utcOffset();
$o->flags = (Message::FLAG_LOCAL);
@@ -62,4 +62,13 @@ abstract class Echomails extends Notification //implements ShouldQueue
return $o;
}
protected function sourceSummary(Echomail|Netmail $o,string $item=NULL): string
{
return sprintf("Your %s was received here on [%s] and it looks like you sent it on [%s].",
$item ?: sprintf('%s with ID [%s] to [%s]',$o instanceof Netmail ? 'Netmail' : 'Echomail',$o->msgid,$o->to),
Carbon::now()->utc()->toDateTimeString(),
$o->date->utc()->toDateTimeString(),
);
}
}