Merge pull request #193 from annando/master

Buffer: Improvement for posts to app.net.
This commit is contained in:
tobiasd 2014-05-19 08:05:38 +02:00
commit 4d060c48a1

View File

@ -342,17 +342,12 @@ function buffer_send(&$a,&$b) {
if (($profile->service == "twitter") AND isset($post["url"])) if (($profile->service == "twitter") AND isset($post["url"]))
$post["text"] .= " ".$post["url"]; $post["text"] .= " ".$post["url"];
elseif (($profile->service == "appdotnet") AND isset($post["url"]) AND isset($post["title"])) { elseif (($profile->service == "appdotnet") AND isset($post["url"]) AND isset($post["title"])) {
$maxdesclength = $limit - (strlen($post["text"]) + 1); $post["title"] = shortenmsg($post["title"], 90);
if (strlen($post["title"]) > $maxdesclength) $post["text"] = shortenmsg($post["text"], $limit - (24 + strlen($post["title"])));
$posttitle = trim(substr($post["title"], 0, $maxdesclength - 3))."..."; $post["text"] .= "\n[".$post["title"]."](".$post["url"].")";
else
$posttitle = trim($post["title"]);
$post["text"] .= "\n[".$posttitle."](".$post["url"].")";
} elseif (($profile->service == "appdotnet") AND isset($post["url"])) } elseif (($profile->service == "appdotnet") AND isset($post["url"]))
$post["text"] .= " ".$post["url"]; $post["text"] .= " ".$post["url"];
$message = array(); $message = array();
$message["text"] = $post["text"]; $message["text"] = $post["text"];
$message["profile_ids[]"] = $profile->id; $message["profile_ids[]"] = $profile->id;