summaryrefslogtreecommitdiff
path: root/lib/activity.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/activity.php')
-rw-r--r--lib/activity.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/activity.php b/lib/activity.php
index b20153213..e1bce6f19 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -1044,6 +1044,7 @@ class Activity
public $id; // ID of the activity
public $title; // title of the activity
public $categories = array(); // list of AtomCategory objects
+ public $enclosures = array(); // list of enclosure URL references
/**
* Turns a regular old Atom <entry> into a magical activity
@@ -1059,6 +1060,18 @@ class Activity
}
$this->entry = $entry;
+
+ // @fixme Don't send in a DOMDocument
+ if ($feed instanceof DOMDocument) {
+ common_log(
+ LOG_WARNING,
+ 'Activity::__construct() - '
+ . 'DOMDocument passed in for feed by mistake. '
+ . "Expecting a 'feed' DOMElement."
+ );
+ $feed = $feed->getElementsByTagName('feed')->item(0);
+ }
+
$this->feed = $feed;
$pubEl = $this->_child($entry, self::PUBLISHED, self::ATOM);
@@ -1140,6 +1153,10 @@ class Activity
$this->categories[] = new AtomCategory($catEl);
}
}
+
+ foreach (ActivityUtils::getLinks($entry, 'enclosure') as $link) {
+ $this->enclosures[] = $link->getAttribute('href');
+ }
}
/**