$this->type = self::PERSON; // XXX: is this fair?
}
- // start with <atom:title>
- $title = ActivityUtils::childHtmlContent($element, self::TITLE);
+ // Start with <poco::displayName>
- if (!empty($title)) {
- $this->title = common_strip_html($title);
+ $this->title = ActivityUtils::childContent($element, PoCo::DISPLAYNAME, PoCo::NS);
+
+ // try falling back to <atom:title>
+
+ if (empty($this->title)) {
+ $title = ActivityUtils::childHtmlContent($element, self::TITLE);
+
+ if (!empty($title)) {
+ $this->title = common_strip_html($title);
+ }
}
- // fall back to <atom:name>
+ // fall back to <atom:name> as a last resort
if (empty($this->title)) {
$this->title = $this->_childContent($element, self::NAME);
// @todo FIXME: rationalize with Activity::_fromRssItem()
private function _fromRssItem($item)
{
+ if (empty($this->type)) {
+ $this->type = ActivityObject::NOTE;
+ }
+
$this->title = ActivityUtils::childContent($item, ActivityObject::TITLE, Activity::RSS);
$contentEl = ActivityUtils::child($item, ActivityUtils::CONTENT, Activity::CONTENTNS);
switch (self::canonicalType($object->type)) {
case 'image':
- $object->largerImage = $file->url;
+ $object->largerImage = $file->getUrl();
break;
case 'video':
case 'audio':
- $object->stream = $file->url;
+ $object->stream = $file->getUrl();
break;
}
if (is_string($this->thumbnail)) {
$object['image'] = array('url' => $this->thumbnail);
} else {
- $object['image'] = array('url' => $this->thumbnail->url);
+ $object['image'] = array('url' => $this->thumbnail->getUrl());
if ($this->thumbnail->width) {
$object['image']['width'] = $this->thumbnail->width;
}