More TIC processing fixes

This commit is contained in:
2023-09-05 21:57:34 +12:00
parent 63a9c06fb0
commit 6498e364fb
4 changed files with 24 additions and 9 deletions

View File

@@ -81,18 +81,18 @@ class File extends Model
// Our address
$ftns = $so
->system
->match($model->fftn->zone,Address::NODE_ACTIVE|Address::NODE_PVT|Address::NODE_HOLD);
->match($model->fftn->zone);
// Add our address to the seenby;
$model->set_seenby = $model->set_seenby->merge($ftns->pluck('id'))->unique();
$model->set_path = $model->set_path->merge([[
'address'=>$ftns->first(),
'datetime'=>($x=Carbon::now())->timestamp,
'datetime'=>$x=Carbon::now(),
'extra'=>sprintf('%s %s (%s)',$x->toRfc7231String(),$so::PRODUCT_NAME,$so->version),
]]);
// Make sure all the path is in the seenby
$model->set_seenby = $model->set_seenby->merge($model->set_path->pluck('address.id'))->unique();
$model->set_seenby = $model->set_seenby->merge($model->set_path->pluck('address.id'))->unique()->filter();
// Save the seenby
$model->seenby()->sync($model->set_seenby);
@@ -111,12 +111,12 @@ class File extends Model
$ppoid = $po[0]->id;
}
// See if we need to export this message.
// See if we need to export this file.
if ($model->filearea->sec_read) {
$exportto = $model
->filearea
->addresses
->filter(function($item) use ($model) { return $item->security >= $model->echoarea->sec_read; })
->filter(function($item) use ($model) { return $item->security >= $model->filearea->sec_read; })
->pluck('id')
->diff($model->set_seenby);