Show context link if this notice starts a conversation

This commit is contained in:
Craig Andrews 2009-09-18 17:37:36 -04:00
parent fc0f871bfe
commit 6af71f2cd2
1 changed files with 11 additions and 3 deletions

View File

@ -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,