]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Don't trust local HTML either
[quix0rs-gnu-social.git] / lib / util.php
index 62cd13af4a4231339c2b1b66e6be04616fcd5f10..7ebbf42cf601f58feed5b75ed3af1e3f3486ece1 100644 (file)
@@ -681,15 +681,20 @@ 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();
     foreach ($mentions as $mention) {
         foreach ($mention['mentioned'] as $mentioned) {
-            $atts[$mentioned->getUri()] = $mentioned->isGroup() ? ActivityObject::GROUP : ActivityObject::PERSON;
+            $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;
 }