Revert "MDL-63466 core_message: rename cache for last message time"
authorAndrew Nicols <andrew@nicols.co.uk>
Fri, 26 Oct 2018 06:54:01 +0000 (14:54 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 26 Oct 2018 06:54:01 +0000 (14:54 +0800)
lang/en/cache.php
lib/db/caches.php
lib/messagelib.php
message/classes/api.php
message/classes/time_last_message_between_users.php [moved from message/classes/time_last_message_in_conversation.php with 91% similarity]

index 3a8c0b8..eaef860 100644 (file)
@@ -55,7 +55,7 @@ $string['cachedef_suspended_userids'] = 'List of suspended users per course';
 $string['cachedef_groupdata'] = 'Course group information';
 $string['cachedef_htmlpurifier'] = 'HTML Purifier - cleaned content';
 $string['cachedef_langmenu'] = 'List of available languages';
-$string['cachedef_message_time_last_message_in_conversation'] = 'Time created for most recent message in a conversation';
+$string['cachedef_message_time_last_message_between_users'] = 'Time created for most recent message in a conversation';
 $string['cachedef_locking'] = 'Locking';
 $string['cachedef_message_processors_enabled'] = "Message processors enabled status";
 $string['cachedef_contextwithinsights'] = 'Context with insights';
index ce6807d..aa265c6 100644 (file)
@@ -343,11 +343,11 @@ $definitions = array(
     ),
 
     // Caches the time of the last message in a conversation.
-    'message_time_last_message_in_conversation' => array(
+    'message_time_last_message_between_users' => array(
         'mode' => cache_store::MODE_APPLICATION,
         'simplekeys' => true, // The conversation id is used.
         'simplevalues' => true,
-        'datasource' => '\core_message\time_last_message_in_conversation',
+        'datasource' => '\core_message\time_last_message_between_users',
     ),
 
     // Caches font awesome icons.
index deca4e6..66b2002 100644 (file)
@@ -294,7 +294,7 @@ function message_send(\core\message\message $eventdata) {
     if (!$eventdata->notification) {
         if (!empty($eventdata->convid)) {
             // Cache the timecreated value of the last message in this conversation.
-            $cache = cache::make('core', 'message_time_last_message_in_conversation');
+            $cache = cache::make('core', 'message_time_last_message_between_users');
             $key = \core_message\helper::get_last_message_time_created_cache_key($eventdata->convid);
             $cache->set($key, $tabledata->timecreated);
         }
index 57619cf..ee60a6b 100644 (file)
@@ -667,7 +667,7 @@ class api {
 
         if (!empty($timefrom)) {
             // Check the cache to see if we even need to do a DB query.
-            $cache = \cache::make('core', 'message_time_last_message_in_conversation');
+            $cache = \cache::make('core', 'message_time_last_message_between_users');
             $key = helper::get_last_message_time_created_cache_key($convid);
             $lastcreated = $cache->get($key);
 
@@ -35,9 +35,9 @@ defined('MOODLE_INTERNAL') || die();
  * @copyright  2016 Ryan Wyllie <ryan@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-class time_last_message_in_conversation implements \cache_data_source {
+class time_last_message_between_users implements \cache_data_source {
 
-    /** @var time_last_message_in_conversation the singleton instance of this class. */
+    /** @var time_last_message_between_users the singleton instance of this class. */
     protected static $instance = null;
 
     /**
@@ -49,7 +49,7 @@ class time_last_message_in_conversation implements \cache_data_source {
      */
     public static function get_instance_for_cache(\cache_definition $definition) {
         if (is_null(self::$instance)) {
-            self::$instance = new time_last_message_in_conversation();
+            self::$instance = new time_last_message_between_users();
         }
         return self::$instance;
     }