Show packet info when viewing echomail

This commit is contained in:
Deon George 2023-11-22 13:35:37 +11:00
parent f639e3ffab
commit 3221d7f679
2 changed files with 12 additions and 10 deletions

View File

@ -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 */

View File

@ -70,14 +70,16 @@ use App\Classes\FTN\Message;
</div>
</div>
@if ($msg->flags)
<div class="row pb-2">
<div class="col-8">
RECEIVED:
<div class="row pb-2">
<div class="col-8">
RECEIVED:<br>
@if ($msg instanceof \App\Models\Netmail)
@foreach ($msg->received as $path)
<strong class="highlight">{{ $path->pivot->recv_pkt }}</strong> by <strong class="highlight">{{ $path->ftn }}</strong> {{ $msg->created_at }}
<strong class="highlight">{{ $path->pivot->recv_pkt }}</strong> from <strong class="highlight">{{ $path->ftn }}</strong> {{ $msg->created_at }}
@endforeach
</div>
@elseif ($msg instanceof \App\Models\Echomail)
<strong class="highlight">{{ ($x=$msg->path->sortBy('pivot.parent_id')->last())->pivot->recv_pkt }}</strong> from <strong class="highlight">{{ $x->ftn }}</strong> {{ $x->pivot->recv_at }}
@endif
</div>
@endif
</div>
@endif