94 Commits

Author SHA1 Message Date
Mark Nelson
ffd7798c96 MDL-56139 core: changes after peer review
- No longer use the Fibonacci sequence for delaying the timeout.
  It is too aggressive.
- The backoff_timer AMD module now expects the callback AND the
  backoff function to be passed to the constructor.
- Added ability to specify polling frequency in config.php.
- Added helper function to return the cache key.
- Reworded the parameters for clarity.
2016-11-16 10:22:52 +08:00
Ryan Wyllie
fb1469d84f MDL-56139 message: ajax poll for new messages in message area 2016-11-16 10:22:33 +08:00
Eloy Lafuente (stronk7)
a29bcf7819 MDL-47162 core_message: debug whenever courseid is missing
Instead of silently defaulting to SITEID when courseid (coming
from message_send()/\core\message\manager::send_message()) is missing,
now a debugging message is shown to allow developers to fix their
messages to, always, include courseid.

Raw creation of events via message_sent::create() missing other[courseid]
leads to coding exception since now (there shouldn't be any legacy use, as far as
they are always created via create_from_ids() when sending a message.

Updated upgrade.txt notes a little bit, added references the 3.6 final
deprecation issue (MDL-55449) and covered with unit tests.
2016-10-28 00:30:02 +02:00
Amanda Doughty
cc350fd9c8 MDL-47162 core_message: Add course id to message eventdata 2016-10-27 18:11:27 +02:00
Ryan Wyllie
3274d5ca66 MDL-54708 message: add backend APIs for notifications popover 2016-10-07 16:26:40 +08:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Ankit Agarwal
c6f45ef884 MDL-48212 messages: support the new class in message apis 2015-01-26 08:15:33 +05:30
Petr Skoda
349f98ad3e MDL-45941 implement support for message sending from DB transactions and fix other problems
This patch includes following fixes:
 - messages may be now sent when database transactions active
 - consistent return status on failure from message_send(), false is
   returned only when message not created in message(_read)? table,
   processor failure results in debugging message only and messages
   are not marked as read
 - message_sent is triggered always with id from message table
 - logic for marking messages as viewed was standardised
 - message_viewed event is triggered consistently
 - improved performance when fetching user preferences
 - full unit tests coverage for send_message() function
 - fixed multiple other smaller issues discovered by unit tests
2014-06-17 16:09:43 +12:00
Juan Leyva
5e12b369af MDL-44954 messages: Fixed save notifications with the notification flag 2014-04-07 12:19:52 +02:00
Mark Nelson
53e4c89d8e MDL-44704 core_message: always use system context when triggering a message_sent event 2014-03-20 20:35:56 -07:00
Mark Nelson
f6a4a90e70 MDL-40913 core_message: fixed triggering the 'message_sent' event when the 'noreply' address is used 2014-03-13 18:33:25 +01:00
Mark Nelson
ab1bc5d222 MDL-40913 core_message: replaced 'write' add_to_log call with an event 2014-03-07 15:15:43 -08:00
Rajesh Taneja
fd0f7ac5c2 MDL-33618 Messages: Added support to disable message provider 2013-11-21 09:40:34 +08:00
Rajesh Taneja
3bcf6b3cdd MDL-31560 Messages: Added support for noreply and support users
This is used by messaging system for sending/receiving message
to/from noreply or support user. message_send api will now use
core_user class to get noreply or support user and then
send/receive message depending on user state.
2013-09-13 16:13:26 +08:00
Petr Škoda
b0d1d941c9 MDL-40220 use new core_component::get_component_directory() 2013-07-16 22:42:37 +02:00
Petr Škoda
56da374e1e MDL-40220 use new core_component::normalize_component() 2013-07-16 22:41:00 +02:00
Andrew Davis
766fd0d92f MDL-34454 core_message: removed a deprecated function
Conflicts:

	lib/deprecatedlib.php
2013-07-09 14:11:07 +08:00
Sam Hemelryk
007bfe8b4d MDL-25290 conversion: Converted config to use MUC 2013-01-07 19:22:40 +13:00
Dan Poltawski
86ebf41545 Merge branch 'MDL-30871-master' of git://github.com/FMCorz/moodle 2012-11-20 11:47:17 +08:00
Dan Poltawski
5f7b0f2bdc MDL-30545 messaging - remove DISTINCT from union statement 2012-11-13 22:34:36 +08:00
Dan Poltawski
5c4685f0ad MDL-30545 - messagelib: use $DB->sql_concat() 2012-11-13 15:11:14 +08:00
Frederic Massart
ba4c451f53 MDL-30871 enrol: Flat file does not fail when notifications are enabled 2012-10-30 11:03:12 +08:00
Tim Hunt
2cf5ab1028 MDL-30545 messaging prefs: show all relevant message providers.
Some message providers have an associated capability. For example
the mod/quiz:emailconfirmsubmission capability. At the moment,
we only show the preferences for the capabilities that the user
has in the system context.

That does not work for the example capability above. Typically
the capability will be overridden in one quiz, to allow for
Students, and the user will have the Student role in the course
context. Therefore, this message type does not appear on the
preferences page.

This fix corrects the logic, so that all message types that are
to the current user are displayed.
2012-10-23 18:41:43 +08:00
Petr Škoda
4c9e03f0ac MDL-36031 implement message redirection for unit testing 2012-10-13 20:00:54 +02:00
Ankit Agarwal
194ab42205 MDL-34535 message: userto should use is_number instead of is_init 2012-08-14 14:41:00 +08:00
Adrian Greeve
b0c6dc1cac MDL-34465 - lib - Replacing get_context_instance with context_XXXX::instance (group 8) 2012-07-27 10:10:46 +08:00
Rajesh Taneja
f55cf492eb MDL-31031 messages: deprecated message_get_my_providers function to be removed in 2.5 2012-07-23 13:06:07 +08:00
Ruslan Kabalin
7fcd3c30fd MDL-33019: Check that message providers' plugins are enabled and exist 2012-05-23 10:47:08 +01:00
Sam Hemelryk
7c30505be8 Merge branch 'MDL-32009-master-3' of git://git.luns.net.uk/moodle 2012-05-01 13:43:07 +12:00
Ruslan Kabalin
3f9d9e2856 MDL-32009 messaging: Add message processor uninstall functionality 2012-04-30 10:34:39 +01:00
Andrew Davis
1218879656 MDL-31429 enrol: added db/messages.php for enrolment plugins and added some smarts to messaging so it won't display message settings for disabled enrolment plugins 2012-04-20 11:48:46 +07:00
David Mudrak
21cde6ac14 MDL-20438 fixing the message_send() docblock
This is not directly relevant to the issue. I just spotted it while
working on the messaging API. Consider it as a well meant Trojan horse
on this branch ;-)
2012-03-30 11:05:42 +02:00
Ruslan Kabalin
43798a4efa MDL-32026 messaging: Fix non-existing variable in the error output 2012-03-22 15:12:40 +00:00
Sam Hemelryk
75e4f98c0d MDL-30987 message: Minor phpdoc fix ups 2012-02-22 11:15:42 +13:00
Andrew Davis
6fbd60ef57 MDL-30987 message: updated phpdocs for /lib/messagelib.php and /message 2012-02-21 10:57:55 +07:00
Petr Skoda
ca8fe0b00a MDL-30948 stop messaging suspended and deleted users 2011-12-29 17:01:10 +01:00
Andrew Davis
d8aa5ec7a0 MDL-30260 message: added /message/upgrade.txt, checked calls to message_send() are supplying user.emailstop and improved message_send() to handle message requests that don't 2011-11-30 10:02:45 +08:00
Petr Skoda
50ed196e51 MDL-29670 cron cleanup and minor fixing
Auth and enrol is moved to the top because other plugin types depend on accurate user list and enrolments. Passwords and failed login messages are generated during every cron execution.  Contexts are build properly in each execution. Fixed deleting of unconfirmed users. And minor phpdocs and comments improvements.
2011-10-22 14:31:18 +02:00
Andrew Davis (andyjdavis)
bb3546f3c2 MDL-22232 messaging: added the ability to temporarily disable notifications to a particular user 2011-09-12 14:05:14 +08:00
Ruslan Kabalin
9f05a1a640 MDL-28186 messaging: Fix "Enable messagning setting" infuence on the menus
"Enable messaging system" (Site administration > Advanced features) is
supposed to control messaging between site users only, thus it should not
remove user messging preferences menu item. However, it may remove instant
messging preferences from providers list for the user.

Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-07-05 15:35:52 +01:00
Andrew Davis (andyjdavis)
be34802d23 MDL-27990 assignment: Some small modifications to the assignment notification code
AMOS BEGIN
 MOV [enableemailnotification,mod_assignment],[enablenotification,mod_assignment]
 MOV [enableemailnotification_help,mod_assignment],[enablenotification_help,mod_assignment]
AMOS END
2011-06-24 14:19:40 +08:00
Eloy Lafuente (stronk7)
269c173e81 whitespace fixes 2011-06-13 12:21:48 +02:00
Sam Hemelryk
0723dcab40 Merged branch 'MDL-26960' of git://git.luns.net.uk/moodle with changes 2011-06-13 15:06:19 +08:00
Dan Poltawski
a8134ff68b messaging: MDL-26960 Check correct users permissions
When on message profile page, the incorrect capability was checked
2011-06-09 15:18:43 +01:00
Ruslan Kabalin
8e26531519 MDL-27171 messages: add processor uninstall function
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-06-02 09:27:05 +01:00
Ruslan Kabalin
afed8d0f17 MDL-27652 messages: introduce message_update_processors
This function populates default message preferences for all existing providers
when the new message processor is added.

The change also includes update of message_set_default_message_preference to
make possible using it for particular message processor update.

install_populate_default_messaging_prefs() is no longer needed and depricted.

Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-06-01 12:02:37 +01:00
Ruslan Kabalin
298925d4d1 MDL-27171 messages: clean up pereferences on message provider removal
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-05-31 10:55:30 +01:00
Ruslan Kabalin
31afb0a437 MDL-27171 messages: recover message_update_providers backward compatibility
'return true' was removed by mistake

Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-05-31 10:05:39 +01:00
Ruslan Kabalin
e8fc7940a8 MDL-27171 messages: $defaultpreferences is an object, use isset instead.
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-05-31 09:46:22 +01:00
Dan Poltawski
b46ca3d7ae messaging: MDL-27171 - change variable with underscores 2011-05-31 09:07:38 +01:00