From 6af71f2cd2b2fcacb0f1eb2e0172a300802fe8bc Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 18 Sep 2009 17:37:36 -0400 Subject: [PATCH] Show context link if this notice starts a conversation --- lib/noticelist.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/noticelist.php b/lib/noticelist.php index 6b2bccd976..507413da76 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -418,9 +418,17 @@ class NoticeListItem extends Widget function showContext() { - // XXX: also show context if there are replies to this notice - if (!empty($this->notice->conversation) - && $this->notice->conversation != $this->notice->id) { + $hasConversation = false; + if( !empty($this->notice->conversation) + && $this->notice->conversation != $this->notice->id){ + $hasConversation = true; + }else{ + $conversation = Notice::conversationStream($this->notice->id, 1, 1); + if($conversation->N > 0){ + $hasConversation = true; + } + } + if ($hasConversation){ $convurl = common_local_url('conversation', array('id' => $this->notice->conversation)); $this->out->element('a', array('href' => $convurl.'#notice-'.$this->notice->id,