X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2FOStatusPlugin.php;h=ef9a39a3772b47e878d3ca5793e40a6d6a04699a;hb=15686cdf56bbb6eb39f80422579c273e8ae5ffad;hp=86bd15e0b73491f67619e062e124e1c2d103fa08;hpb=6e894c010fc0e7ddaaafa8795634d6343019aafb;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 86bd15e0b7..ef9a39a377 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -419,12 +419,12 @@ class OStatusPlugin extends Plugin } 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; } @@ -992,23 +992,35 @@ class OStatusPlugin extends Plugin 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. + + $user = User::staticGet('uri', $uri); + + if (!empty($user)) { + $profile = $user->getProfile(); + return false; + } - // XXX: do discovery here instead (OStatus_profile::ensureProfileURI($uri)) + // Now, check remotely - $oprofile = Ostatus_profile::staticGet('uri', $uri); + $oprofile = Ostatus_profile::ensureProfileURI($uri); - if (!empty($oprofile) && !$oprofile->isGroup()) { + 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')), @@ -1043,6 +1055,6 @@ class OStatusPlugin extends Plugin $xrd->links[] = array('rel' => 'http://ostatus.org/schema/1.0/subscribe', 'template' => $url ); - return true; + return true; } }