Twitter: Posts are now with links again

This commit is contained in:
Michael 2020-12-07 13:22:07 +00:00
parent c623195e0f
commit d5b54f3bb1

View file

@ -675,6 +675,11 @@ function twitter_post_hook(App $a, array &$b)
$msg = Plaintext::shorten($msgarr["title"], $max_char - 50); $msg = Plaintext::shorten($msgarr["title"], $max_char - 50);
} }
// Add the link to the body if the type isn't a photo or there are more than 4 images in the post
if (!empty($msgarr['url']) && (($msgarr['type'] != 'photo') || empty($msgarr['images']) || (count($msgarr['images']) > 4))) {
$msg .= "\n" . $msgarr['url'];
}
if (empty($msg)) { if (empty($msg)) {
Logger::notice('Empty message', ['id' => $b['id']]); Logger::notice('Empty message', ['id' => $b['id']]);
return; return;