Understand some gated messages, that are gated from a different zone

This commit is contained in:
Deon George 2022-02-12 10:21:46 +11:00
parent d1bfa3a035
commit f142284a2b
3 changed files with 27 additions and 6 deletions

View File

@ -93,7 +93,8 @@ class Message extends FTNBase
private string $subject; // Message subject private string $subject; // Message subject
private string $msgid; // MSG ID private string $msgid; // MSG ID
private string $replyid; // Reply ID private string $replyid; // Reply ID
private string $gateid; // MSG ID if the message came via gate
private string $echoarea; // FTS-0004.001 private string $echoarea; // FTS-0004.001
private string $intl; // Netmail details private string $intl; // Netmail details
@ -182,6 +183,7 @@ class Message extends FTNBase
$this->message = ''; $this->message = '';
$this->msgid = ''; $this->msgid = '';
$this->gateid = '';
$this->replyid = ''; $this->replyid = '';
$this->echoarea = ''; $this->echoarea = '';
@ -373,6 +375,7 @@ class Message extends FTNBase
case 'msgid': case 'msgid':
case 'replyid': case 'replyid':
case 'gateid':
case 'message': case 'message':
case 'message_src': case 'message_src':
@ -411,6 +414,7 @@ class Message extends FTNBase
case 'user_to': case 'user_to':
case 'subject': case 'subject':
case 'gateid':
case 'msgid': case 'msgid':
case 'replyid': case 'replyid':
@ -491,6 +495,9 @@ class Message extends FTNBase
if ($this->replyid) if ($this->replyid)
$return .= sprintf("\01REPLY: %s\r",$this->replyid); $return .= sprintf("\01REPLY: %s\r",$this->replyid);
if ($this->gateid)
$return .= sprintf("\01GATE: %s\r",$this->gateid);
foreach ($this->_kludge as $k=>$v) { foreach ($this->_kludge as $k=>$v) {
if ($x=$this->kludge->get($k)) if ($x=$this->kludge->get($k))
$return .= sprintf("\01%s%s\r",$v,$x); $return .= sprintf("\01%s%s\r",$v,$x);
@ -803,6 +810,9 @@ class Message extends FTNBase
elseif ($t = $this->kludge('MSGID: ',$kl)) elseif ($t = $this->kludge('MSGID: ',$kl))
$this->msgid = $t; $this->msgid = $t;
elseif ($t = $this->kludge('GATE: ',$kl))
$this->gateid = $t;
elseif ($t = $this->kludge('PATH: ',$kl)) elseif ($t = $this->kludge('PATH: ',$kl))
$this->path->push($t); $this->path->push($t);
@ -827,9 +837,10 @@ class Message extends FTNBase
// Work out our zone/point // Work out our zone/point
// http://ftsc.org/docs/fsc-0068.001 // http://ftsc.org/docs/fsc-0068.001
// MSGID should be the basis of the source, we'll overrite our src from origin if we have it // MSGID should be the basis of the source, we'll overwrite our src from origin if we have it
// If the message was gated, we'll use the gateid
$m = []; $m = [];
if ($this->msgid && preg_match('#([0-9]+:[0-9]+/[0-9]+)?\.?([0-9]+)?(\.[0-9]+)?@?([A-Za-z-_~]+)?\ +#',$this->msgid,$m)) { if (($this->msgid || $this->gateid) && preg_match('#([0-9]+:[0-9]+/[0-9]+)?\.?([0-9]+)?(\.[0-9]+)?@?([A-Za-z-_~]+)?\ +#',$this->gateid ?: $this->msgid,$m)) {
try { try {
$this->src = Address::parseFTN($m[1].((isset($m[2]) && $m[2] != '') ? '.'.$m[2] : '').(isset($m[4]) ? '@'.$m[4] : '')); $this->src = Address::parseFTN($m[1].((isset($m[2]) && $m[2] != '') ? '.'.$m[2] : '').(isset($m[4]) ? '@'.$m[4] : ''));
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@ -142,7 +142,12 @@ class MessageProcess implements ShouldQueue
->where('domain_id',$this->msg->fboss_o->zone->domain_id) ->where('domain_id',$this->msg->fboss_o->zone->domain_id)
->single(); ->single();
Log::debug(sprintf('%s: - Processing echomail [%s].',self::LOGKEY,$this->msg->msgid)); if (! $ea) {
Log::alert(sprintf('%s:! Echo area [%s] doesnt exist for zone [%s]',self::LOGKEY,$this->msg->echoarea,$this->msg->fboss_o->zone->domain_id));
return;
}
Log::debug(sprintf('%s: - Processing echomail [%s] in [%s].',self::LOGKEY,$this->msg->msgid,$this->msg->echoarea));
// Check for duplicate messages // Check for duplicate messages
// FTS-0009.001 // FTS-0009.001
@ -207,7 +212,7 @@ class MessageProcess implements ShouldQueue
$o->tzoffset = $this->msg->date->utcOffset(); $o->tzoffset = $this->msg->date->utcOffset();
$o->fftn_id = ($x=$this->msg->fboss_o) ? $x->id : NULL; // @todo This should be the node that originated the message - but since that node is not in the DB it would be null $o->fftn_id = ($x=$this->msg->fboss_o) ? $x->id : NULL; // @todo This should be the node that originated the message - but since that node is not in the DB it would be null
$o->echoarea_id = $ea?->id; $o->echoarea_id = $ea->id;
$o->msgid = $this->msg->msgid; $o->msgid = $this->msg->msgid;
$o->msg = $this->msg->message_src; $o->msg = $this->msg->message_src;

View File

@ -17,9 +17,14 @@
</div> </div>
<div class="row pt-1 pb-2"> <div class="row pt-1 pb-2">
<div class="col-8"> <div class="col-4">
SUBJECT: <strong class="highlight">{!! \App\Classes\FTN\Message::tr($msg->subject) !!}</strong> SUBJECT: <strong class="highlight">{!! \App\Classes\FTN\Message::tr($msg->subject) !!}</strong>
</div> </div>
@if ($msg instanceof \App\Models\Echomail)
<div class="col-4">
ECHOAREA: <strong class="highlight">{{ $msg->echoarea->name }}</strong> (<strong class="highlight">{{ $msg->echoarea->domain->name }}</strong>)
</div>
@endif
</div> </div>
<div class="row pb-2"> <div class="row pb-2">