return false;
}
- function onStartGroupSubscribe($output, $group)
+ function onStartGroupSubscribe($widget, $group)
{
$cur = common_current_user();
// Add an OStatus subscribe
$url = common_local_url('ostatusinit',
array('group' => $group->nickname));
- $output->element('a', array('href' => $url,
+ $widget->out->element('a', array('href' => $url,
'class' => 'entity_remote_subscribe'),
// TRANS: Link description for link to join a remote group.
_m('Join'));
}
function onEndShowStatusNetStyles($action) {
- $action->cssLink('plugins/OStatus/theme/base/css/ostatus.css');
+ $action->cssLink($this->path('theme/base/css/ostatus.css'));
return true;
}
function onEndShowStatusNetScripts($action) {
- $action->script('plugins/OStatus/js/ostatus.js');
+ $action->script($this->path('js/ostatus.js'));
return true;
}
return false;
}
- function onStartGetProfileFromURI($uri, &$profile) {
+ function onStartGetProfileFromURI($uri, &$profile)
+ {
+ // Don't want to do Web-based discovery on our own server,
+ // so we check locally first.
- // XXX: do discovery here instead (OStatus_profile::ensureProfileURI($uri))
+ $user = User::staticGet('uri', $uri);
+
+ if (!empty($user)) {
+ $profile = $user->getProfile();
+ return false;
+ }
- $oprofile = Ostatus_profile::staticGet('uri', $uri);
+ // Now, check remotely
- if (!empty($oprofile) && !$oprofile->isGroup()) {
+ $oprofile = Ostatus_profile::ensureProfileURI($uri);
+
+ if (!empty($oprofile)) {
$profile = $oprofile->localProfile();
return false;
}
+ // Still not a hit, so give up.
+
return true;
}
function onEndXrdActionLinks(&$xrd, $user)
{
- $xrd->links[] = array('rel' => Discovery::UPDATESFROM,
+ $xrd->links[] = array('rel' => Discovery::UPDATESFROM,
'href' => common_local_url('ApiTimelineUser',
array('id' => $user->id,
'format' => 'atom')),
$xrd->links[] = array('rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => $url );
- return true;
+ return true;
}
}