diff --git a/app/Models/Echomail.php b/app/Models/Echomail.php index cf1ac33..4fdb811 100644 --- a/app/Models/Echomail.php +++ b/app/Models/Echomail.php @@ -108,13 +108,13 @@ final class Echomail extends Model implements Packet if ($model->set_seenby->count()) $seenby = self::parseAddresses('seenby',$model->set_seenby,$model->fftn->zone,$rogue); - // Make sure our sender is first in the seenby + // Make sure our sender is in the seenby if (! $seenby->contains($model->fftn_id)) { Log::alert(sprintf('%s:? Echomail adding sender to SEENBY [%s].',self::LOGKEY,$model->fftn_id)); $seenby->push($model->fftn_id); } - // Make sure our pktsrc is last in the seenby + // Make sure our pktsrc is in the seenby if (isset($model->set_sender) && (! $seenby->contains($model->set_sender))) { Log::alert(sprintf('%s:? Echomail adding pktsrc to SEENBY [%s].',self::LOGKEY,$model->set_sender)); $seenby->push($model->set_sender); @@ -189,7 +189,7 @@ final class Echomail extends Model implements Packet public function path() { return $this->belongsToMany(Address::class,'echomail_path') - ->withPivot(['id','parent_id']); + ->withPivot(['id','parent_id','recv_pkt','recv_at']); } /* METHODS */ diff --git a/resources/views/widgets/message.blade.php b/resources/views/widgets/message.blade.php index 845d516..674e56c 100644 --- a/resources/views/widgets/message.blade.php +++ b/resources/views/widgets/message.blade.php @@ -70,14 +70,16 @@ use App\Classes\FTN\Message; - @if ($msg->flags) -
-
- RECEIVED: +
+
+ RECEIVED:
+ @if ($msg instanceof \App\Models\Netmail) @foreach ($msg->received as $path) - {{ $path->pivot->recv_pkt }} by {{ $path->ftn }} {{ $msg->created_at }} + {{ $path->pivot->recv_pkt }} from {{ $path->ftn }} {{ $msg->created_at }} @endforeach -
+ @elseif ($msg instanceof \App\Models\Echomail) + {{ ($x=$msg->path->sortBy('pivot.parent_id')->last())->pivot->recv_pkt }} from {{ $x->ftn }} {{ $x->pivot->recv_at }} + @endif
- @endif +
@endif \ No newline at end of file