X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=fbsync%2Ffbsync.php;h=64f6fe2a34190aa1a5f4de7735a3d305b8ebde0c;hb=9e9916a8d5518860fda327de2d2e87d878efc0d2;hp=51d2747f93d8640570032d8eda81f575c796b412;hpb=d0d23ec2b64a7751c1f5be6183131834041a1e2c;p=friendica-addons.git diff --git a/fbsync/fbsync.php b/fbsync/fbsync.php index 51d2747f..64f6fe2a 100644 --- a/fbsync/fbsync.php +++ b/fbsync/fbsync.php @@ -216,6 +216,7 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr $access_token = get_pconfig($uid,'facebook','access_token'); require_once("include/oembed.php"); + require_once("include/network.php"); // check if it was already imported $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1", @@ -339,6 +340,7 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr $type = ""; if (isset($post->attachment->name) and isset($post->attachment->href)) { + $post->attachment->href = original_url($post->attachment->href); $oembed_data = oembed_fetch_url($post->attachment->href); $type = $oembed_data->type; if ($type == "rich") @@ -391,6 +393,8 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr } } + $preview = fbpost_cleanpicture($preview); + if (isset($media->href) AND ($preview != "") AND ($media->href != "")) $content .= "\n".'[url='.$media->href.'][img]'.$preview.'[/img][/url]'; else {