Updates to Message, Remove updated_at/mid from echomails/netmails, not used
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 35s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m47s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
Deon George 2024-06-07 08:42:10 +10:00
parent 614d5b877b
commit 06c29d8750
5 changed files with 46 additions and 6 deletions

View File

@ -697,9 +697,14 @@ class Message extends FTNBase
} }
// Catch any kludges we need to process here // Catch any kludges we need to process here
if (array_key_exists($m[1],self::kludges)) if (array_key_exists($m[1],self::kludges)) {
// Some earlier mystic message had a blank value for TZUTC
if ((($m[1]) === 'TZUTC:') && (! $m[2]))
$m[2] = '0000';
$this->{self::kludges[$m[1]]} = $m[2]; $this->{self::kludges[$m[1]]} = $m[2];
else
} else
$o->kludges = [$m[1],$m[2]]; $o->kludges = [$m[1],$m[2]];
} }
@ -714,7 +719,7 @@ class Message extends FTNBase
throw new InvalidPacketException('Couldnt find the end of the origin'); throw new InvalidPacketException('Couldnt find the end of the origin');
} elseif (! $ptr_end=strpos($message,"\r\x01",$ptr_start)) { } elseif (! $ptr_end=strpos($message,"\r\x01",$ptr_start)) {
throw new InvalidPacketException('Couldnt parse the end of the content'); $ptr_end = strlen($message);
} }
$remaining = substr($message,$ptr_end+1); $remaining = substr($message,$ptr_end+1);
@ -800,8 +805,10 @@ class Message extends FTNBase
$o->msg = rtrim($o->msg,"\r"); $o->msg = rtrim($o->msg,"\r");
// Quick validation that we are done // Quick validation that we are done
if ($ptr_content_start !== strlen($content)) if ($ptr_content_start !== strlen($content)) {
throw new InvalidPacketException('There is more data in the message content?'); Log::alert(sprintf('%s:! We failed parsing the message.',self::LOGKEY));
$o->msg = substr($message,0,$ptr_end);
}
} }
$ptr_start = $ptr_end+1; $ptr_start = $ptr_end+1;

View File

@ -19,6 +19,7 @@ final class Echomail extends Model implements Packet
use SoftDeletes,MessageAttributes,MsgID,ParseAddresses,QueryCacheableConfig; use SoftDeletes,MessageAttributes,MsgID,ParseAddresses,QueryCacheableConfig;
private const LOGKEY = 'ME-'; private const LOGKEY = 'ME-';
public const UPDATED_AT = NULL;
private bool $no_export = FALSE; private bool $no_export = FALSE;
private const kludges = [ private const kludges = [

View File

@ -20,6 +20,7 @@ final class Netmail extends Model implements Packet
use SoftDeletes,MsgID,MessageAttributes; use SoftDeletes,MsgID,MessageAttributes;
private const LOGKEY = 'MN-'; private const LOGKEY = 'MN-';
public const UPDATED_AT = NULL;
private const PATH_REGEX = '/^([0-9]+:[0-9]+\/[0-9]+(\..*)?)\s+@([0-9.a-zA-Z]+)\s+(.*)$/'; private const PATH_REGEX = '/^([0-9]+:[0-9]+\/[0-9]+(\..*)?)\s+@([0-9.a-zA-Z]+)\s+(.*)$/';
/** /**

View File

@ -173,7 +173,7 @@ trait MessageAttributes
public function rebuildMessage(): string public function rebuildMessage(): string
{ {
// If we have a msg_src attribute, we'll use that // If we have a msg_src attribute, we'll use that
$result = $this->msg."\r"; $result = $this->msg."\r\r";
if ($x=$this->tagline) if ($x=$this->tagline)
$result .= sprintf("%s\r",$x); $result .= sprintf("%s\r",$x);

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('echomails', function (Blueprint $table) {
$table->dropColumn(['updated_at','mid']);
$table->dropColumn(['origin','tagline','tearline']);
});
Schema::table('netmails', function (Blueprint $table) {
$table->dropColumn(['updated_at','mid']);
$table->dropColumn(['origin','tagline','tearline']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};