X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FOStatus%2FOStatusPlugin.php;h=59c18746f0d6892398d34d34d1798892307db64f;hb=5db1479a9526fbb264d1d51647e925355ed6f062;hp=d0b64e87694d41ffe09fb382820abe6735d8d236;hpb=d8d9edfc990a20f67421e40a7d3055a58697a002;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index d0b64e8769..59c18746f0 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -145,12 +145,10 @@ class OStatusPlugin extends Plugin $user = $feed->getUser(); $id = $user->id; $profile = $user->getProfile(); - $feed->setActivitySubject($profile->asActivityNoun('subject')); } else if ($feed instanceof AtomGroupNoticeFeed) { $salmonAction = 'groupsalmon'; $group = $feed->getGroup(); $id = $group->id; - $feed->setActivitySubject($group->asActivitySubject()); } else { return true; } @@ -994,17 +992,29 @@ 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. - // 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; }