]> git.mxchange.org Git - friendica-addons.git/blobdiff - fromgplus/fromgplus.php
Merge remote-tracking branch 'upstream/master'
[friendica-addons.git] / fromgplus / fromgplus.php
index d86f7efea35cccd726be675cb71ef35cdf95cca2..5bd82ed86855cd0c205cfbd7c50c502465520254 100644 (file)
@@ -275,6 +275,9 @@ function fromgplus_handleattachments($item) {
                                        $post .= "\n[url=".$thumb->url."][img]".$image."[/img][/url]\n";
                                }
                                break;
+                       case "audio":
+                               $post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n";
+                               break;
                        //default:
                        //      die($attachment->objectType);
                }
@@ -298,6 +301,9 @@ function fromgplus_fetch($a, $uid) {
 
        $lastdate = 0;
 
+       if (!is_array($activities->items))
+               return;
+
        $reversed = array_reverse($activities->items);
 
        foreach($reversed as $item) {
@@ -327,14 +333,27 @@ function fromgplus_fetch($a, $uid) {
 
                                case "activity":
                                        $post = fromgplus_html2bbcode($item->annotation)."\n";
-                                       $post .= fromgplus_html2bbcode("♲");
-                                       //$post .= html2bbcode("♻");
-                                       //$post .= fromgplus_html2bbcode("◌");
-                                       $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n";
-                                       $post .= fromgplus_html2bbcode($item->object->content);
 
-                                       if (is_array($item->object->attachments))
-                                               $post .= "\n".trim(fromgplus_handleattachments($item));
+                                       if (intval(get_config('system','new_share'))) {
+                                               $post .= "[share author='".str_replace("'", "'",$item->object->actor->displayName).
+                                                               "' profile='".$item->object->actor->url.
+                                                               "' avatar='".$item->object->actor->image->url.
+                                                               "' link='".$item->object->url."']";
+
+                                               $post .= fromgplus_html2bbcode($item->object->content);
+
+                                               if (is_array($item->object->attachments))
+                                                       $post .= "\n".trim(fromgplus_handleattachments($item));
+
+                                               $post .= "[/share]";
+                                       } else {
+                                               $post .= fromgplus_html2bbcode("♲");
+                                               $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n";
+                                               $post .= fromgplus_html2bbcode($item->object->content);
+
+                                               if (is_array($item->object->attachments))
+                                                       $post .= "\n".trim(fromgplus_handleattachments($item));
+                                       }
 
                                        if (isset($item->address))
                                                $location = $item->address;