diff --git a/app/Console/Commands/ConvertMongo.php b/app/Console/Commands/ConvertMongo.php index 254e7dc..162de7c 100644 --- a/app/Console/Commands/ConvertMongo.php +++ b/app/Console/Commands/ConvertMongo.php @@ -128,6 +128,7 @@ class ConvertMongo extends Command $oo->set_path = $path ? array_filter($path) : []; $oo->set_seenby = $seenby ? array_filter($seenby): []; $oo->set_packet = $packet; + $oo->no_export = TRUE; try { $oo->save(['timestamps'=>FALSE]); diff --git a/app/Models/Echomail.php b/app/Models/Echomail.php index ed959f6..09b7a76 100644 --- a/app/Models/Echomail.php +++ b/app/Models/Echomail.php @@ -20,6 +20,7 @@ final class Echomail extends Model implements Packet private array $set_seenby = []; private array $set_path = []; private ?string $set_packet = NULL; + private bool $no_export = FALSE; protected $casts = [ 'kludges' => 'json', @@ -42,6 +43,7 @@ final class Echomail extends Model implements Packet public function __set($key, $value) { switch ($key) { + case 'no_export': case 'set_path': case 'set_packet': case 'set_seenby': @@ -89,6 +91,11 @@ final class Echomail extends Model implements Packet $exportto = $model->echoarea->addresses->pluck('id')->diff($model->set_seenby); if ($exportto->count()) { + if ($model->no_export) { + Log::debug(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(','))); + return; + } + Log::debug(sprintf('%s:- Exporting message [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(','))); // Save the seenby for the exported systems