]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show context link if this notice starts a conversation
authorCraig Andrews <candrews@integralblue.com>
Fri, 18 Sep 2009 21:37:36 +0000 (17:37 -0400)
committerCraig Andrews <candrews@integralblue.com>
Fri, 18 Sep 2009 21:37:59 +0000 (17:37 -0400)
lib/noticelist.php

index 6b2bccd9766b1a827ade6fbc99364408425b0a4a..507413da76ea2b3c5503e7954b9a6673e105fe35 100644 (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,