70 Commits

Author SHA1 Message Date
Dan Poltawski
83a6b8c48c Merge branch 'MDL-58050-master-msgtrans' of git://github.com/mudrd8mz/moodle 2017-03-20 13:19:22 +00:00
David Mudrák
bb2924d018 MDL-58050 message: Commit the transaction before the early return
If there was no conversation found and the method returned early, the
active transaction was not marked as committable and the error was
reported by the request shutdown handler.

Attaching a unit test for the case just because it did not seem to be
covered. I was trying to reproduce the thrown error in the unit test but
it can't be used in this case. The shutdown handler puts the warning
directly into the error_log and it is not guaranteed where such messages
go (depending on the PHP configuration). And we do not even raise it
during the unit test execution (presumably due to noise it would
produce) anyway.
2017-02-22 13:56:02 +01:00
David Mudrák
0c44da7887 MDL-58050 message: Fix the DB transaction handling
Consumer code is not supposed to call commit_delegated_transaction()
method directly, this was incorrect usage of the delegated transactions.
2017-02-22 13:42:05 +01:00
Mark Nelson
f512355b31 MDL-57967 core_message: do not process conversations from deleted users 2017-02-16 13:01:06 +08:00
Ryan Wyllie
c9b82e402e MDL-57370 message: improve message union sql 2017-02-09 03:39:09 +00:00
Ryan Wyllie
42e2f6c0e9 MDL-57370 message: fix duplicate ids 2017-02-08 07:40:07 +00:00
Ryan Wyllie
349f426197 MDL-57370 message: remove joins from get_conversations
I have broken up the single query that was doing multiple joins on the
messaging and user tables. It no longer does any joins and will instead
query each data set individually.

This may cost more in terms of PHP processing but it will mean that
standard database tunings should be able to handle larger data sets.

For example this function was taking a long time to run on moodle.org
and was causing the MySQL join buffer to overflow.
2017-02-07 01:04:11 +00:00
David Monllao
ff8b71ef7b Merge branch 'MDL-56871_master' of git://github.com/markn86/moodle 2016-11-24 09:53:45 +08:00
Mark Nelson
cb8057531f MDL-56871 core_message: fix inconsistent online status between panels 2016-11-23 16:32:46 +08:00
Ankit Agarwal
7597ab0b99 MDL-56656 messages: Proper multilang formating in messaging pages 2016-11-22 14:51:12 +05:30
Andrew Nicols
d10ca75b8c Merge branch 'MDL-56407-master-2' of git://github.com/junpataleta/moodle 2016-11-22 09:06:09 +08:00
David Monllao
dfe7cbe4cf Merge branch 'MDL-57036_master' of git://github.com/markn86/moodle 2016-11-21 10:51:29 +08:00
Mark Nelson
f4c39cb983 MDL-57036 core_message: always show profile picture on messaging UI 2016-11-18 11:13:36 +08:00
Jun Pataleta
26dca05d02 MDL-56407 message: Indicate user is blocked in message area 2016-11-17 09:11:37 +08:00
Adrian Greeve
8151761378 MDL-56603 messaging: Add a new message link to popup.
Added a link to create a new message from the message
popup menu.
2016-11-16 14:51:17 +08:00
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
Ankit Agarwal
20ab51fdbc MDL-56409 messages: Save one db query per page load 2016-11-08 12:50:30 +05:30
Adrian Greeve
f324957724 MDL-56138 messaging: Limit course search to enrolled courses. 2016-10-31 10:52:05 +08:00
Andrew Nicols
ebc746dcc2 MDL-56090 message: Make key in union unique
This also fixes the unit test to use the correct indices.
2016-10-26 15:43:56 +08:00
David Monllao
055cc7d037 Merge branch 'MDL-56252-master' of git://github.com/ryanwyllie/moodle 2016-10-24 10:25:32 +08:00
Mark Nelson
1f64514def MDL-56090 core_message: added API unit tests 2016-10-21 16:22:03 +08:00
Ryan Wyllie
54d83992b4 MDL-56252 message: clean message text in message area
Remove the HTML tags from any message in the message area when updating
the last message on the contact otherwise the styling breaks and also
allows <script> tags to be added to the page.
2016-10-20 06:49:26 +00:00
Ryan Wyllie
f5a174f451 MDL-56411 message: dont render message area without other user
Stop the message area header and footer from being rendered if there is
no other user being messaged, otherwise notices are generated and the
messages fail to send.
2016-10-18 02:00:09 +00:00
Ryan Wyllie
703ab16475 MDL-56411 message: new message to user renders message area
When messaging a user for the first time from the message button on
their profile page the message area should still be rendered.
2016-10-14 07:13:58 +00:00
Ryan Wyllie
7d69958e6b MDL-56292 message: move popover code into output plugin 2016-10-11 14:39:23 +08:00
Ryan Wyllie
5cdebf2d7e MDL-56292 message: simplify get_popup_notifications function 2016-10-10 12:48:51 +08:00
Ryan Wyllie
dff7c82ecb MDL-56292 message: fix sql query in mark_all_read_for_user 2016-10-10 12:48:51 +08:00
Mark Nelson
de55cb1b53 MDL-56089 core_message: modified API so it is not tied to renderables
Also did some minor refactoring/tidying of the code.
2016-10-07 16:37:56 +08:00
Mark Nelson
48e8bdba13 MDL-55942 core_message: renamed the term 'people' to 'user' 2016-10-07 16:37:56 +08:00
Mark Nelson
5b0769db68 MDL-54744 core_message: deprecated functions in message/lib.php
Also -

1) Made note of the deprecation as well as the functions and
   files that were removed earlier in upgrade.txt.
2) Added new functions to api.php to replace the deprecated ones
   that were being used in unit tests.
3) Removed files that are no longer being used.
2016-10-07 16:35:25 +08:00
Ryan Wyllie
7b477f5982 MDL-55813 message: add online/offline help icons on preferences page 2016-10-07 16:26:40 +08:00
Mark Nelson
7b55aaa12e MDL-55942 core: obey the mighty CiBoT 2016-10-07 16:26:40 +08:00
Mark Nelson
79f6c36c12 MDL-55942 core_message: moved added functionality from message/lib.php 2016-10-07 16:26:40 +08:00
Mark Nelson
ebf4e53209 MDL-55814 core_message: removed 'Web' notification hack
Reverts: MDL-54698 core_message: remove 'offline' checkbox
for popup processor
2016-10-07 16:26:40 +08:00
Ryan Wyllie
99c7f0a731 MDL-55801 message: responsive styling for message app 2016-10-07 16:26:40 +08:00
Ryan Wyllie
0b19d04836 MDL-55812 message: simplify notification popover items 2016-10-07 16:26:40 +08:00
Mark Nelson
89a70ba1a5 MDL-55623 core_message: indicate who the message is from 2016-10-07 16:26:40 +08:00
Mark Nelson
0dc4a56683 MDL-55852 core_message: add properties to renderables
Also improved PHPDocs and performed minor code changes.
2016-10-07 16:26:40 +08:00
Mark Nelson
5bf0ff278a MDL-55811 core_message: ensure contact always shown 2016-10-07 16:26:40 +08:00
Mark Nelson
dd0c1403a1 MDL-55637 core_message: display icon for blocked users 2016-10-07 16:26:40 +08:00
Mark Nelson
4d1b76ee36 MDL-55638 core_message: add message when there are no contacts 2016-10-07 16:26:40 +08:00
Ryan Wyllie
c33b7d8913 MDL-54701 message: add unread message count to messages 2016-10-07 16:26:40 +08:00
Mark Nelson
065ff1b0f2 MDL-54698 core_message: remove 'offline' checkbox for popup processor 2016-10-07 16:26:40 +08:00
Ryan Wyllie
8c125526f1 MDL-54698 message: move notifications prefs into own page 2016-10-07 16:26:40 +08:00
Mark Nelson
6c3b954114 MDL-54687 core_message: mark messages as read when viewing conversation
Also -

- Highlight a conversation when there are unread messages.
- Update the number in the message menu when conversation
  containing unread messages is selected.
2016-10-07 16:26:40 +08:00
Damyon Wiese
edac7c8003 MDL-55541 messages: Always return at least a minimal record for a user
Messages allows anyone to find anyone on the site - even if they don't share any permissions
in a course. So we need to make at least their name and id discoverable.
2016-10-07 16:26:40 +08:00
Ryan Wyllie
8c250260e6 MDL-54687 message: show most recent conversation by default 2016-10-07 16:26:40 +08:00
Mark Nelson
bf58081d59 MDL-54687 core_message: return online status for messages and profile 2016-10-07 16:26:40 +08:00
Mark Nelson
cd03b8d7f2 MDL-54687 core_message: added search functionality 2016-10-07 16:26:40 +08:00