]> git.mxchange.org Git - friendica-addons.git/blobdiff - fbsync/fbsync.php
appnet, fbsync, statusnet and twitter: Now a parent is provided in the notifications...
[friendica-addons.git] / fbsync / fbsync.php
index 78ecea1dd6978c0d80e3f7f706bf84884e0f1da5..51d2747f93d8640570032d8eda81f575c796b412 100644 (file)
@@ -345,6 +345,13 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
                        $type = "link";
 
                $content = "[bookmark=".$post->attachment->href."]".$post->attachment->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($post->attachment->href, "", $postarray["body"]));
+
+               if (($removedlink == "") OR strstr($postarray["body"], $removedlink))
+                       $postarray["body"] = $removedlink;
+
        } elseif (isset($post->attachment->name) AND ($post->attachment->name != ""))
                $content = "[b]" . $post->attachment->name."[/b]";