]> git.mxchange.org Git - friendica-addons.git/commitdiff
Needed changes for a changed core function
authorMichael Vogel <icarus@dabo.de>
Sat, 5 Dec 2015 01:02:13 +0000 (02:02 +0100)
committerMichael Vogel <icarus@dabo.de>
Sat, 5 Dec 2015 01:02:13 +0000 (02:02 +0100)
appnet/appnet.php
buffer/buffer.php
statusnet/statusnet.php
twitter/twitter.php

index 9eb71713d0571b17d6883629e3035eb4fb4116af..10deb96d06eb11baeb245fabbe81df3f6d1e7dbb 100644 (file)
@@ -357,12 +357,12 @@ function appnet_create_entities($a, $b, $postdata) {
                $start = $pos + 1;
        }
 
-       if (isset($postdata["url"]) AND isset($postdata["title"])) {
+       if (isset($postdata["url"]) AND isset($postdata["title"]) AND ($postdata["type"] != "photo")) {
                $postdata["title"] = shortenmsg($postdata["title"], 90);
                $max = 256 - strlen($postdata["title"]);
                $text = shortenmsg($text, $max);
                $text .= "\n[".$postdata["title"]."](".$postdata["url"].")";
-       } elseif (isset($postdata["url"])) {
+       } elseif (isset($postdata["url"]) AND ($postdata["type"] != "photo")) {
                $postdata["url"] = short_link($postdata["url"]);
                $max = 240;
                $text = shortenmsg($text, $max);
@@ -524,7 +524,7 @@ function appnet_send(&$a,&$b) {
                                                "value" => $attached_data
                                                );
 
-               if (isset($post["url"]) AND !isset($post["title"])) {
+               if (isset($post["url"]) AND !isset($post["title"]) AND ($post["type"] != "photo")) {
                        $display_url = str_replace(array("http://www.", "https://www."), array("", ""), $post["url"]);
                        $display_url = str_replace(array("http://", "https://"), array("", ""), $display_url);
 
index 90a797583b65e710aa461f002f8c29819640421d..ebd3c37c1f5fcd47d997246ee75fb640d3735720 100644 (file)
@@ -341,13 +341,13 @@ function buffer_send(&$a,&$b) {
                                // Seems like a bug to me
                                // Buffer doesn't add links to Twitter and App.net (but pictures)
                                //if ($includedlinks AND isset($post["url"]))
-                               if (($profile->service == "twitter") AND isset($post["url"]))
+                               if (($profile->service == "twitter") AND isset($post["url"]) AND ($post["type"] != "photo"))
                                        $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"]) AND ($post["type"] != "photo")) {
                                        $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"]))
+                               } elseif (($profile->service == "appdotnet") AND isset($post["url"]) AND ($post["type"] != "photo"))
                                        $post["text"] .= " ".$post["url"];
                                elseif ($profile->service == "google")
                                        $post["text"] .= html_entity_decode("&#x00A0;", ENT_QUOTES, 'UTF-8'); // Send a special blank to identify the post through the "fromgplus" addon
index da6cb8af58335f98b218c93da57e500a5133fe91..12c26e470255eaad31f6f704934cd5f2ec4a1d88 100644 (file)
@@ -581,7 +581,7 @@ function statusnet_post_hook(&$a,&$b) {
 
                $image = "";
 
-               if (isset($msgarr["url"])) {
+               if (isset($msgarr["url"]) AND ($msgarr["type"] != "photo")) {
                        if ((strlen($msgarr["url"]) > 20) AND
                                ((strlen($msg." \n".$msgarr["url"]) > $max_char)))
                                $msg .= " \n".short_link($msgarr["url"]);
@@ -738,7 +738,7 @@ function statusnet_prepare_body(&$a,&$b) {
                 $msgarr = plaintext($a, $item, $max_char, true, 7);
                 $msg = $msgarr["text"];
 
-                if (isset($msgarr["url"]))
+                if (isset($msgarr["url"]) AND ($msgarr["type"] != "photo"))
                         $msg .= " ".$msgarr["url"];
 
                 if (isset($msgarr["image"]))
index 704f6193b4aaa29740a9ba9db954e9e4a24d4589..a6a27ea844f025a81a66cede29e346fd60cff54b 100644 (file)
@@ -475,7 +475,7 @@ function twitter_post_hook(&$a,&$b) {
 
                $image = "";
 
-               if (isset($msgarr["url"]))
+               if (isset($msgarr["url"]) AND ($msgarr["type"] != "photo"))
                        $msg .= "\n".$msgarr["url"];
                elseif (isset($msgarr["image"]) AND ($msgarr["type"] != "video"))
                        $image = $msgarr["image"];
@@ -707,7 +707,7 @@ function twitter_prepare_body(&$a,&$b) {
                $msgarr = plaintext($a, $item, $max_char, true, 8);
                $msg = $msgarr["text"];
 
-               if (isset($msgarr["url"]))
+               if (isset($msgarr["url"]) AND ($msgarr["type"] != "photo"))
                        $msg .= " ".$msgarr["url"];
 
                if (isset($msgarr["image"]))