Merge branch 'testing' of gitorious.org:statusnet/mainline into testing

* 'testing' of gitorious.org:statusnet/mainline:
  OStatus: if no <link> available and no profileurl hint passed in, use object id if it's an HTTP(S) URL. Fixes profile link for Google accounts.
  Tweak common_url_to_nickname to take the last path component; fixes pulling nicks from Google profile pages (path is "/profile/<nickname>")
  Fix bug on subscribe/unsubscribe in profile lists. Bogus call to nonexisting profile->getProfile() was masked by DB_DataObject
This commit is contained in:
Zach Copley 2010-02-25 16:07:32 -08:00
commit 82cac2be59
3 changed files with 5 additions and 2 deletions

View File

@ -145,7 +145,7 @@ class SubscribeAction extends Action
$this->element('title', null, _('Subscribed')); $this->element('title', null, _('Subscribed'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
$unsubscribe = new UnsubscribeForm($this, $this->other->getProfile()); $unsubscribe = new UnsubscribeForm($this, $this->other);
$unsubscribe->show(); $unsubscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->elementEnd('html');

View File

@ -1698,7 +1698,8 @@ function common_url_to_nickname($url)
# Strip starting, ending slashes # Strip starting, ending slashes
$path = preg_replace('@/$@', '', $parts['path']); $path = preg_replace('@/$@', '', $parts['path']);
$path = preg_replace('@^/@', '', $path); $path = preg_replace('@^/@', '', $path);
if (strpos($path, '/') === false) { $path = basename($path);
if ($path) {
return common_nicknamize($path); return common_nicknamize($path);
} }
} }

View File

@ -1161,6 +1161,8 @@ class Ostatus_profile extends Memcached_DataObject
$profile->profileurl = $object->link; $profile->profileurl = $object->link;
} else if (array_key_exists('profileurl', $hints)) { } else if (array_key_exists('profileurl', $hints)) {
$profile->profileurl = $hints['profileurl']; $profile->profileurl = $hints['profileurl'];
} else if (Validate::uri($object->id, array('allowed_schemes' => array('http', 'https')))) {
$profile->profileurl = $object->id;
} }
$profile->bio = self::getActivityObjectBio($object, $hints); $profile->bio = self::getActivityObjectBio($object, $hints);