]> git.mxchange.org Git - friendica-addons.git/commitdiff
Setting "editplain", "page" and "privacy_image_cache" as deprecated. Using new cache...
authorMichael Vogel <icarus@dabo.de>
Sat, 16 Aug 2014 08:25:29 +0000 (10:25 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 16 Aug 2014 08:25:29 +0000 (10:25 +0200)
buffer/buffer.php
editplain/editplain.php
fbpost/fbpost.php
page/page.php
privacy_image_cache/privacy_image_cache.php

index 99e1233b3792484c38b8064df45ac6a5b75bb55b..595dba43d9fcce41ab84bf9d63e8e5416e98280b 100644 (file)
@@ -253,9 +253,6 @@ function buffer_send(&$a,&$b) {
        if($access_token) {
                $buffer = new BufferApp($client_id, $client_secret, $callback_url, $access_token);
 
-               $result = q("SELECT `installed` FROM `addon` WHERE `name` = 'privacy_image_cache' AND `installed`");
-               $image_cache = (count($result) > 0);
-
                require_once("include/plaintext.php");
                require_once("include/network.php");
 
@@ -308,15 +305,13 @@ function buffer_send(&$a,&$b) {
                                $post = plaintext($a, $item, $limit, $includedlinks);
                                logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG);
 
-                               // The image cache is used as a sanitizer. Buffer seems to be really picky about pictures
-                               if ($image_cache) {
-                                       require_once("addon/privacy_image_cache/privacy_image_cache.php");
-                                       if (isset($post["image"]))
-                                               $post["image"] = $a->get_baseurl() . "/privacy_image_cache/".privacy_image_cache_cachename($post["image"]);
+                               // The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures
+                               require_once("mod/proxy.php");
+                               if (isset($post["image"]))
+                                       $post["image"] = proxy_url($post["image"]);
 
-                                       if (isset($post["preview"]))
-                                               $post["preview"] = $a->get_baseurl() . "/privacy_image_cache/".privacy_image_cache_cachename($post["preview"]);
-                               }
+                               if (isset($post["preview"]))
+                                       $post["preview"] = proxy_url($post["preview"]);
 
                                //if ($profile->service == "twitter") {
                                if ($includedlinks) {
index caa0f29d4c16c644a6502f32535422b600676e81..3aa2149153be6ed1151a1fa9f510ab61cc1b3a59 100755 (executable)
@@ -4,7 +4,7 @@
  * Description: This addon is deprecated and has been replaced with the "Advanced Features" setting.  Admins should remove this addon when their core code is updated to include advanced feature settings.
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
- * 
+ * Status: Unsupported
  *
  */
 
index 579fb148c1f25b718d84ac462f4ec3c7e3122a16..2ac558ea8def501329e32c1b58dafceffebadb4f 100644 (file)
@@ -1032,6 +1032,13 @@ function fbpost_fetchwall($a, $uid) {
                        $oembed_data = oembed_fetch_url($item->link);
                        $type = $oembed_data->type;
                        $content = "[bookmark=".$item->link."]".$item->name."[/bookmark]";
+
+                       // If a link is not only attached but also added in the body, look if it can be removed in the body.
+                       $removedlink = trim(str_replace($item->link, "", $_REQUEST["body"]));
+
+                       if (($removedlink == "") OR strstr($_REQUEST["body"], $removedlink))
+                               $_REQUEST["body"] = $removedlink;
+
                } elseif (isset($item->name))
                        $content .= "[b]".$item->name."[/b]";
 
index e1ca90703fd3374f6eee689c696c10bb2814a2ad..f81b011431bd268713a2b9da309e11508259dc4b 100755 (executable)
@@ -6,6 +6,7 @@
  * Author: Mike Macgirvin <mike@macgirvin.com>
  * based on pages plugin by
  * Author: Michael Vogel <ike@piratenpartei.de>
+ * Status: Unsupported
  *
  */
 
index 930fab538cdac73843eadff2320f2dd64d5f5466..8a303e7b069f14afa0adfe1eb468bbadf22e735b 100644 (file)
@@ -4,6 +4,7 @@
  * Name: Privacy Image Cache
  * Version: 0.1
  * Author: Tobias Hößl <https://github.com/CatoTH/>
+ * Status: Unsupported
  */
 
 define("PRIVACY_IMAGE_CACHE_DEFAULT_TIME", 86400); // 1 Day