Fix for echomail notifications, when echomails come from a point. Auto detect address when manually processing packets.
This commit is contained in:
parent
f9d24db9f8
commit
a886a389a8
@ -37,12 +37,20 @@ class PacketInfo extends Command
|
||||
{
|
||||
$fs = Storage::disk(config('fido.local_disk'));
|
||||
$rel_name = sprintf('%s/%s',config('fido.dir'),$this->argument('file'));
|
||||
$a = NULL;
|
||||
|
||||
$f = new File($fs->path($rel_name));
|
||||
$a = $this->argument('ftn') ? Address::findFTN($this->argument('ftn')) : NULL;
|
||||
|
||||
$m = NULL;
|
||||
if ($this->argument('ftn')) {
|
||||
$a = Address::findFTN($this->argument('ftn'));
|
||||
|
||||
} elseif (preg_match('/^(([0-9]+)-)+/',$this->argument('file'),$m)) {
|
||||
$a = Address::findOrFail(hexdec($m[2]));
|
||||
}
|
||||
|
||||
foreach ($f as $packet) {
|
||||
$pkt = Packet::process($packet,$x=$f->itemName(),$f->itemSize(),$a->zone->domain);
|
||||
$pkt = Packet::process($packet,$x=$f->itemName(),$f->itemSize(),$a?->zone->domain);
|
||||
|
||||
$this->alert(sprintf('File Name: %s',$x));
|
||||
|
||||
|
@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
use App\Classes\File;
|
||||
use App\Classes\FTN\Packet;
|
||||
@ -20,7 +21,7 @@ class PacketProcess extends Command
|
||||
protected $signature = 'packet:process'
|
||||
.' {file : Packet to process}'
|
||||
.' {--N|nobot : Dont process bots}'
|
||||
.' {ftn : System the packet is from}';
|
||||
.' {ftn? : System the packet is from}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@ -38,11 +39,26 @@ class PacketProcess extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$f = new File($this->argument('file'));
|
||||
$a = Address::findFTN($this->argument('ftn'));
|
||||
$fs = Storage::disk(config('fido.local_disk'));
|
||||
$rel_name = sprintf('%s/%s',config('fido.dir'),$this->argument('file'));
|
||||
$a = NULL;
|
||||
|
||||
$f = new File($fs->path($rel_name));
|
||||
|
||||
$m = NULL;
|
||||
if ($this->argument('ftn')) {
|
||||
$a = Address::findFTN($this->argument('ftn'));
|
||||
|
||||
} elseif (preg_match('/^(([0-9]+)-)+/',$this->argument('file'),$m)) {
|
||||
$a = Address::findOrFail(hexdec($m[2]));
|
||||
|
||||
} else {
|
||||
$this->error('Unable to determine sender FTN address');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
foreach ($f as $packet) {
|
||||
foreach ($pkt = Packet::process($packet,$f->itemName(),$f->itemSize(),$a->zone->domain) as $msg) {
|
||||
foreach ($pkt = Packet::process($packet,$f->itemName(),$f->itemSize(),$a?->zone->domain) as $msg) {
|
||||
// @todo Quick check that the packet should be processed by us.
|
||||
$this->info(sprintf('Processing message from [%s] with msgid [%s] in (%s)',$msg->fboss,$msg->msgid,$f->pktName()));
|
||||
|
||||
|
@ -61,7 +61,7 @@ abstract class Echomails extends Notification //implements ShouldQueue
|
||||
$o->datetime = Carbon::now();
|
||||
$o->tzoffset = $o->datetime->utcOffset();
|
||||
|
||||
$o->fftn_id = ($x=$so->match($mo->fftn_o->zone)->first())->id;
|
||||
$o->fftn_id = ($x=$so->match($mo->fboss_o->zone)->first())->id;
|
||||
$o->flags = (Message::FLAG_LOCAL);
|
||||
|
||||
$o->tearline = sprintf('%s (%04X)',Setup::PRODUCT_NAME,Setup::PRODUCT_ID);
|
||||
|
Loading…
Reference in New Issue
Block a user