Replace path from duplicate messages when the existing path is blank
This commit is contained in:
parent
ebd1cf8732
commit
871430edf8
@ -112,7 +112,7 @@ class Packet extends FTNBase implements \Iterator, \Countable
|
||||
* Open a packet file
|
||||
*
|
||||
* @param File $file
|
||||
* @param Zone|null $zone
|
||||
* @param System|null $system
|
||||
* @param bool $use_redis
|
||||
* @return Packet
|
||||
* @throws InvalidPacketException
|
||||
|
@ -166,6 +166,14 @@ class MessageProcess implements ShouldQueue
|
||||
if (! $o->msg_crc)
|
||||
$o->msg_crc = md5($this->msg->message);
|
||||
|
||||
// Using filter here, due to earlier bugs - and to get rid of the null values
|
||||
$o->path = collect($o->getRawOriginal('path'))->filter()->toArray();
|
||||
|
||||
// If the path is empty, then its probably because of the previous bug, we'll replace it.
|
||||
// @todo This duplicate message may have gone via a different path, be nice to record it.
|
||||
if (! $o->path->count())
|
||||
$o->path = collect($o->getRawOriginal('path'))->merge($this->msg->pathaddress)->toArray();
|
||||
|
||||
$o->seenby = collect($o->getRawOriginal('seenby'))->merge($this->msg->seenaddress)->filter()->toArray();
|
||||
$o->save();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user