Enabled akas() method to only show current active akas. Should fix the link register netmail from polling an invalid FTN id.

This commit is contained in:
2023-06-23 21:28:29 +10:00
parent b8534d8598
commit fdbc58856b
8 changed files with 52 additions and 26 deletions

View File

@@ -59,17 +59,19 @@ final class Netmail extends Model implements Packet
static::created(function($model) {
// Save the Path
$ppoid = NULL;
foreach ($model->set_path as $path) {
$po = DB::select('INSERT INTO netmail_path (netmail_id,address_id,parent_id,datetime,program) VALUES (?,?,?,?,?) RETURNING id',[
$model->id,
$path['node']->id,
$ppoid,
(string)$path['datetime'],
$path['program'],
]);
$ppoid = $po[0]->id;
}
if (isset($model->set_path))
foreach ($model->set_path as $path) {
$po = DB::select('INSERT INTO netmail_path (netmail_id,address_id,parent_id,datetime,program) VALUES (?,?,?,?,?) RETURNING id',[
$model->id,
$path['node']->id,
$ppoid,
(string)$path['datetime'],
$path['program'],
]);
$ppoid = $po[0]->id;
}
});
}