Merge request #10 by aroque but in a slightly different version
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 5 Jan 2016 23:48:03 +0000 (00:48 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 5 Jan 2016 23:48:03 +0000 (00:48 +0100)
classes/Notice.php
lib/noticelistitem.php
lib/threadednoticelist.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().
index a440c4dd6298bdaf470e439bbd6e163417097cea..4c4bde34a1c3d1e75c1703854238c36e7ad53268 100644 (file)
@@ -297,7 +297,7 @@ class NoticeListItem extends Widget
         if($this->pa) { return $this->pa; }
         $this->pa = array();
 
-        $attentions = $this->getReplyProfiles();
+        $attentions = $this->getAttentionProfiles();
 
         foreach ($attentions as $attn) {
             $class = $attn->isGroup() ? 'group' : 'account';
@@ -310,9 +310,9 @@ class NoticeListItem extends Widget
         return $this->pa;
     }
 
-    function getReplyProfiles()
+    function getAttentionProfiles()
     {
-        return $this->notice->getReplyProfiles();
+        return $this->notice->getAttentionProfiles();
     }
 
     /**
index ebf0a460897069db61f43398e403e5905ee3b932..4b5d28de3f58596562caa0cdb60fcecef38193fe 100644 (file)
@@ -282,9 +282,9 @@ class ThreadedNoticeListSubItem extends NoticeListItem
         //
     }
 
-    function getReplyProfiles()
+    function getAttentionProfiles()
     {
-        $all = parent::getReplyProfiles();
+        $all = parent::getAttentionProfiles();
 
         $profiles = array();