message MDLSITE-1042 prevented messages being automatically marked as read if the popup processor wasnt in use

This commit is contained in:
Andrew Davis
2010-10-07 03:59:50 +00:00
parent ee7cd81a1c
commit 5683b9e56d
+8 -4
View File
@@ -132,11 +132,15 @@ function message_send($eventdata) {
$messageid = $savemessage->id;
unset($savemessage->id);
//MDLSITE-1042 only the popup processor adds rows to message_working
//if the popup processor isnt selected messages will be marked read now and may not be seen
//For example, if the receiver has an incorrect email address configured or all processors deselected
//
//if there is no more processors that want to process this we can move message to message_read
if ( $DB->count_records('message_working', array('unreadmessageid' => $messageid)) == 0){
$DB->insert_record('message_read', $savemessage);
$DB->delete_records('message', array('id' => $messageid));
}
//if ( $DB->count_records('message_working', array('unreadmessageid' => $messageid)) == 0){
//$DB->insert_record('message_read', $savemessage);
//$DB->delete_records('message', array('id' => $messageid));
//}
}
return true;