diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-02 16:30:09 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-02 16:36:08 -0800 |
commit | 79ffebb51b1141791d5ee7478e3a7beaa9fe8faa (patch) | |
tree | 70a0ab1453cbdb50bf9474fdff5e8743bc1c3eff /lib | |
parent | 9f94d6defa0d2536cb1f20a4c1c44ff78fd3f039 (diff) |
OStatus: save file records for enclosures
Also stripping id from foreign HTML messages (could interfere with UI) and disabled failing attachment popup for a.attachment links that don't have a proper id, so you can click through instead of getting an error.
Issues:
* any other links aren't marked and saved
* inconsistent behavior between local and remote attachments (local displays in lightbox, remote doesn't)
* if the enclosure'd object isn't referenced in the content, you won't be offered a link to it in our UI
Diffstat (limited to 'lib')
-rw-r--r-- | lib/activity.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/activity.php b/lib/activity.php index b20153213..ce14fa254 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 @@ -1140,6 +1141,10 @@ class Activity $this->categories[] = new AtomCategory($catEl); } } + + foreach (ActivityUtils::getLinks($entry, 'enclosure') as $link) { + $this->enclosures[] = $link->getAttribute('href'); + } } /** |