Merge pull request #208 from annando/master

Use of the new cache function, setting some addons in the "deprecated" status
This commit is contained in:
fabrixxm 2014-08-20 18:24:40 +02:00
commit 9acc0c9785
6 changed files with 30 additions and 25 deletions

View file

@ -253,9 +253,6 @@ function buffer_send(&$a,&$b) {
if($access_token) { if($access_token) {
$buffer = new BufferApp($client_id, $client_secret, $callback_url, $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/plaintext.php");
require_once("include/network.php"); require_once("include/network.php");
@ -308,15 +305,13 @@ function buffer_send(&$a,&$b) {
$post = plaintext($a, $item, $limit, $includedlinks); $post = plaintext($a, $item, $limit, $includedlinks);
logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG); 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 // The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures
if ($image_cache) { require_once("mod/proxy.php");
require_once("addon/privacy_image_cache/privacy_image_cache.php"); if (isset($post["image"]))
if (isset($post["image"])) $post["image"] = proxy_url($post["image"]);
$post["image"] = $a->get_baseurl() . "/privacy_image_cache/".privacy_image_cache_cachename($post["image"]);
if (isset($post["preview"])) if (isset($post["preview"]))
$post["preview"] = $a->get_baseurl() . "/privacy_image_cache/".privacy_image_cache_cachename($post["preview"]); $post["preview"] = proxy_url($post["preview"]);
}
//if ($profile->service == "twitter") { //if ($profile->service == "twitter") {
if ($includedlinks) { if ($includedlinks) {

View file

@ -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. * 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 * Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike> * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* * Status: Unsupported
* *
*/ */

View file

@ -1032,6 +1032,13 @@ function fbpost_fetchwall($a, $uid) {
$oembed_data = oembed_fetch_url($item->link); $oembed_data = oembed_fetch_url($item->link);
$type = $oembed_data->type; $type = $oembed_data->type;
$content = "[bookmark=".$item->link."]".$item->name."[/bookmark]"; $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)) } elseif (isset($item->name))
$content .= "[b]".$item->name."[/b]"; $content .= "[b]".$item->name."[/b]";

View file

@ -233,24 +233,25 @@ function gpluspost_send(&$a,&$b) {
if (!get_pconfig($b["uid"],'gpluspost','no_loop_prevention') and ($b['app'] == "Google+")) if (!get_pconfig($b["uid"],'gpluspost','no_loop_prevention') and ($b['app'] == "Google+"))
return; return;
// Always do the export via RSS-Feed (even if NextScripts is enabled), since it doesn't hurt if (!gpluspost_nextscripts()) {
$itemlist = get_pconfig($b["uid"],'gpluspost','itemlist'); // Posting via RSS-Feed and Hootsuite
$items = explode(",", $itemlist); $itemlist = get_pconfig($b["uid"],'gpluspost','itemlist');
$items = explode(",", $itemlist);
$i = 0; $i = 0;
$newitems = array($b['id']); $newitems = array($b['id']);
foreach ($items AS $item) foreach ($items AS $item)
if ($i++ < 9) if ($i++ < 9)
$newitems[] = $item; $newitems[] = $item;
$itemlist = implode(",", $newitems); $itemlist = implode(",", $newitems);
logger('gpluspost_send: new itemlist: '.$itemlist." for uid ".$b["uid"]); logger('gpluspost_send: new itemlist: '.$itemlist." for uid ".$b["uid"]);
set_pconfig($b["uid"],'gpluspost','itemlist', $itemlist); set_pconfig($b["uid"],'gpluspost','itemlist', $itemlist);
// Posting via NextScripts } else {
if (gpluspost_nextscripts()) { // Posting via NextScripts
$username = get_pconfig($b['uid'],'gpluspost','username'); $username = get_pconfig($b['uid'],'gpluspost','username');
$password = get_pconfig($b['uid'],'gpluspost','password'); $password = get_pconfig($b['uid'],'gpluspost','password');
$page = get_pconfig($b['uid'],'gpluspost','page'); $page = get_pconfig($b['uid'],'gpluspost','page');

View file

@ -6,6 +6,7 @@
* Author: Mike Macgirvin <mike@macgirvin.com> * Author: Mike Macgirvin <mike@macgirvin.com>
* based on pages plugin by * based on pages plugin by
* Author: Michael Vogel <ike@piratenpartei.de> * Author: Michael Vogel <ike@piratenpartei.de>
* Status: Unsupported
* *
*/ */

View file

@ -4,6 +4,7 @@
* Name: Privacy Image Cache * Name: Privacy Image Cache
* Version: 0.1 * Version: 0.1
* Author: Tobias Hößl <https://github.com/CatoTH/> * Author: Tobias Hößl <https://github.com/CatoTH/>
* Status: Unsupported
*/ */
define("PRIVACY_IMAGE_CACHE_DEFAULT_TIME", 86400); // 1 Day define("PRIVACY_IMAGE_CACHE_DEFAULT_TIME", 86400); // 1 Day