Dont record us in seenby/path for local messages. Update echomail display to know if an exchomail seenby has collected the message
This commit is contained in:
parent
4f8448563d
commit
1529ad53fa
@ -10,6 +10,7 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
use App\Casts\{CollectionOrNull,CompressedString};
|
use App\Casts\{CollectionOrNull,CompressedString};
|
||||||
|
use App\Classes\FTN\Message;
|
||||||
use App\Interfaces\Packet;
|
use App\Interfaces\Packet;
|
||||||
use App\Traits\{MessageAttributes,MsgID,ParseAddresses,QueryCacheableConfig};
|
use App\Traits\{MessageAttributes,MsgID,ParseAddresses,QueryCacheableConfig};
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ final class Echomail extends Model implements Packet
|
|||||||
Log::debug(sprintf('%s:^ Message [%d] from point address is [%d]',self::LOGKEY,$model->id,$model->fftn->point_id));
|
Log::debug(sprintf('%s:^ Message [%d] from point address is [%d]',self::LOGKEY,$model->id,$model->fftn->point_id));
|
||||||
|
|
||||||
// Make sure our sender is first in the path
|
// Make sure our sender is first in the path
|
||||||
if (! $path->contains($model->fftn_id)) {
|
if ((! $model->isFlagSet(Message::FLAG_LOCAL)) && (! $path->contains($model->fftn_id))) {
|
||||||
Log::alert(sprintf('%s:? Echomail adding sender to start of PATH [%s].',self::LOGKEY,$model->fftn_id));
|
Log::alert(sprintf('%s:? Echomail adding sender to start of PATH [%s].',self::LOGKEY,$model->fftn_id));
|
||||||
$path->prepend($model->fftn_id);
|
$path->prepend($model->fftn_id);
|
||||||
}
|
}
|
||||||
@ -141,7 +142,7 @@ final class Echomail extends Model implements Packet
|
|||||||
$seenby = self::parseAddresses('seenby',$model->set->get('set_seenby'),$model->fftn->zone,$rogue);
|
$seenby = self::parseAddresses('seenby',$model->set->get('set_seenby'),$model->fftn->zone,$rogue);
|
||||||
|
|
||||||
// Make sure our sender is in the seenby
|
// Make sure our sender is in the seenby
|
||||||
if (! $seenby->contains($model->fftn_id)) {
|
if ((! $model->isFlagSet(Message::FLAG_LOCAL)) && (! $seenby->contains($model->fftn_id))) {
|
||||||
Log::alert(sprintf('%s:? Echomail adding sender to SEENBY [%s].',self::LOGKEY,$model->fftn_id));
|
Log::alert(sprintf('%s:? Echomail adding sender to SEENBY [%s].',self::LOGKEY,$model->fftn_id));
|
||||||
$seenby->push($model->fftn_id);
|
$seenby->push($model->fftn_id);
|
||||||
}
|
}
|
||||||
@ -182,6 +183,7 @@ final class Echomail extends Model implements Packet
|
|||||||
->addresses
|
->addresses
|
||||||
->filter(function($item) use ($model) { return $model->echoarea->can_read($item->security); })
|
->filter(function($item) use ($model) { return $model->echoarea->can_read($item->security); })
|
||||||
->pluck('id')
|
->pluck('id')
|
||||||
|
->diff(our_address($model->fftn->zone->domain))
|
||||||
->diff($seenby);
|
->diff($seenby);
|
||||||
|
|
||||||
if ($exportto->count()) {
|
if ($exportto->count()) {
|
||||||
|
@ -63,7 +63,20 @@ use App\Models\{Echomail,Netmail};
|
|||||||
@if ($msg instanceof Echomail)
|
@if ($msg instanceof Echomail)
|
||||||
<div class="row pb-2">
|
<div class="row pb-2">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
SEENBY: <br><strong class="highlight">{!! $msg->seenby->pluck('ftn2d')->join('</strong>, <strong class="highlight">') !!}</strong>
|
SEENBY: <br><strong class="highlight">{!! $msg
|
||||||
|
->seenby
|
||||||
|
->map(function($item) {
|
||||||
|
if ($item->pivot->export_at) {
|
||||||
|
if ($item->pivot->sent_at)
|
||||||
|
return sprintf('<strong class="success" title="Sent: %s Packet: %s">%s</strong>',$item->pivot->sent_at,$item->pivot->sent_pkt,$item->ftn2d);
|
||||||
|
else
|
||||||
|
return sprintf('<strong class="danger">%s</strong>',$item->ftn2d);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return sprintf('<strong class="highlight">%s</strong>',$item->ftn2d);
|
||||||
|
}
|
||||||
|
})->join(', ') !!}
|
||||||
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if($msg->rogue_seenby->count())
|
@if($msg->rogue_seenby->count())
|
||||||
@ -72,10 +85,14 @@ use App\Models\{Echomail,Netmail};
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<!-- @todo for the nodes we export to, highlight those that we have actually sent it, vs those that havent received it yet -->
|
|
||||||
<div class="row pb-2">
|
<div class="row pb-2">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
PATH: <br><strong class="highlight">{!! $msg->pathorder()->join('</strong> -> <strong class="highlight">') !!}</strong>
|
PATH:
|
||||||
|
@if($msg->path->count())
|
||||||
|
<br><strong class="highlight">{!! $msg->pathorder()->join('</strong> -> <strong class="highlight">') !!}</strong>
|
||||||
|
@else
|
||||||
|
<br><small>[<strong>No details</strong>]</small>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if(($msg instanceof Echomail) && $msg->rogue_path->count())
|
@if(($msg instanceof Echomail) && $msg->rogue_path->count())
|
||||||
<br><small>[<strong>NOTE</strong>: Some path values couldnt be identified - ({{ $msg->rogue_path->join(',') }})]</small>
|
<br><small>[<strong>NOTE</strong>: Some path values couldnt be identified - ({{ $msg->rogue_path->join(',') }})]</small>
|
||||||
@ -83,19 +100,20 @@ use App\Models\{Echomail,Netmail};
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if($msg->path->count())
|
||||||
<div class="row pb-2">
|
<div class="row pb-2">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
@if($msg instanceof Netmail)
|
|
||||||
RECEIVED:<br>
|
RECEIVED:<br>
|
||||||
|
@if($msg instanceof Netmail)
|
||||||
@foreach ($msg->path as $path)
|
@foreach ($msg->path as $path)
|
||||||
<strong class="highlight">{{ $path->pivot->recv_pkt }}</strong> from <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 }}<br>
|
||||||
@endforeach
|
@endforeach
|
||||||
@elseif ($msg instanceof Echomail)
|
@elseif ($msg instanceof Echomail)
|
||||||
RECEIVED:<br>
|
<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 }}<br>
|
||||||
<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
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if($msg instanceof Netmail)
|
@if($msg instanceof Netmail)
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
|
Loading…
Reference in New Issue
Block a user