defaults.
At the moment, each message_provider can specify defaults for
each message output, to say whether that message output should be
used for this type of message:
http://docs.moodle.org/dev/Messaging_2.0#Adding_new_message_type.
If the message provider does not set a default, this change allows
the message output to set the default.
Static $processors should contain the full list of processors only, when
filtering is required, the $processors variable should not be updated.
Lambda function refactoring is made as well.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
The new messaging default settings can be set in messages.php and deployed
during installation. This also ensures the removing of settings on plugin
uninstallation and contains the update script to populate current default
settings on the existing system when the new feature is introduced.
For security reason we have to avoid using library functions in upgrade
function, so we set defaults the blind way. At this point we do not expect
plugins to have individual messaging defaults presets anyway. The site
defaults are the same as were set for each user using
message_set_default_message_preferences function.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
the parent send_message in messagelib.php does user/system configuration
checks before calling this method using the plugin instance.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
Existing user messaging preferences should accomodate default settings and
permissions. This also includes some changes to default outputs preferences.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
This introduces the new page where admin may change the permissions and
defaults for particular combination of message processors and providers.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
Jabber message should only be send if destination user has Jabber ID specified
in the profile. It should not use email if jabber id is not provided as it is
a performance breach.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
This introduces the new methods to the abstract class: is_system_configured
and is_user_configured that are supposed to return boolean depending whether
required configuration has been made on both system or user level
respectively. These methods return true by default and and be overriden by
being declared in the plugin class itself
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>