]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Merge request #10 by aroque but in a slightly different version
[quix0rs-gnu-social.git] / classes / Notice.php
index 513888d2450f3e1a738fba7ab93c287ff03837e9..c99da34c734f1223d5de690eb4d8e38897875cc5 100644 (file)
@@ -1721,9 +1721,9 @@ class Notice extends Managed_DataObject
      *
      * @return array of Profiles
      */
-    function getReplyProfiles()
+    function getAttentionProfiles()
     {
-        $ids = $this->getReplies();
+        $ids = array_unique(array_merge($this->getReplies(), $this->getGroupProfileIDs()));
 
         $profiles = Profile::multiGet('id', $ids);
 
@@ -1759,6 +1759,23 @@ class Notice extends Managed_DataObject
         }
     }
 
+    /**
+     * Pull list of Profile IDs of groups this notice addresses.
+     *
+     * @return array of Group _profile_ IDs
+     */
+
+    function getGroupProfileIDs()
+    {
+        $ids = array();
+
+               foreach ($this->getGroups() as $group) {
+                   $ids[] = $group->profile_id;
+               }
+
+        return $ids;
+    }
+
     /**
      * Pull list of groups this notice needs to be delivered to,
      * as previously recorded by saveKnownGroups().