MDL-60039 messaging: global search index using timeread
authorDavid Monllao <david.monllao@gmail.com>
Wed, 6 Sep 2017 11:50:53 +0000 (13:50 +0200)
committerDavid Monllao <davidm@moodle.com>
Thu, 7 Sep 2017 10:16:42 +0000 (12:16 +0200)
message/classes/search/message_received.php
message/classes/search/message_sent.php

index f57dc9f..009451f 100644 (file)
@@ -47,8 +47,8 @@ class message_received extends base_message {
         // We don't want to index messages received from noreply and support users.
         $params = array('modifiedfrom' => $modifiedfrom, 'noreplyuser' => \core_user::NOREPLY_USER,
             'supportuser' => \core_user::SUPPORT_USER);
-        return $DB->get_recordset_select('message_read', 'timecreated >= :modifiedfrom AND
-            useridto != :noreplyuser AND useridto != :supportuser', $params, 'timecreated ASC');
+        return $DB->get_recordset_select('message_read', 'timeread >= :modifiedfrom AND
+            useridto != :noreplyuser AND useridto != :supportuser', $params, 'timeread ASC');
     }
 
     /**
index f0ab8d3..07373d8 100644 (file)
@@ -46,8 +46,8 @@ class message_sent extends base_message {
         // We don't want to index messages sent by noreply and support users.
         $params = array('modifiedfrom' => $modifiedfrom, 'noreplyuser' => \core_user::NOREPLY_USER,
             'supportuser' => \core_user::SUPPORT_USER);
-        return $DB->get_recordset_select('message_read', 'timecreated >= :modifiedfrom AND
-            useridfrom != :noreplyuser AND useridfrom != :supportuser', $params, 'timecreated ASC');
+        return $DB->get_recordset_select('message_read', 'timeread >= :modifiedfrom AND
+            useridfrom != :noreplyuser AND useridfrom != :supportuser', $params, 'timeread ASC');
     }
 
     /**