From a6e911fb48ad9739ccdee894c13d071dcea85f79 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 21 Oct 2024 17:46:33 +1100 Subject: [PATCH] Improve netmail sent/receive information --- app/Models/Netmail.php | 5 +++++ resources/views/widgets/message.blade.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Models/Netmail.php b/app/Models/Netmail.php index 221f203..b84796c 100644 --- a/app/Models/Netmail.php +++ b/app/Models/Netmail.php @@ -241,6 +241,11 @@ final class Netmail extends Model implements Packet ->using(ViaPivot::class); } + public function sent() + { + return $this->belongsTo(Address::class); + } + public function tftn() { return $this diff --git a/resources/views/widgets/message.blade.php b/resources/views/widgets/message.blade.php index 89cc805..76a53b1 100644 --- a/resources/views/widgets/message.blade.php +++ b/resources/views/widgets/message.blade.php @@ -106,7 +106,7 @@ use App\Models\{Echomail,Netmail}; RECEIVED:
@if($msg instanceof Netmail) @foreach ($msg->path as $path) - {{ $path->pivot->recv_pkt }} from {{ $path->ftn }} {{ $msg->created_at }}
+ {{ $msg->created_at }} via {{ $path->ftn }} pkt {{ $path->pivot->recv_pkt }}
@endforeach @elseif ($msg instanceof Echomail) {{ ($x=$msg->path->sortBy('pivot.parent_id')->last())->pivot->recv_pkt }} from {{ $x->ftn }} {{ $x->pivot->recv_at }}
@@ -117,9 +117,9 @@ use App\Models\{Echomail,Netmail}; @if($msg instanceof Netmail)
- SENT: + SENT:
@if($msg->sent_pkt && $msg->sent_at) - {{ $msg->sent_at }} ({{ $msg->sent_pkt }}.pkt) + {{ $msg->sent_at }} via {{ $msg->sent->ftn }} pkt {{ $msg->sent_pkt }} @else NOT SENT @endif