+function common_get_attentions($text, Profile $sender, Notice $parent=null)
+{
+ $mentions = common_find_mentions($text, $sender, $parent);
+ $atts = array();
+ foreach ($mentions as $mention) {
+ foreach ($mention['mentioned'] as $mentioned) {
+ $atts[$mentioned->getUri()] = $mentioned->getObjectType();
+ }
+ }
+ if ($parent instanceof Notice) {
+ $parentAuthor = $parent->getProfile();
+ // afaik groups can't be authors
+ $atts[$parentAuthor->getUri()] = ActivityObject::PERSON;
+ }
+ return $atts;
+}
+