Compare commits
3 Commits
11b7dc4229
...
e4f8f44aef
Author | SHA1 | Date | |
---|---|---|---|
e4f8f44aef | |||
e65e664792 | |||
4f6e1e90c6 |
@ -551,7 +551,12 @@ class Message extends FTNBase
|
|||||||
// FTS-0004.001/FSC-0068.001 The message PATH lines
|
// FTS-0004.001/FSC-0068.001 The message PATH lines
|
||||||
|
|
||||||
// @todo This unique() function here shouldnt be required, but is while system generated messages are storing path/seenby
|
// @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));
|
$path = $this
|
||||||
|
->mo
|
||||||
|
->path
|
||||||
|
->push($this->us)
|
||||||
|
->unique('ftn')
|
||||||
|
->filter(fn($item)=>is_null($item->point_id) || ($item->point_id === 0));
|
||||||
|
|
||||||
// Create our rogue seenby objects
|
// Create our rogue seenby objects
|
||||||
$seenby = $this->mo->seenby;
|
$seenby = $this->mo->seenby;
|
||||||
@ -565,7 +570,7 @@ class Message extends FTNBase
|
|||||||
|
|
||||||
$seenby = $seenby
|
$seenby = $seenby
|
||||||
->push($this->us)
|
->push($this->us)
|
||||||
->filter(fn($item)=>($item->point_id === 0))
|
->filter(fn($item)=>is_null($item->point_id) || ($item->point_id === 0))
|
||||||
->unique('ftn')
|
->unique('ftn')
|
||||||
->sortBy(function($item) { return sprintf('%05d%05d',$item->host_id,$item->node_id);});
|
->sortBy(function($item) { return sprintf('%05d%05d',$item->host_id,$item->node_id);});
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ final class File extends Send
|
|||||||
return $this->f->datetime->timestamp;
|
return $this->f->datetime->timestamp;
|
||||||
|
|
||||||
case 'name':
|
case 'name':
|
||||||
case 'size':
|
|
||||||
return $this->f->{$key};
|
return $this->f->{$key};
|
||||||
|
|
||||||
case 'type':
|
case 'type':
|
||||||
@ -84,6 +83,8 @@ final class File extends Send
|
|||||||
*/
|
*/
|
||||||
public function open(string $compress=''): bool
|
public function open(string $compress=''): bool
|
||||||
{
|
{
|
||||||
|
$this->size = $this->f->size;
|
||||||
|
|
||||||
// If sending file is a File::class, then our file is s3
|
// If sending file is a File::class, then our file is s3
|
||||||
if ($this->nameas && $this->f instanceof FileModel) {
|
if ($this->nameas && $this->f instanceof FileModel) {
|
||||||
$this->fd = Storage::readStream($this->f->rel_name);
|
$this->fd = Storage::readStream($this->f->rel_name);
|
||||||
|
@ -43,9 +43,6 @@ final class Tic extends Send
|
|||||||
case 'mtime':
|
case 'mtime':
|
||||||
return $this->f->datetime->timestamp;
|
return $this->f->datetime->timestamp;
|
||||||
|
|
||||||
case 'size':
|
|
||||||
return strlen($this->tic);
|
|
||||||
|
|
||||||
case 'type':
|
case 'type':
|
||||||
return ($this->ftype&0xff00)>>8;
|
return ($this->ftype&0xff00)>>8;
|
||||||
|
|
||||||
@ -67,6 +64,8 @@ final class Tic extends Send
|
|||||||
|
|
||||||
public function open(string $compress=''): bool
|
public function open(string $compress=''): bool
|
||||||
{
|
{
|
||||||
|
$this->size = strlen($this->tic);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +395,8 @@ class Address extends Model
|
|||||||
*/
|
*/
|
||||||
public function scopeFTN($query)
|
public function scopeFTN($query)
|
||||||
{
|
{
|
||||||
return $query->select(['id','addresses.zone_id','host_id','node_id','point_id'])
|
return $query
|
||||||
|
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
|
||||||
->with([
|
->with([
|
||||||
'zone:zones.id,domain_id,zone_id',
|
'zone:zones.id,domain_id,zone_id',
|
||||||
'zone.domain:domains.id,name',
|
'zone.domain:domains.id,name',
|
||||||
@ -602,9 +603,13 @@ class Address extends Model
|
|||||||
public function nodes_hub(): HasMany
|
public function nodes_hub(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Address::class,'hub_id','id')
|
return $this->hasMany(Address::class,'hub_id','id')
|
||||||
->FTN()
|
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
|
||||||
->active()
|
->active()
|
||||||
->FTNorder();
|
->FTNorder()
|
||||||
|
->with([
|
||||||
|
'zone:zones.id,domain_id,zone_id',
|
||||||
|
'zone.domain:domains.id,name',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1043,9 +1048,20 @@ class Address extends Model
|
|||||||
*/
|
*/
|
||||||
public function filesWaiting(): Collection
|
public function filesWaiting(): Collection
|
||||||
{
|
{
|
||||||
return $this->file_seen()
|
return File::select('files.*')
|
||||||
->whereNull('sent_at')
|
->join('file_seenby',['file_seenby.file_id'=>'files.id'])
|
||||||
|
->where('address_id',$this->id)
|
||||||
|
->whereNull('files.deleted_at')
|
||||||
->whereNotNull('export_at')
|
->whereNotNull('export_at')
|
||||||
|
->whereNull('sent_at')
|
||||||
|
->orderby('id')
|
||||||
|
->with([
|
||||||
|
'filearea:id,name,domain_id',
|
||||||
|
'filearea.domain:id,name',
|
||||||
|
'fftn:id,zone_id,host_id,node_id,point_id',
|
||||||
|
'fftn.zone:id,domain_id,zone_id',
|
||||||
|
'fftn.zone.domain:id,name',
|
||||||
|
])
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user