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

This commit is contained in:
Deon George 2024-09-08 14:18:28 +10:00
parent 2c4bf83250
commit 60940cbded

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()) {