]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/activityobject.php
No more needed (for this fix) but maybe later. So I always only comment them out.
[quix0rs-gnu-social.git] / lib / activityobject.php
index 7fe5c4850ca723105e4bfb82efb56d03450699f7..aa7636c713bc37ebdd7214505ef97439127dadf3 100644 (file)
@@ -195,15 +195,22 @@ class ActivityObject
             $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);
@@ -267,6 +274,10 @@ class ActivityObject
     // @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);