summaryrefslogtreecommitdiff
path: root/lib/activityobject.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-29 15:14:25 -0700
committerBrion Vibber <brion@pobox.com>2010-03-29 15:14:25 -0700
commit873b8328272ae9cb189477fd10e75b16d5ce050e (patch)
tree89979da777a4d2158321f56a69409882d6e96321 /lib/activityobject.php
parenta8d92dad5e4b82dd5a4f0ca7ed52f37256b60cd2 (diff)
parentbf468e2a8db4d67a0f1a2c7fdfd0aa9306e006fc (diff)
Merge branch 'master' into testing
Conflicts: plugins/Blacklist/BlacklistPlugin.php
Diffstat (limited to 'lib/activityobject.php')
-rw-r--r--lib/activityobject.php25
1 files changed, 7 insertions, 18 deletions
diff --git a/lib/activityobject.php b/lib/activityobject.php
index 34d1b9170..677a48197 100644
--- a/lib/activityobject.php
+++ b/lib/activityobject.php
@@ -177,10 +177,7 @@ class ActivityObject
$this->type = self::PERSON; // XXX: is this fair?
$this->title = $this->_childContent($element, self::NAME);
- $id = $this->_childContent($element, self::URI);
- if (ActivityUtils::validateUri($id)) {
- $this->id = $id;
- }
+ $this->id = $this->_childContent($element, self::URI);
if (empty($this->id)) {
$email = $this->_childContent($element, self::EMAIL);
@@ -193,15 +190,6 @@ class ActivityObject
private function _fromAtomEntry($element)
{
- if ($element->localName == 'actor') {
- // Old-fashioned <activity:actor>...
- // First pull anything from <author>, then we'll add on top.
- $author = ActivityUtils::child($element->parentNode, 'author');
- if ($author) {
- $this->_fromAuthor($author);
- }
- }
-
$this->type = $this->_childContent($element, Activity::OBJECTTYPE,
Activity::SPEC);
@@ -209,11 +197,6 @@ class ActivityObject
$this->type = ActivityObject::NOTE;
}
- $id = $this->_childContent($element, self::ID);
- if (ActivityUtils::validateUri($id)) {
- $this->id = $id;
- }
-
$this->summary = ActivityUtils::childHtmlContent($element, self::SUMMARY);
$this->content = ActivityUtils::getContent($element);
@@ -226,6 +209,12 @@ class ActivityObject
$this->source = $this->_getSource($element);
$this->link = ActivityUtils::getPermalink($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;
+ }
}
// @fixme rationalize with Activity::_fromRssItem()