MDL-60680 message_output: Change message provider defaults

Since some versions ago the app allows a good user control of notifications.
This is why we should be enabling more notifications (mostly for students) by default.
This commit is contained in:
Juan Leyva 2019-02-05 10:58:18 +01:00
parent 019004dcc7
commit c13438158b
5 changed files with 26 additions and 5 deletions

View File

@ -72,12 +72,18 @@ $messageproviders = array (
// Course request approval notification
'courserequestapproved' => array (
'capability' => 'moodle/course:request'
'capability' => 'moodle/course:request',
'defaults' => array(
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
),
// Course request rejection notification
'courserequestrejected' => array (
'capability' => 'moodle/course:request'
'capability' => 'moodle/course:request',
'defaults' => array(
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
),
// Badge award notification to a badge recipient.
@ -85,6 +91,7 @@ $messageproviders = array (
'defaults' => array(
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
'capability' => 'moodle/badges:earnbadge'
),
@ -107,6 +114,7 @@ $messageproviders = array (
'defaults' => [
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
]
),
@ -115,6 +123,7 @@ $messageproviders = array (
'defaults' => [
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
]
],

View File

@ -129,7 +129,7 @@ class message_airnotifier_external_testcase extends externallib_advanced_testcas
$expected = array(
array(
'userid' => $user1->id,
'configured' => 0
'configured' => 1
)
);
$this->assertEquals($expected, $preferences['users']);

View File

@ -26,6 +26,9 @@
$messageproviders = array (
// Ordinary single forum posts.
'posts' => array(
'defaults' => array(
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
),
// Forum digest messages.

View File

@ -27,6 +27,9 @@ $messageproviders = array (
// essay graded notification
'graded_essay' => array (
'defaults' => array(
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
)
);

View File

@ -32,12 +32,18 @@ $messageproviders = array(
// Confirm a student's quiz attempt.
'confirmation' => array(
'capability' => 'mod/quiz:emailconfirmsubmission'
'capability' => 'mod/quiz:emailconfirmsubmission',
'defaults' => array(
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
),
// Warning to the student that their quiz attempt is now overdue, if the quiz
// has a grace period.
'attempt_overdue' => array(
'capability' => 'mod/quiz:emailwarnoverdue'
'capability' => 'mod/quiz:emailwarnoverdue',
'defaults' => array(
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
),
),
);