]> git.mxchange.org Git - friendica.git/blobdiff - object/Conversation.php
Merge branch 'threaded_items' of github.com:CyberDomovoy/friendica into threaded_items
[friendica.git] / object / Conversation.php
index 634a09397234c0dd6769c1f6818255a626274a2f..b9b0cb74c200af24d35ec01c95252183dcd7542d 100644 (file)
@@ -91,6 +91,18 @@ class Conversation extends BaseObject {
                        logger('[WARN] Conversation::add_thread : Thread already exists ('. $item->get_id() .').', LOGGER_DEBUG);
                        return false;
                }
+
+               /*
+                * Only add will be displayed
+                */
+               if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid')) {
+                       logger('[WARN] Conversation::add_thread : Thread is a mail ('. $item->get_id() .').', LOGGER_DEBUG);
+                       return false;
+               }
+               if($item->get_data_value('verb') === ACTIVITY_LIKE || $item->get_data_value('verb') === ACTIVITY_DISLIKE) {
+                       logger('[WARN] Conversation::add_thread : Thread is a (dis)like ('. $item->get_id() .').', LOGGER_DEBUG);
+                       return false;
+               }
                $item->set_conversation($this);
                $this->threads[] = $item;
                return end($this->threads);
@@ -105,13 +117,13 @@ class Conversation extends BaseObject {
         *              _ The data requested on success
         *              _ false on failure
         */
-       public function get_template_data($cmnt_tpl, $alike, $dlike) {
+       public function get_template_data($alike, $dlike) {
                $result = array();
 
                foreach($this->threads as $item) {
                        if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid'))
                                continue;
-                       $item_data = $item->get_template_data($cmnt_tpl, $alike, $dlike);
+                       $item_data = $item->get_template_data($alike, $dlike);
                        if(!$item_data) {
                                logger('[ERROR] Conversation::get_template_data : Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG);
                                return false;