Remove deprecated methods
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 59s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 2m7s
Create Docker Image / Final Docker Image Manifest (push) Successful in 22s

This commit is contained in:
Deon George 2024-06-15 15:29:00 +10:00
parent 06b924340c
commit be1ef4b293
5 changed files with 8 additions and 175 deletions

View File

@ -93,9 +93,6 @@ class Message extends FTNBase
private Echomail|Netmail $mo; // The object storing this packet message private Echomail|Netmail $mo; // The object storing this packet message
private Address $us; // Our address for this message private Address $us; // Our address for this message
/** @deprecated Not sure why this is needed? */
public bool $packed = FALSE; // Has the message been packed successfully
// Convert characters into printable chars // Convert characters into printable chars
// https://int10h.org/oldschool-pc-fonts/readme/#437_charset // https://int10h.org/oldschool-pc-fonts/readme/#437_charset
private const CP437 = [ private const CP437 = [
@ -379,17 +376,6 @@ class Message extends FTNBase
case 'tftn': case 'tftn':
return parent::__get($key); return parent::__get($key);
// For 5D we need to include the domain
/* @deprecated - is this required? */
case 'fboss':
return sprintf('%d:%d/%d',$this->fz,$this->fn,$this->ff).(($x=$this->fdomain) ? '@'.$x->name : '');
case 'tboss':
return sprintf('%d:%d/%d',$this->tz,$this->tn,$this->tf).(($x=$this->tdomain) ? '@'.$x->name : '');
case 'fboss_o':
return Address::findFTN($this->fboss);
case 'tboss_o':
return Address::findFTN($this->tboss);
// Convert our message (header[datetime]) with our TZUTC into a Carbon date // Convert our message (header[datetime]) with our TZUTC into a Carbon date
case 'datetime': case 'datetime':
try { try {

View File

@ -340,53 +340,6 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
/* METHODS */ /* METHODS */
/**
* When creating a new packet, set the header.
*
* @param Address $oo
* @param Address $o
* @param string|null $passwd Override the password used in the packet
* @deprecated Use Packet::generate(), which should generate a packet of the right type
*/
public function addressHeader(Address $oo,Address $o,string $passwd=NULL): void
{
Log::debug(sprintf('%s:+ Creating packet for [%s]',self::LOGKEY,$o->ftn));
$date = Carbon::now();
// Create Header
$this->header = [
'ozone' => $oo->zone->zone_id, // Orig Zone
'dzone' => $o->zone->zone_id, // Dest Zone
'onet' => $oo->host_id ?: $oo->region_id, // Orig Net
'dnet' => $o->host_id ?: $o->region_id, // Dest Net
'onode' => $oo->node_id, // Orig Node
'dnode' => $o->node_id, // Dest Node
'opoint' => $oo->point_id, // Orig Point
'dpoint' => $o->point_id, // Dest Point
'odomain' => $oo->zone->domain->name, // Orig Domain
'ddomain' => $o->zone->domain->name, // Dest Domain
'y' => $date->format('Y'), // Year
'm' => $date->format('m')-1, // Month
'd' => $date->format('d'), // Day
'H' => $date->format('H'), // Hour
'M' => $date->format('i'), // Minute
'S' => $date->format('s'), // Second
'password' => strtoupper((! is_null($passwd)) ? $passwd : $o->pass_packet), // Packet Password
];
}
/**
* Add a message to this packet
*
* @param Message $o
* @deprecated No longer used when Address::class is updated
*/
public function addMail(Message $o): void
{
$this->messages->push($o);
}
public function for(Address $ao): self public function for(Address $ao): self
{ {
$this->tftn_p = $ao; $this->tftn_p = $ao;
@ -509,11 +462,4 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
return $this; return $this;
} }
/** @deprecated Is this used? */
public function pluck(string $key): Collection
{
throw new \Exception(sprintf('%s:! This function is deprecated - [%s]',self::LOGKEY,$key));
return $this->messages->pluck($key);
}
} }

View File

@ -1540,25 +1540,6 @@ final class Binkp extends BaseProtocol
} }
} }
/**
* Strip blanks at the beginning of a string
*
* @param string $str
* @return string
* @throws \Exception
* @deprecated - use ltrim instead
*/
private function skip_blanks(string $str): string
{
$c = 0;
if ($str != NULL)
while ($this->isSpace(substr($str,$c,1)))
$c++;
return substr($str,$c);
}
/** /**
* Return the string delimited by char and shorten the input to the remaining characters * Return the string delimited by char and shorten the input to the remaining characters
* *
@ -1579,20 +1560,4 @@ final class Binkp extends BaseProtocol
return $return; return $return;
} }
/**
* Check if the string is a space
*
* @param string $str
* @return bool
* @throws \Exception
* @deprecated No longer required since we are using ltrim
*/
private function isSpace(string $str):bool
{
if (strlen($str) > 1)
throw new \Exception('String is more than 1 char');
return $str && in_array($str,[' ',"\n","\r","\v","\f","\t"]);
}
} }

View File

@ -566,21 +566,6 @@ class Address extends Model
->withPivot(['export_at','sent_at','sent_pkt']); ->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 * Files that this address has seen
* *
@ -1036,7 +1021,7 @@ class Address extends Model
*/ */
public function filesWaiting(): Collection public function filesWaiting(): Collection
{ {
return $this->files() return $this->file_seen()
->whereNull('sent_at') ->whereNull('sent_at')
->whereNotNull('export_at') ->whereNotNull('export_at')
->get(); ->get();
@ -1104,18 +1089,6 @@ class Address extends Model
return NULL; 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) * Get netmail for this node (including it's children)
* *
@ -1162,43 +1135,6 @@ class Address extends Model
return NULL; 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 public function isRoleOverride(int $role=NULL): bool
{ {
$val = ($this->role & self::NODE_ALL); $val = ($this->role & self::NODE_ALL);

View File

@ -102,17 +102,17 @@ class User extends Authenticatable implements MustVerifyEmail
} }
/** /**
* Does this user have systems with points
*
* @return Collection * @return Collection
* @deprecated not used - but if it is, probably could use Address::points()?
*/ */
public function points(): Collection public function points(): Collection
{ {
$result = collect(); return $this
->systems
foreach($this->systems->pluck('addresses')->flatten()->where('role','>',Address::NODE_HC) as $ao) ->pluck('addresses')
$result = $result->merge($ao->children()); ->flatten()
->where('point_id','>',0);
return $result;
} }
/** /**