// reasonably handle notifications themselves.
if (ActivityUtils::compareVerbs($stored->verb, array(ActivityVerb::POST))) {
- $stored->saveAttentions($act->context->attention);
-
if (!empty($tags)) {
$stored->saveKnownTags($tags);
} else {
// Note: groups may save tags, so must be run after tags are saved
// to avoid errors on duplicates.
- // Note: groups should always be set.
+ $stored->saveAttentions($act->context->attention);
if (!empty($urls)) {
$stored->saveKnownUrls($urls);
$user = User::getKV('uri', $uri);
if ($user instanceof User) {
$profile = $user->getProfile();
+ } else {
+ $group = User_group::getKV('uri', $uri);
+ if ($group instanceof User_group) {
+ $profile = $group->getProfile();
+ }
}
Event::handle('EndGetProfileFromURI', array($uri, $profile));
}
function onStartGetProfileFromURI($uri, &$profile)
{
// Don't want to do Web-based discovery on our own server,
- // so we check locally first.
+ // so we check locally first. This duplicates the functionality
+ // in the Profile class, since the plugin always runs before
+ // that local lookup, but since we return false it won't run double.
$user = User::getKV('uri', $uri);
-
- if (!empty($user)) {
+ if ($user instanceof User) {
$profile = $user->getProfile();
return false;
+ } else {
+ $group = User_group::getKV('uri', $uri);
+ if ($group instanceof User_group) {
+ $profile = $group->getProfile();
+ return false;
+ }
}
// Now, check remotely
-
try {
$oprofile = Ostatus_profile::ensureProfileURI($uri);
$profile = $oprofile->localProfile();