]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Attention goes to the parent notice author too
[quix0rs-gnu-social.git] / lib / util.php
index 62cd13af4a4231339c2b1b66e6be04616fcd5f10..7ce75e0fc0430360b6d264c87b15c98b66cfc861 100644 (file)
@@ -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;
 }