diff options
author | Evan Prodromou <evan@status.net> | 2010-03-28 15:25:02 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-28 15:25:02 -0400 |
commit | f0d905112ede6e45594b6ceceea3a6af4d9954f9 (patch) | |
tree | 4f10a268f5ea5f93ac3cb558972fed8360ce7993 /lib | |
parent | 5b7b38ab661c9556800db1e822748b2d0c16d225 (diff) | |
parent | 482faf661451b499240eb41234234607355e3aa8 (diff) |
Merge branch 'master' into 0.9.x
Conflicts:
lib/attachmentlist.php
Diffstat (limited to 'lib')
-rw-r--r-- | lib/activity.php | 11 | ||||
-rw-r--r-- | lib/activityobject.php | 25 | ||||
-rw-r--r-- | lib/attachmentlist.php | 2 | ||||
-rw-r--r-- | lib/common.php | 4 |
4 files changed, 21 insertions, 21 deletions
diff --git a/lib/activity.php b/lib/activity.php index f9192c6b8..5d6230c6d 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -179,6 +179,17 @@ class Activity $this->actor = new ActivityObject($actorEl); + // Cliqset has bad actor IDs (just nickname of user). We + // work around it by getting the author data and using its + // id instead + + if (!preg_match('/^\w+:/', $this->actor->id)) { + $authorEl = ActivityUtils::child($entry, 'author'); + if (!empty($authorEl)) { + $authorObj = new ActivityObject($authorEl); + $this->actor->id = $authorObj->id; + } + } } else if (!empty($feed) && $subjectEl = $this->_child($feed, self::SUBJECT)) { 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() diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index d29a5fa2f..43f836e15 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -337,7 +337,7 @@ class Attachment extends AttachmentListItem $this->showHtmlFile($this->attachment); break; } - // Fall through to default + // Fall through to default. default: $this->showFallback(); diff --git a/lib/common.php b/lib/common.php index 334a88ffd..8d2e6b420 100644 --- a/lib/common.php +++ b/lib/common.php @@ -22,10 +22,10 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } //exit with 200 response, if this is checking fancy from the installer if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } -define('STATUSNET_VERSION', '0.9.0'); +define('STATUSNET_VERSION', '0.9.1'); define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility -define('STATUSNET_CODENAME', 'Stand'); +define('STATUSNET_CODENAME', 'Everybody Hurts'); define('AVATAR_PROFILE_SIZE', 96); define('AVATAR_STREAM_SIZE', 48); |