Attention goes to the parent notice author too

This commit is contained in:
Mikael Nordfeldth 2016-01-08 02:58:31 +01:00
parent 28cd5640c1
commit 33194b3cff
2 changed files with 7 additions and 2 deletions

View File

@ -189,7 +189,7 @@ class NewnoticeAction extends FormAction
// FIXME: We should be able to get the attentions from common_render_content! // FIXME: We should be able to get the attentions from common_render_content!
// and maybe even directly save whether they're local or not! // 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 = new ActivityObject();
$actobj->type = ActivityObject::NOTE; $actobj->type = ActivityObject::NOTE;

View File

@ -681,7 +681,7 @@ function common_linkify_mention(array $mention)
return $output; 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); $mentions = common_find_mentions($text, $sender, $parent);
$atts = array(); $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; $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; return $atts;
} }