]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Attention goes to the parent notice author too
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 8 Jan 2016 01:58:31 +0000 (02:58 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 8 Jan 2016 01:58:31 +0000 (02:58 +0100)
actions/newnotice.php
lib/util.php

index f874e6f9cb3b268c1bc6fc5b9e847e0878e058d7..a97f439e24d24e504764269813a43f4a3501d90a 100644 (file)
@@ -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;
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;
 }