X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelineuser.php;fp=actions%2Fapitimelineuser.php;h=b509def613d29bbb26a9ace44d76375904dc7d07;hb=49fa34e23413f2901674ac0f2dc65b4bc8db6ddd;hp=f551dc72f7fad48bd7b7ccf584cf4fb8779c920a;hpb=89e817e5b0064e3da4d55b99398fd0b911ee1e77;p=quix0rs-gnu-social.git diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index f551dc72f7..b509def613 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -423,19 +423,15 @@ class ApiTimelineUserAction extends ApiBareAuthAction if ($activity->context instanceof ActivityContext) { foreach ($activity->context->attention as $uri=>$type) { - - $profile = Profile::fromURI($uri); - - if (!empty($profile)) { - $options['replies'][] = $uri; - } else { - $group = User_group::getKV('uri', $uri); - if (!empty($group)) { - $options['groups'][] = $group->id; + try { + $profile = Profile::fromUri($uri); + if ($profile->isGroup()) { + $options['groups'][] = $profile->id; } else { - // @fixme: hook for discovery here - common_log(LOG_WARNING, sprintf('AtomPub post with unknown attention URI %s', $uri)); + $options['replies'][] = $uri; } + } catch (UnknownUriException $e) { + common_log(LOG_WARNING, sprintf('AtomPub post with unknown attention URI %s', $uri)); } }