-\InitializePlugin: a chance to initialize a plugin in a complete environment
+InitializePlugin: a chance to initialize a plugin in a complete environment
CleanupPlugin: a chance to cleanup a plugin at the end of a program
EndRobotsTxt: After the default robots.txt page (good place for customization)
- &$action: RobotstxtAction being shown
+GetProfileUri: When determining the canonical URI for a given profile
+- &$profile: the current profile
+
$xs->element(
'link', array(
'rel' => 'ostatus:attention',
- 'href' => $profile->getAcctUri()
+ 'href' => $profile->getUri()
)
);
}
$xs->element(
'id',
null,
- common_local_url(
- 'userbyid',
- array('id' => $this->id)
- )
+ $this->getUri()
);
$xs->element('title', null, $this->getBestName());
return $xs->getString();
}
- function getAcctUri()
+ function getUri()
{
- return $this->nickname . '@' . common_config('site', 'server');
+ if (Event::handle('GetProfileUri', array($this))) {
+
+ $remote = Remote_profile::staticGet('id', $this->id);
+
+ if (!empty($remote)) {
+ return $remote->uri;
+ } else {
+ return common_local_url(
+ 'userbyid',
+ array('id' => $this->id)
+ );
+ }
+ }
}
}