Compare commits

..

3 Commits

Author SHA1 Message Date
60940cbded When posting to matrix, encode in triple backticks to create a mono-spaced message
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m27s
Create Docker Image / Build Docker Image (arm64) (push) Successful in -15h25m8s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s
2024-09-08 14:18:28 +10:00
2c4bf83250 Minor HTML fixes 2024-09-08 14:16:15 +10:00
84d9d271dc Fix for not detecting duplicate messages, when messages had a TZUTC 2024-09-08 14:14:37 +10:00
4 changed files with 20 additions and 43 deletions

View File

@ -81,7 +81,7 @@ class MessageProcess implements ShouldQueue
Log::debug(sprintf('%s:- Checking for duplicate from host [%s].',self::LOGKEY,$this->mo->fftn->ftn));
$o = Netmail::where('msgid',$this->mo->msgid)
->where('fftn_id',$this->mo->fftn->id)
->where('fftn_id',$this->mo->fftn_id)
->where('datetime','>',Carbon::now()->subYears(3))
->single();
@ -199,7 +199,7 @@ class MessageProcess implements ShouldQueue
// The packet sender
$sender = $this->mo->set->get('set_sender');
// @todo Check that this does evaulate to true if a message has been rescanned
// @todo Check that this does evaluate to true if a message has been rescanned
$rescanned = $this->mo->kludges->get('RESCANNED',FALSE);
// Echoarea doesnt exist, cant import the message
@ -226,57 +226,34 @@ class MessageProcess implements ShouldQueue
// Check for duplicate messages
// FTS-0009.001
if ($this->mo->msgid) {
$o = Echomail::where('msgid',$this->mo->msgid)
->where('fftn_id',$this->mo->fftn->id)
->where('datetime','>=',$this->mo->date->clone()->subYears(3))
->where('datetime','<=',$this->mo->date)
->dontCache()
$o = ($x=Echomail::where('msgid',$this->mo->msgid)
->where('fftn_id',$this->mo->fftn_id)
->where('datetime','>=',$this->mo->datetime->clone()->subYears(3))
->where('datetime','<=',$this->mo->datetime)
->dontCache())
->single();
Log::debug(sprintf('%s:- Checking for duplicate from host id [%d].',self::LOGKEY,$this->mo->fftn->id));
Log::debug(sprintf('%s:- Checking for duplicate from host id [%d], with msgid [%s] between [%s] and [%s].',
self::LOGKEY,
$this->mo->fftn_id,
$this->mo->msgid,
$this->mo->datetime->clone()->subYears(3),
$this->mo->datetime,
));
if ($o) {
if ($x->count()) {
// @todo Actually update seenby
Log::alert(sprintf('%s:! Duplicate echomail [%d] (%s) in [%s] from (%s) [%s] to (%s) - updating seenby.',
Log::alert(sprintf('%s:! Duplicate echomail (%s) in [%s] from (%s) [%s] to (%s) - ignoring.',
self::LOGKEY,
$o->id,
$this->mo->msgid,
$this->mo->echoarea->name,
$this->mo->from,$this->mo->fftn->ftn,
$this->mo->to,
));
//$o->save();
// @todo This duplicate message may have gone via a different path, be nice to record it.
/*
// If we didnt get the path on the original message, we'll override it
if (! $o->path->count()) {
$dummy = collect();
$path = $this->parseAddresses('path',$this->mo->path,$sender->zone,$dummy);
$ppoid = NULL;
foreach ($path as $aoid) {
$po = DB::select('INSERT INTO echomail_path (echomail_id,address_id,parent_id) VALUES (?,?,?) RETURNING id',[
$o->id,
$aoid,
$ppoid,
]);
$ppoid = $po[0]->id;
}
}
*/
// @todo if we have an export for any of the seenby addresses, remove it
//$seenby = $this->parseAddresses('seenby',$this->mo->seenby,$sender->zone,$o->rogue_seenby);
//$this->mo->seenby()->syncWithoutDetaching($seenby);
// In case our rogue_seenby changed
//$this->mo->save();
return;
}
}
@ -284,7 +261,7 @@ class MessageProcess implements ShouldQueue
// Find another message with the same msg_crc
if ($this->mo->msg_crc) {
$o = Echomail::where('msg_crc',$xx=md5($this->mo->msg_crc))
->where('fftn_id',$this->mo->fftn->id)
->where('fftn_id',$this->mo->fftn_id)
->where('datetime','>',Carbon::now()->subWeek())
->dontCache()
->get();

View File

@ -63,7 +63,7 @@ class Echomail extends Matrix
->withQueryParameters(['user_id'=>$user])
->post(sprintf('https://%s/_matrix/client/v3/rooms/%s/send/m.room.message',config('matrix.server'),$room),[
'msgtype'=>'m.text',
'body'=>mb_convert_encoding(str_replace("\r","\n",$this->o->msg),'UTF-8','IBM850'),
'body'=>sprintf("```\n%s\n```",mb_convert_encoding(str_replace("\r","\n",$this->o->msg),'UTF-8','IBM850')),
]);
switch ($msg->status()) {

View File

@ -194,6 +194,6 @@ return [
|
*/
'same_site' => null,
'same_site' => env('SESSION_SAME_SITE', 'lax'),
];

View File

@ -12,7 +12,7 @@
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
<link type="text/css" rel="stylesheet" href="{{ asset('oldschool/css/main.css') }}" media="screen">
<link type="text/css" rel="stylesheet" href="{{ url('oldschool/css/main.css') }}" media="screen">
@yield('page-css')