MDL-63168 core_message: fix failures in migrate_message_data task.
authoreWallah <info@eWallah.net>
Tue, 22 Jan 2019 14:47:14 +0000 (15:47 +0100)
committerMark Nelson <markn@moodle.com>
Wed, 23 Jan 2019 04:45:40 +0000 (12:45 +0800)
message/classes/task/migrate_message_data.php

index 53e2182..2cf5dbd 100644 (file)
@@ -236,7 +236,7 @@ class migrate_message_data extends \core\task\adhoc_task {
         }
 
         // Check if we need to mark this message as deleted for the user to.
-        if ($message->timeusertodeleted) {
+        if ($message->timeusertodeleted and ($message->useridfrom != $message->useridto)) {
             $mua = new \stdClass();
             $mua->userid = $message->useridto;
             $mua->messageid = $messageid;