From: Evan Prodromou Date: Sat, 16 Apr 2011 19:39:54 +0000 (-0400) Subject: don't show addressee info for root notice of conversation X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=53c927ed8ec964d187b1eb129554f3d80e00c23a;p=quix0rs-gnu-social.git don't show addressee info for root notice of conversation --- diff --git a/lib/threadednoticelist.php b/lib/threadednoticelist.php index 3725ff0535..96be0df0c5 100644 --- a/lib/threadednoticelist.php +++ b/lib/threadednoticelist.php @@ -221,7 +221,7 @@ class ThreadedNoticeListItem extends NoticeListItem } foreach (array_reverse($notices) as $notice) { if (Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice))) { - $item = new ThreadedNoticeListSubItem($notice, $this->out); + $item = new ThreadedNoticeListSubItem($notice, $this->notice, $this->out); $item->show(); Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice)); } @@ -248,6 +248,14 @@ class ThreadedNoticeListItem extends NoticeListItem // @todo FIXME: needs documentation. class ThreadedNoticeListSubItem extends NoticeListItem { + protected $root = null; + + function __construct($notice, $root, $out) + { + $this->root = $root; + parent::__construct($notice, $out); + } + function avatarSize() { return AVATAR_STREAM_SIZE; // @fixme would like something in between @@ -268,6 +276,23 @@ class ThreadedNoticeListSubItem extends NoticeListItem // } + function getReplyProfiles() + { + $all = parent::getReplyProfiles(); + + $profiles = array(); + + $rootAuthor = $this->root->getProfile(); + + foreach ($all as $profile) { + if ($profile->id != $rootAuthor->id) { + $profiles[] = $profile; + } + } + + return $profiles; + } + function showEnd() { $item = new ThreadedNoticeListInlineFavesItem($this->notice, $this->out);