summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-19 15:49:38 -0500
committerEvan Prodromou <evan@status.net>2010-03-19 15:49:38 -0500
commit022c13418dd268ee1955614d06c264c16bf779cb (patch)
tree99d4dd85c1d9be2b1ac0b689e6e96700ed6af45b
parent1292230e380300e194f0695f95fe1554cd7863a5 (diff)
make deriving a subject from an RSS channel work
-rw-r--r--lib/activity.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/activity.php b/lib/activity.php
index dcd079c7a..20e501acb 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -799,20 +799,24 @@ class ActivityObject
$obj->type = ActivityObject::PERSON; // @fixme guess better
- $obj->title = ActivityUtils::childContent($el, ActivityObject::TITLE, self::RSS);
- $obj->link = ActivityUtils::childContent($el, ActivityUtils::LINK, self::RSS);
- $obj->id = ActivityUtils::getLink($el, self::SELF);
+ $obj->title = ActivityUtils::childContent($el, ActivityObject::TITLE, Activity::RSS);
+ $obj->link = ActivityUtils::childContent($el, ActivityUtils::LINK, Activity::RSS);
+ $obj->id = ActivityUtils::getLink($el, Activity::SELF);
- $desc = ActivityUtils::childContent($el, self::DESCRIPTION, self::RSS);
+ if (empty($obj->id)) {
+ $obj->id = $obj->link;
+ }
+
+ $desc = ActivityUtils::childContent($el, Activity::DESCRIPTION, Activity::RSS);
if (!empty($desc)) {
$obj->content = htmlspecialchars_decode($desc, ENT_QUOTES);
}
- $imageEl = ActivityUtils::child($el, self::IMAGE, self::RSS);
+ $imageEl = ActivityUtils::child($el, Activity::IMAGE, Activity::RSS);
if (!empty($imageEl)) {
- $obj->avatarLinks[] = ActivityUtils::childContent($imageEl, self::URL, self::RSS);
+ $obj->avatarLinks[] = ActivityUtils::childContent($imageEl, Activity::URL, Activity::RSS);
}
return $obj;