]> git.mxchange.org Git - friendica-addons.git/commitdiff
fromgplus: double descriptions are now suppressed.
authorMichael Vogel <icarus@dabo.de>
Sat, 8 Jun 2013 10:29:16 +0000 (12:29 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 8 Jun 2013 10:29:16 +0000 (12:29 +0200)
fromgplus/fromgplus.php

index 05cc8ec2344c56402872057774fac43b3bbcfa60..5d0e86c3d92f00a3d5db725ad12ad3a9f270b99b 100644 (file)
@@ -212,7 +212,7 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
        return($cleaned);
 }
 
-function fromgplus_handleattachments($item) {
+function fromgplus_handleattachments($item, $displaytext) {
        $post = "";
        $quote = "";
 
@@ -251,7 +251,7 @@ function fromgplus_handleattachments($item) {
                                elseif ($images["full"] != "")
                                        $post .= "\n[img]".$images["full"]."[/img]\n";
 
-                               if ($attachment->displayName != "")
+                               if (($attachment->displayName != "") AND ($attachment->displayName != $displaytext))
                                        $post .= fromgplus_html2bbcode($attachment->displayName)."\n";
                                break;
 
@@ -319,7 +319,7 @@ function fromgplus_fetch($a, $uid) {
                                        $post = fromgplus_html2bbcode($item->object->content);
 
                                        if (is_array($item->object->attachments))
-                                               $post .= fromgplus_handleattachments($item);
+                                               $post .= fromgplus_handleattachments($item, $item->object->content);
 
                                        // geocode, placeName
                                        if (isset($item->address))
@@ -346,7 +346,7 @@ function fromgplus_fetch($a, $uid) {
                                                $post .= fromgplus_html2bbcode($item->object->content);
 
                                                if (is_array($item->object->attachments))
-                                                       $post .= "\n".trim(fromgplus_handleattachments($item));
+                                                       $post .= "\n".trim(fromgplus_handleattachments($item, $item->object->content));
 
                                                $post .= "[/share]";
                                        } else {
@@ -355,7 +355,7 @@ function fromgplus_fetch($a, $uid) {
                                                $post .= fromgplus_html2bbcode($item->object->content);
 
                                                if (is_array($item->object->attachments))
-                                                       $post .= "\n".trim(fromgplus_handleattachments($item));
+                                                       $post .= "\n".trim(fromgplus_handleattachments($item, $item->object->content));
                                        }
 
                                        if (isset($item->address))