From: Mikael Nordfeldth Date: Fri, 8 Jan 2016 01:58:31 +0000 (+0100) Subject: Attention goes to the parent notice author too X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=33194b3cff8a787bde24607f47b20db796d75a2c;p=quix0rs-gnu-social.git Attention goes to the parent notice author too --- diff --git a/actions/newnotice.php b/actions/newnotice.php index f874e6f9cb..a97f439e24 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -189,7 +189,7 @@ class NewnoticeAction extends FormAction // FIXME: We should be able to get the attentions from common_render_content! // and maybe even directly save whether they're local or not! - $act->context->attention = common_find_attentions($content, $this->scoped, $parent); + $act->context->attention = common_get_attentions($content, $this->scoped, $parent); $actobj = new ActivityObject(); $actobj->type = ActivityObject::NOTE; diff --git a/lib/util.php b/lib/util.php index 62cd13af4a..7ce75e0fc0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -681,7 +681,7 @@ function common_linkify_mention(array $mention) return $output; } -function common_find_attentions($text, Profile $sender, Notice $parent=null) +function common_get_attentions($text, Profile $sender, Notice $parent=null) { $mentions = common_find_mentions($text, $sender, $parent); $atts = array(); @@ -690,6 +690,11 @@ function common_find_attentions($text, Profile $sender, Notice $parent=null) $atts[$mentioned->getUri()] = $mentioned->isGroup() ? ActivityObject::GROUP : ActivityObject::PERSON; } } + if ($parent instanceof Notice) { + $parentAuthor = $parent->getProfile(); + // afaik groups can't be authors + $atts[$parentAuthor->getUri()] = ActivityObject::PERSON; + } return $atts; }