MDL-36941 core: removed 'message_working' table

This commit is contained in:
Mark Nelson
2018-03-23 12:30:29 +08:00
parent 123631ad47
commit 0d657cc9b7
7 changed files with 15 additions and 52 deletions
+3 -9
View File
@@ -169,15 +169,9 @@ class manager {
)->trigger();
}
// If messaging is disabled and they previously had forum notifications handled by the popup processor
// or any processor that puts a row in message_working then the notification will remain forever
// unread. To prevent this mark the message read if messaging is disabled.
if (empty($CFG->messaging) && $eventdata->notification) {
\core_message\api::mark_notification_as_read($savemessage);
}
// If there is no more processors that want to process this we can mark the message as read.
if ($DB->count_records('message_working', array('unreadmessageid' => $savemessage->id)) == 0) {
if (empty($CFG->messaging)) {
// If they have deselected all processors and its a notification mark it read. The user doesn't want to be bothered.
// The same goes if the messaging is completely disabled.
if ($eventdata->notification) {
$savemessage->timeread = null;
\core_message\api::mark_notification_as_read($savemessage);