Fix for single encoding error, when only the first message was decoded, some logging for Address objects
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Http\Controllers\DomainController;
|
||||
@@ -24,6 +25,8 @@ use App\Traits\ScopeActive;
|
||||
*/
|
||||
class Address extends Model
|
||||
{
|
||||
private const LOGKEY = 'MA-';
|
||||
|
||||
use ScopeActive,SoftDeletes;
|
||||
|
||||
protected $with = ['zone'];
|
||||
@@ -383,6 +386,7 @@ class Address extends Model
|
||||
* Get echomail for this node
|
||||
*
|
||||
* @param bool $update
|
||||
* @param Collection|null $echomail
|
||||
* @return Packet|null
|
||||
*/
|
||||
public function getEchomail(bool $update=TRUE,Collection $echomail=NULL): ?Packet
|
||||
@@ -394,6 +398,8 @@ class Address extends Model
|
||||
if (($x=$this->echomailWaiting())
|
||||
->count())
|
||||
{
|
||||
Log::debug(sprintf('%s:= Got [%d] echomails for [%s] for sending',self::LOGKEY,$x->count(),$this->ftn));
|
||||
|
||||
$pkt = $this->getPacket($x);
|
||||
|
||||
if ($pkt && $pkt->count() && $update)
|
||||
@@ -422,6 +428,8 @@ class Address extends Model
|
||||
if (($x=$this->netmailWaiting())
|
||||
->count())
|
||||
{
|
||||
Log::debug(sprintf('%s:= Got [%d] netmails for [%s] for sending',self::LOGKEY,$x->count(),$this->ftn));
|
||||
|
||||
$pkt = $this->getPacket($x);
|
||||
|
||||
if ($pkt && $pkt->count() && $update)
|
||||
@@ -436,7 +444,7 @@ class Address extends Model
|
||||
/**
|
||||
* Return a packet of mail
|
||||
*
|
||||
* @param Collection $c
|
||||
* @param Collection $c of message models (Echomail/Netmail)
|
||||
* @return Packet|null
|
||||
*/
|
||||
private function getPacket(Collection $c): ?Packet
|
||||
@@ -449,6 +457,7 @@ class Address extends Model
|
||||
|
||||
$o = new Packet($ao,$this);
|
||||
|
||||
// $oo = Netmail/Echomail Model
|
||||
foreach ($c as $oo)
|
||||
$o->addMail($oo->packet($this));
|
||||
|
||||
|
Reference in New Issue
Block a user