Commit 33194b3c authored by mmn's avatar mmn

Attention goes to the parent notice author too

parent 28cd5640
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment