MDL-63466 core_message: rename cache for last message time
authorMark Nelson <markn@moodle.com>
Wed, 10 Oct 2018 09:12:24 +0000 (17:12 +0800)
committerJake Dallimore <jake@moodle.com>
Wed, 24 Oct 2018 01:39:42 +0000 (09:39 +0800)
lang/en/cache.php
lib/db/caches.php
lib/messagelib.php
message/classes/api.php
message/classes/time_last_message_in_conversation.php [moved from message/classes/time_last_message_between_users.php with 91% similarity]

index eaef860..3a8c0b8 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_between_users'] = 'Time created for most recent message in a conversation';
+$string['cachedef_message_time_last_message_in_conversation'] = '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 aa265c6..ce6807d 100644 (file)
@@ -343,11 +343,11 @@ $definitions = array(
     ),
 
     // Caches the time of the last message in a conversation.
-    'message_time_last_message_between_users' => array(
+    'message_time_last_message_in_conversation' => array(
         'mode' => cache_store::MODE_APPLICATION,
         'simplekeys' => true, // The conversation id is used.
         'simplevalues' => true,
-        'datasource' => '\core_message\time_last_message_between_users',
+        'datasource' => '\core_message\time_last_message_in_conversation',
     ),
 
     // Caches font awesome icons.
index 66b2002..deca4e6 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_between_users');
+            $cache = cache::make('core', 'message_time_last_message_in_conversation');
             $key = \core_message\helper::get_last_message_time_created_cache_key($eventdata->convid);
             $cache->set($key, $tabledata->timecreated);
         }
index 3fe649a..58fec61 100644 (file)
@@ -654,7 +654,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_between_users');
+            $cache = \cache::make('core', 'message_time_last_message_in_conversation');
             $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_between_users implements \cache_data_source {
+class time_last_message_in_conversation implements \cache_data_source {
 
-    /** @var time_last_message_between_users the singleton instance of this class. */
+    /** @var time_last_message_in_conversation the singleton instance of this class. */
     protected static $instance = null;
 
     /**
@@ -49,7 +49,7 @@ class time_last_message_between_users 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_between_users();
+            self::$instance = new time_last_message_in_conversation();
         }
         return self::$instance;
     }