]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Handle selfLink in ActivityObject
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 6 May 2017 09:34:38 +0000 (11:34 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 6 May 2017 12:38:41 +0000 (14:38 +0200)
lib/activityobject.php

index 87eea13727e3261c8829a8459dad19b42113caab..fc62e5f46cad6e67aa799f19ac48b47b65d6a3b1 100644 (file)
@@ -102,6 +102,7 @@ class ActivityObject
     public $content;
     public $owner;
     public $link;
+    public $selfLink;   // think APP (Atom Publishing Protocol)
     public $source;
     public $avatarLinks = array();
     public $geopoint;
@@ -263,6 +264,7 @@ class ActivityObject
         $this->source  = $this->_getSource($element);
 
         $this->link = ActivityUtils::getPermalink($element);
+        $this->selfLink = ActivityUtils::getSelfLink($element);
 
         $this->id = $this->_childContent($element, self::ID);
 
@@ -651,6 +653,18 @@ class ActivityObject
                 );
             }
 
+            if (!empty($this->selfLink)) {
+                $xo->element(
+                    'link',
+                    array(
+                        'rel' => 'self',
+                        'type' => 'application/atom+xml',
+                        'href' => $this->selfLink
+                    ),
+                    null
+                );
+            }
+
             if(!empty($this->owner)) {
                 $owner = $this->owner->asActivityNoun(self::AUTHOR);
                 $xo->raw($owner);