Skip to content

Commit

Permalink
MDL-63303 message: message/index.php open conversation in message drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed Nov 15, 2018
1 parent 17d982d commit 142b042
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions message/index.php
Expand Up @@ -99,6 +99,25 @@
$settings = $PAGE->settingsnav->find('messages', null);
$settings->make_active();

if ($currentuser) {
// We're in the pprocess of deprecating this page however we haven't replaced the functionality
// for the admin (or user with correct capabilities) to view other user's conversations. For the
// time being this page will simply open the message drawer unless it's the admin user case just
// mentioned. In that case we will render the old UI for backwards compatibility.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('messages', 'message'));
$conversationid = empty($user2id) ? null : \core_message\api::get_conversation_between_users([$USER->id, $user2id]);
if (empty($conversationid)) {
$PAGE->requires->js_call_amd('core_message/message_drawer_helper', 'show');
} else {
$PAGE->requires->js_call_amd('core_message/message_drawer_helper', 'showConversation', [$conversationid]);
}
echo $OUTPUT->footer();
exit();
}

// The only time we should get here is if it's an admin type user viewing another user's messages.

// Get the renderer and the information we are going to be use.
$renderer = $PAGE->get_renderer('core_message');
$requestedconversation = false;
Expand Down

0 comments on commit 142b042

Please sign in to comment.