* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
require_once(INSTALLDIR.'/lib/activitystreamjsondocument.php');
public $content;
public $owner;
public $link;
+ public $selfLink; // think APP (Atom Publishing Protocol)
public $source;
public $avatarLinks = array();
public $geopoint;
$this->source = $this->_getSource($element);
$this->link = ActivityUtils::getPermalink($element);
+ $this->selfLink = ActivityUtils::getSelfLink($element);
$this->id = $this->_childContent($element, self::ID);
if (empty($this->id) && !empty($this->link)) { // fallback if there's no ID
$this->id = $this->link;
}
+
+ $els = $element->childNodes;
+ $out = array();
+
+ for ($i = 0; $i < $els->length; $i++) {
+ $link = $els->item($i);
+ if ($link->localName == ActivityUtils::LINK && $link->namespaceURI == ActivityUtils::ATOM) {
+ $attrs = array();
+ foreach ($link->attributes as $attrName=>$attrNode) {
+ $attrs[$attrName] = $attrNode->nodeValue;
+ }
+ $this->extra[] = [$link->localName,
+ $attrs,
+ $link->nodeValue];
+ }
+ }
}
// @todo FIXME: rationalize with Activity::_fromRssItem()
);
}
+ 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);