]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Merge branch 'master' into testing
[quix0rs-gnu-social.git] / classes / Notice.php
index a8147e4c4d4ef534aad6a64709096b5c47fcf2d0..0d8525637586b26a2bc7f02ea09582c80de9660b 100644 (file)
@@ -701,6 +701,27 @@ class Notice extends Memcached_DataObject
         return $ids;
     }
 
+    /**
+     * Is this notice part of an active conversation?
+     * 
+     * @return boolean true if other messages exist in the same
+     *                 conversation, false if this is the only one
+     */
+    function hasConversation()
+    {
+        if (!empty($this->conversation)) {
+            $conversation = Notice::conversationStream(
+                $this->conversation,
+                1,
+                1
+            );
+            if ($conversation->N > 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     /**
      * @param $groups array of Group *objects*
      * @param $recipients array of profile *ids*