From c70222fef8b14f4f11dbd31e3d4ef939335736fa Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 8 Sep 2024 14:18:28 +1000 Subject: [PATCH] When posting to matrix, encode in triple backticks to create a mono-spaced message --- app/Notifications/Matrix/Echomail.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Notifications/Matrix/Echomail.php b/app/Notifications/Matrix/Echomail.php index 70a4eb9..faf3977 100644 --- a/app/Notifications/Matrix/Echomail.php +++ b/app/Notifications/Matrix/Echomail.php @@ -63,7 +63,9 @@ 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', + 'format'=>'org.matrix.custom.html', 'body'=>mb_convert_encoding(str_replace("\r","\n",$this->o->msg),'UTF-8','IBM850'), + 'formatted_body'=>sprintf("
\n%s\n
",mb_convert_encoding(str_replace("\r","\n",$this->o->msg),'UTF-8','IBM850')), ]); switch ($msg->status()) {