mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-63547 core_message: deprecated api::delete_conversation()
This commit is contained in:
parent
08cb8a34f9
commit
263ad98436
5 changed files with 78 additions and 4 deletions
|
@ -2588,7 +2588,10 @@ class core_message_external extends external_api {
|
|||
core_user::require_active_user($user);
|
||||
|
||||
if (\core_message\api::can_delete_conversation($user->id)) {
|
||||
$status = \core_message\api::delete_conversation($user->id, $otheruserid);
|
||||
if ($conversationid = \core_message\api::get_conversation_between_users([$userid, $otheruserid])) {
|
||||
\core_message\api::delete_conversation_by_id($user->id, $conversationid);
|
||||
}
|
||||
$status = true;
|
||||
} else {
|
||||
throw new moodle_exception('You do not have permission to delete messages');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue