Fix for recording seen-by, add md5 to message body, fix incorrect log of dispatching messages

This commit is contained in:
Deon George 2021-11-21 16:53:56 +11:00
parent b333d38095
commit 02c23f047c
4 changed files with 4 additions and 3 deletions
app

View File

@ -136,7 +136,7 @@ final class Receive extends Item
Log::info(sprintf('%s: - Packet has [%d] messages',self::LOGKEY,$po->count())); Log::info(sprintf('%s: - Packet has [%d] messages',self::LOGKEY,$po->count()));
// Queue messages if there are too many in the packet. // Queue messages if there are too many in the packet.
$queue = ($po->count() > config('app.queue_msgs')); if ($queue = ($po->count() > config('app.queue_msgs')))
Log::info(sprintf('%s: - Messages will be sent to the queue for processing',self::LOGKEY)); Log::info(sprintf('%s: - Messages will be sent to the queue for processing',self::LOGKEY));
$error = FALSE; $error = FALSE;

View File

@ -46,7 +46,7 @@ class PacketProcess extends Command
$this->info(sprintf('Processing message from [%s] with msgid [%s]',$msg->fboss,$msg->msgid)); $this->info(sprintf('Processing message from [%s] with msgid [%s]',$msg->fboss,$msg->msgid));
// Dispatch job. // Dispatch job.
Job::dispatch($msg,$this->option('nobot')); Job::dispatchSync($msg,$this->option('nobot'));
} }
} }
} }

View File

@ -181,6 +181,7 @@ class MessageProcess implements ShouldQueue
$o->msgid = $this->msg->msgid; $o->msgid = $this->msg->msgid;
$o->msg = $this->msg->message_src; $o->msg = $this->msg->message_src;
$o->msg_crc = md5($this->msg->message);
$o->path = $this->msg->pathaddress->jsonSerialize(); $o->path = $this->msg->pathaddress->jsonSerialize();
$o->rogue_path = $this->msg->rogue_path->jsonSerialize(); $o->rogue_path = $this->msg->rogue_path->jsonSerialize();
$o->seenby = $this->msg->seenaddress->jsonSerialize(); $o->seenby = $this->msg->seenaddress->jsonSerialize();

View File

@ -64,7 +64,7 @@ final class Echomail extends Model implements Packet
]); ]);
} }
$model->seenby = $model->seenby->merge($export_ao); $model->seenby = $model->seenby->merge($export_ao)->pluck('id')->toArray();
$model->save(); $model->save();
}); });
} }