Remove deprecated methods
This commit is contained in:
@@ -566,21 +566,6 @@ class Address extends Model
|
||||
->withPivot(['export_at','sent_at','sent_pkt']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use echomail_seen()
|
||||
*/
|
||||
public function echomails() {
|
||||
return $this->echomail_seen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use file_seen
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
return $this->file_seen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Files that this address has seen
|
||||
*
|
||||
@@ -1036,7 +1021,7 @@ class Address extends Model
|
||||
*/
|
||||
public function filesWaiting(): Collection
|
||||
{
|
||||
return $this->files()
|
||||
return $this->file_seen()
|
||||
->whereNull('sent_at')
|
||||
->whereNotNull('export_at')
|
||||
->get();
|
||||
@@ -1104,18 +1089,6 @@ class Address extends Model
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files for this node (including it's children)
|
||||
*
|
||||
* @param bool $update
|
||||
* @return Collection
|
||||
* @deprecated use filesWaiting() directly
|
||||
*/
|
||||
public function getFiles(bool $update=TRUE): Collection
|
||||
{
|
||||
return $this->filesWaiting();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get netmail for this node (including it's children)
|
||||
*
|
||||
@@ -1162,43 +1135,6 @@ class Address extends Model
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a packet of mail
|
||||
*
|
||||
* @param Collection $msgs of message models (Echomail/Netmail)
|
||||
* @param string|null $passwd Override password used in packet
|
||||
* @return Packet|null
|
||||
* @throws \Exception
|
||||
* @deprecated
|
||||
*/
|
||||
private function getPacket(Collection $msgs,string $passwd=NULL): ?Packet
|
||||
{
|
||||
$s = Setup::findOrFail(config('app.id'));
|
||||
$ao = our_address($this);
|
||||
|
||||
// If we dont match on the address, we cannot pack mail for that system
|
||||
if (! $ao) {
|
||||
Log::alert(sprintf('%s:! We didnt match an address in zone [%d] for [%s]',self::LOGKEY,$this->zone->zone_id,$this->ftn));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Get packet type
|
||||
$o = $ao->system->packet($this);
|
||||
$o->addressHeader($ao,$this,$passwd);
|
||||
|
||||
// $oo = Netmail/Echomail Model
|
||||
$c = 0;
|
||||
foreach ($msgs as $oo) {
|
||||
// Only bundle up to max messages
|
||||
if (++$c > $s->pkt_msgs)
|
||||
break;
|
||||
|
||||
$o->addMail($oo->packet($this,$passwd));
|
||||
}
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
public function isRoleOverride(int $role=NULL): bool
|
||||
{
|
||||
$val = ($this->role & self::NODE_ALL);
|
||||
|
@@ -102,17 +102,17 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this user have systems with points
|
||||
*
|
||||
* @return Collection
|
||||
* @deprecated not used - but if it is, probably could use Address::points()?
|
||||
*/
|
||||
public function points(): Collection
|
||||
{
|
||||
$result = collect();
|
||||
|
||||
foreach($this->systems->pluck('addresses')->flatten()->where('role','>',Address::NODE_HC) as $ao)
|
||||
$result = $result->merge($ao->children());
|
||||
|
||||
return $result;
|
||||
return $this
|
||||
->systems
|
||||
->pluck('addresses')
|
||||
->flatten()
|
||||
->where('point_id','>',0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user