]> git.mxchange.org Git - friendica-addons.git/blobdiff - buffer/buffer.php
Merge pull request #189 from annando/master
[friendica-addons.git] / buffer / buffer.php
index d7ad69f6595617bf96aaff2d7115cb53bb3880f2..f6d16eaedaa498e65d5daa95f6531905ae36a418 100644 (file)
@@ -326,21 +326,19 @@ function buffer_send(&$a,&$b) {
                                                $post["preview"] = $a->get_baseurl() . "/privacy_image_cache/".privacy_image_cache_cachename($post["preview"]);
                                }
 
-                               //if ($includedlinks AND isset($post["url"]))
-                               //      $post["url"] = short_link($post["url"]);
+                               if ($includedlinks) {
+                                       if (isset($post["url"]))
+                                               $post["url"] = short_link($post["url"]);
+                                       if (isset($post["image"]))
+                                               $post["image"] = short_link($post["image"]);
+                                       if (isset($post["preview"]))
+                                               $post["preview"] = short_link($post["preview"]);
+                               }
 
                                // Seems like a bug to me
                                // Buffer doesn't add links to Twitter and App.net (but pictures)
                                if ($includedlinks AND isset($post["url"]))
-                                       $post["text"] .= " ".short_link($post["url"]);
-
-                               //if ($includedlinks AND ($post["type"] == "link"))
-                               //      $post["text"] .= " ".$post["url"];
-
-                               //if ($includedlinks AND ($post["type"] == "video"))
-                               //      $post["text"] .= " ".$post["url"];
-
-                               //print_r($post);
+                                       $post["text"] .= " ".$post["url"];
 
                                $message = array();
                                $message["text"] = $post["text"];