From: Michael Date: Mon, 7 Dec 2020 13:22:07 +0000 (+0000) Subject: Twitter: Posts are now with links again X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d5b54f3bb1d0fbb68ffc5196c52f1ab836a18521;p=friendica-addons.git Twitter: Posts are now with links again --- diff --git a/twitter/twitter.php b/twitter/twitter.php index 7c8f1a36..5ebb8318 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -675,6 +675,11 @@ function twitter_post_hook(App $a, array &$b) $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)) { Logger::notice('Empty message', ['id' => $b['id']]); return;