From 18d8a9bbc20112ead11991ab74028a7b7bd4cb22 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 18 May 2014 23:41:42 +0200 Subject: [PATCH] Buffer: Improvement for posts to app.net. --- buffer/buffer.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/buffer/buffer.php b/buffer/buffer.php index 766cef4a5..a6bd6aaf2 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -342,17 +342,12 @@ function buffer_send(&$a,&$b) { if (($profile->service == "twitter") AND isset($post["url"])) $post["text"] .= " ".$post["url"]; elseif (($profile->service == "appdotnet") AND isset($post["url"]) AND isset($post["title"])) { - $maxdesclength = $limit - (strlen($post["text"]) + 1); - if (strlen($post["title"]) > $maxdesclength) - $posttitle = trim(substr($post["title"], 0, $maxdesclength - 3))."..."; - else - $posttitle = trim($post["title"]); - - $post["text"] .= "\n[".$posttitle."](".$post["url"].")"; + $post["title"] = shortenmsg($post["title"], 90); + $post["text"] = shortenmsg($post["text"], $limit - (24 + strlen($post["title"]))); + $post["text"] .= "\n[".$post["title"]."](".$post["url"].")"; } elseif (($profile->service == "appdotnet") AND isset($post["url"])) $post["text"] .= " ".$post["url"]; - $message = array(); $message["text"] = $post["text"]; $message["profile_ids[]"] = $profile->id;