Compare commits
3 Commits
f0c294230a
...
4f8448563d
Author | SHA1 | Date | |
---|---|---|---|
4f8448563d | |||
710adad634 | |||
5fc69067fb |
@ -152,6 +152,7 @@ class Message extends FTNBase
|
||||
*
|
||||
* @param Echomail|Netmail $o
|
||||
* @return self
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function packMessage(Echomail|Netmail $o): self
|
||||
{
|
||||
@ -572,13 +573,18 @@ class Message extends FTNBase
|
||||
// FTS-0004.001/FSC-0068.001 The message SEEN-BY lines
|
||||
// FTS-0004.001/FSC-0068.001 The message PATH lines
|
||||
|
||||
$path = $this->mo->path->push($this->us)->filter(fn($item)=>($item->point_id === 0));
|
||||
// @todo This unique() function here shouldnt be required, but is while system generated messages are storing path/seenby
|
||||
$path = $this->mo->path->push($this->us)->unique('ftn')->filter(fn($item)=>($item->point_id === 0));
|
||||
|
||||
// Create our rogue seenby objects
|
||||
$seenby = $this->mo->seenby;
|
||||
|
||||
if ($this->mo->rogue_seenby->count()) {
|
||||
$do = $this->mo->echoarea->domain;
|
||||
|
||||
foreach ($this->mo->rogue_seenby as $item)
|
||||
$seenby->push(Address::newFTN($item));
|
||||
$seenby->push(Address::newFTN(sprintf('%s@%s',$item,$do->name)));
|
||||
}
|
||||
|
||||
$seenby = $seenby
|
||||
->push($this->us)
|
||||
|
@ -16,6 +16,7 @@ final class Mail extends Send
|
||||
|
||||
/** @var int Our internal position counter */
|
||||
private int $readpos;
|
||||
private ?string $content;
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
@ -84,6 +85,8 @@ final class Mail extends Send
|
||||
'sent_at'=>Carbon::now(),
|
||||
'sent_pkt'=>$this->name,
|
||||
]);
|
||||
|
||||
$this->content = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,12 +97,13 @@ final class Mail extends Send
|
||||
|
||||
public function open(string $compress=''): bool
|
||||
{
|
||||
$this->content = (string)$this->f;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public function read(int $length): string
|
||||
{
|
||||
$result = substr((string)$this->f,$this->readpos,$length);
|
||||
$result = substr($this->content,$this->readpos,$length);
|
||||
$this->readpos += strlen($result);
|
||||
|
||||
return $result;
|
||||
|
@ -26,21 +26,31 @@ class PacketSystem extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \App\Exceptions\InvalidPacketException
|
||||
* @return int
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$ao = Address::findFTN($this->argument('ftn'));
|
||||
|
||||
foreach ($ao->system->addresses as $o) {
|
||||
foreach ($ao->system->addresses->where('validated',TRUE) as $o) {
|
||||
$pkt = $o->getEchomail();
|
||||
$this->info(sprintf('System address [%s] has [%d] messages.',$ao->ftn,$pkt?->count()));
|
||||
$this->info(sprintf('System address [%s] has [%d] echomail messages.',$o->ftn,$pkt?->count()));
|
||||
|
||||
if ($pkt) {
|
||||
foreach ($pkt as $msg)
|
||||
$this->warn(sprintf('- %s (%s)',$msg->msgid,$msg->id));
|
||||
}
|
||||
|
||||
$pkt = $o->getNetmail();
|
||||
$this->info(sprintf('System address [%s] has [%d] netmail messages.',$o->ftn,$pkt?->count()));
|
||||
|
||||
if ($pkt) {
|
||||
foreach ($pkt as $msg)
|
||||
$this->warn(sprintf('- %s (%s)',$msg->msgid,$msg->id));
|
||||
}
|
||||
}
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
@ -340,7 +340,7 @@ class Address extends Model
|
||||
$zone_id = $parent?->zone->zone_id;
|
||||
|
||||
// For flattened domains
|
||||
if ($zo->domain->flatten && is_null($zone_id))
|
||||
if ($zo?->domain->flatten && is_null($zone_id))
|
||||
foreach ($zo->domain->zones as $zoo) {
|
||||
$o->zone_id = $zoo->id;
|
||||
$parent = $o->parent();
|
||||
|
@ -167,7 +167,7 @@ trait MessageAttributes
|
||||
*/
|
||||
public function packet(Address $ao): Message
|
||||
{
|
||||
Log::debug(sprintf('%s:+ Bundling [%s]',self::LOGKEY,$this->id),['type'=>get_class($this)]);
|
||||
Log::debug(sprintf('%s:+ Bundling [%s] for [%s]',self::LOGKEY,$this->id,$ao->ftn),['type'=>get_class($this)]);
|
||||
|
||||
// For netmails, our tftn is the next hop
|
||||
$this->tftn = $ao;
|
||||
|
Loading…
Reference in New Issue
Block a user