From: Mikael Nordfeldth Date: Tue, 5 Jan 2016 23:48:03 +0000 (+0100) Subject: Merge request #10 by aroque but in a slightly different version X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1946197a1c3095e35cfc2ccdded8de5ac77674b1;p=quix0rs-gnu-social.git Merge request #10 by aroque but in a slightly different version --- diff --git a/classes/Notice.php b/classes/Notice.php index 513888d245..c99da34c73 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -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(). diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index a440c4dd62..4c4bde34a1 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -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(); } /** diff --git a/lib/threadednoticelist.php b/lib/threadednoticelist.php index ebf0a46089..4b5d28de3f 100644 --- a/lib/threadednoticelist.php +++ b/lib/threadednoticelist.php @@ -282,9 +282,9 @@ class ThreadedNoticeListSubItem extends NoticeListItem // } - function getReplyProfiles() + function getAttentionProfiles() { - $all = parent::getReplyProfiles(); + $all = parent::getAttentionProfiles(); $profiles = array();