312 Commits

Author SHA1 Message Date
Andrew Nicols
15d331c058
MDL-63670 core_message: Tests should not use another testcase as base 2024-06-27 08:55:33 +08:00
Huong Nguyen
83b9f0e29d MDL-81428 core: Display the correct status for the contact request 2024-06-10 17:08:22 +07:00
Andrew Nicols
e4a8ed5cc2
MDL-81144 core: Convert standard_after_main_region_html to hook 2024-04-02 10:23:43 +08:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Jun Pataleta
fad05d7929 Merge branch 'MDL-76583-master-withoutrename' of https://github.com/andrewnicols/moodle 2023-01-19 09:44:48 +08:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Paul Holden
0e742a2fc9 MDL-69643 message: final removal of deprecated 310 methods. 2023-01-06 09:28:40 +00:00
Mihail Geshoski
ee2d1f806d MDL-75513 message: Enable optional text display in the contact toggle 2022-11-02 17:45:52 +08:00
Neill Magill
8029023ed5 MDL-66955 messages: Improve speed of message search
The OR conditions in the WHERE clause prevented the query from
effectively filtering the messages related to the user quickly, this
change helps gets around this by allowing the database to limit
the rows in the messages table it needs to scan significantly.
2022-09-30 08:29:08 +01:00
Tim Hunt
797b9fbd62 MDL-75548 misc: final Required parameter follows optional notices 2022-08-22 15:20:13 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Neill Magill
6fb4a3b56e MDL-72948 messaging: Minimise fields used in query
Most of the fields in the query are not needed and are discarded
soon after visibility checks are made.
2022-06-22 10:11:18 +01:00
Frédéric Massart
bee1bb317e MDL-74169 core_message: Hide preferences link when permissions lacking 2022-03-21 18:37:45 +08:00
Jun Pataleta
a1b520e38c Merge branch 'MDL-73895' of https://github.com/paulholden/moodle 2022-03-11 11:17:28 +08:00
Sara Arjona
d4ebb3988a MDL-73917 message: Remove labels from notification preferences
In MDL-67853, the "Enabled" label was added to all the toggle switches in the
user notification preferences page. This string is confusing, so this issue
is to remove it (and leave it as it was in 3.11).

Apart from that, following Helen's suggestion, I've renamed "Disallowed" to
"Locked off" and "Locked" to "Locked on", in order to help users to understand
better their meaning.
2022-02-23 17:42:48 +01:00
Paul Holden
44ce37902d MDL-73895 message: hide empty component notification categories.
If a component has no available notification types (because they're
disabled), then it (the component) should be hidden entirely from
the user notification preferences page.
2022-02-16 10:31:07 +00:00
Pau Ferrer Ocaña
d74bd798b6 MDL-67853 message: Remove on/offline settings on message preferences 2022-01-27 15:22:15 +01:00
Neill Magill
a8d9b17b4b MDL-63983 messaging: Improve the performance of non-contact searches
When the messagingallusers setting is disabled only contacts that are
on the same course as the user should be returned as results.

We can reduce the number of candidate users significantly by
pre-filtering them by being enrolled on the same courses as the user
performing the search.

Since we must also return the user themselves sometimes, even when they
are not enrolled on a course I used a UNION as the most efficient way of
retriving them, this meant that the order by had to reference returned
columns by number to be sufficiently cross-database compatiable.
2021-10-28 10:56:38 +01:00
Dani Palou
1e75faeade MDL-72586 message: Use count SQL in get_unread_notification_count 2021-10-15 16:32:28 +08:00
Dani Palou
2e61125a4a MDL-72586 message: New WebService get_unread_notification_count 2021-10-04 14:40:48 +02:00
Andrew Nicols
d5e04cab9a MDL-66266 core_message: Whitespace fix 2021-08-19 09:10:18 +02:00
Andrew Nicols
c0d2f724ef Merge branch 'MDL-66266-master' of git://github.com/cescobedo/moodle 2021-08-19 09:10:18 +02:00
David Mudrák
f9ee118e94 MDL-72325 user: Use the core_user::awaiting_action() in existing places
There were existing places each doing its own checks similar to the ones
covered by the newly added core_user::awaiting_action() method. This
patch replaces those custom checks with this new API call.
2021-08-12 13:05:38 +02:00
cescobedo
4631be32eb MDL-66266 core_message: Final deprecation of 3.8 api functions
Final deprecation of:
- can_post_message
- get_individual_conversations_between_users
2021-07-22 06:31:05 +02:00
cescobedo
7a6d65eedb MDL-72139 core_message: Fix encoding UTF-8 in prevent unclosed tags 2021-07-14 07:41:00 +02:00
cescobedo
9aa5f7fe9b MDL-71919 core_message: Fix unclosed html tags in email notification 2021-07-08 23:30:35 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Ferran Recio
ce87be7db6 MDL-67782 message: fix messages max length 2021-01-12 17:14:33 +01:00
David Matamoros
c99a148628 MDL-69411 core_message: Fix return structure for empty result set
Passing a timefrom higher than last message timecreated needs to
return a formatted response so it does not break ws.
2020-11-23 19:25:09 +01:00
Simon Mok
bf17107882 MDL-68070 messaging: Fix error when personal notification is disabled 2020-10-12 19:30:02 +08:00
Mathew May
ee94aded30 MDL-63261 messaging: Final 3.6 deprecations 2020-09-07 09:10:46 +08:00
Paul Holden
809be05428 MDL-65819 message: send contact requests using recipient language. 2020-07-15 20:24:44 +01:00
Paul Holden
9965b654f8 MDL-65796 message: improve content of contact request notifications. 2020-05-13 15:40:17 +01:00
Paul Holden
df2544ee7b MDL-56389 message: allow marking notifications as read up to given time. 2020-01-23 22:16:30 +00:00
Amaia Anabitarte
23033ff48b MDL-63650 core_message: Final deprecation of mark_all_read_for_user 2019-12-20 11:52:45 +01:00
Ryan Wyllie
4060fcc662 MDL-65896 admin: add admin setting to show emoji picker
Added an admin setting to show/hide the emoji picker in messaging
because some versions of MySQL don't have full unicode support so
emojis won't save in the dabase.

If we detect that the site is running an unsupported version of MySQL
then the setting can not be enabled. Instead the admin will see a
message explaining that they will need to upgrade their database
before they can enable the emoji picker.
2019-10-23 10:59:59 +08:00
Juan Leyva
dcadc8c54c MDL-65968 notifications: Use f1 size avatars for Push notifications 2019-09-17 16:29:02 +02:00
Juan Leyva
47138d9157 MDL-66244 message: Include group sender images in payload
Android 9 notifications now displays two image icons in conversations.
The group and the sender.
2019-08-28 10:33:59 +01:00
Adrian Greeve
9f236d63e6 Merge branch 'MDL-65093_master-deprecate' of git://github.com/markn86/moodle 2019-07-29 10:43:52 +08:00
Mark Nelson
66fffdbce5 MDL-65093 core_message: dont show users with cap as blocked
It is possible that before this patch the user blocked a
teacher from messaging them, even though this would have
no effect. It is also possible for a user to block a user,
then that user gets 'promoted' to a teacher role and the
block becoming ineffective. In these cases we dont show the
user's status as blocked.
2019-07-29 10:39:57 +08:00
Mark Nelson
90403c5d9d MDL-65093 core_message: users can't block any user they want
If blocking will have no effect (ie. you are attempting to block
the admin) the 'Block' button will not be shown and instead a
message will be shown explaining why you can not block the user.
2019-07-29 10:39:57 +08:00
Mark Nelson
06d046c1ff MDL-65093 core_message: deprecate can_post_message() 2019-07-29 10:39:57 +08:00
Ryan Wyllie
6cb33ce774 MDL-65219 message: add message/pendingcontactrequests.php page back
We previously had this page when contact requests were first introduced
and unfortunately we created a bunch of notifications that reference
this URL directly which now won't work because the page has been removed.

I've added it back but set it to redirect to the message/index.php page
and load the contact requests page there.
2019-07-23 11:37:55 +08:00
Eloy Lafuente (stronk7)
e867ffd689 Merge branch 'MDL-65344_master' of git://github.com/markn86/moodle 2019-06-05 21:06:15 +02:00
Ryan Wyllie
8be24909bc MDL-65657 message: revert polling timeout back to old algorithm 2019-05-27 11:57:22 +08:00
Jake Dallimore
7918a0ea4c MDL-65566 core_message: let get_self_conversation use lazy init too 2019-05-15 18:46:41 +08:00
Jake Dallimore
510ede5698 MDL-65566 core_message: fix bug allowing duplicate unique conversations
Individual and self conversations may exist once only, so we need to
enforce this in the creation method.
2019-05-15 18:46:39 +08:00
Sara Arjona
18e5f9bef8 MDL-65566 core_message: create the self-conversation when needed
Instead of creating all the self-conversations during the upgrading,
some code has been added to the get_conversations and to the
get_conversation_counts to create it whe it doesn't exist.
2019-05-15 18:42:46 +08:00
Jake Dallimore
a0523b826e MDL-65313 core_favourites: component scoped deletion now requires itemid
This now requires itemid, which cannot be null. This is safer. The
context can still be passed in as an optional parameter.
2019-05-07 16:26:46 +08:00