Replaced “ …” with “ [continues…]” when announcement toot is too long

This commit is contained in:
pezcurrel 2024-08-07 18:10:18 +02:00
parent b35900dc63
commit 05c2c1da47

View file

@ -821,9 +821,9 @@ if ($opts['sendtoot'] && $instanswered && $idata['IsMastodon'] && $idata['FirstS
$toot.=N.N.'Long description: ';
(is_null($idata['LongDesc'])) ? $toot.='unspecified' : $toot.=html2text($idata['LongDesc']);
if (postlen($toot)>$iniarr['botmaxchars']) {
while (postlen($toot)+2>$iniarr['botmaxchars'])
while (postlen($toot)+13>$iniarr['botmaxchars'])
$toot=preg_replace('#\s+(\S|\n)+$#u','',$toot);
$toot.=' ';
$toot.=' [continues…]';
}
$context=[
'http'=>[