Skip to content

Commit

Permalink
message MDL-26119 now logs when a user sends a message
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjdavis committed Feb 3, 2011
1 parent eef3578 commit 88c9987
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion message/index.php
Expand Up @@ -158,7 +158,13 @@


$messageid = message_post_message($user1, $user2, $data->message, FORMAT_MOODLE, 'direct'); $messageid = message_post_message($user1, $user2, $data->message, FORMAT_MOODLE, 'direct');
if (!empty($messageid)) { if (!empty($messageid)) {
redirect($CFG->wwwroot . '/message/index.php?usergroup='.$usergroup.'&id='.$user2->id); //Not including message ID as the ID may change when its moved to message_read
//.'#m'.$messageid;
$returnurl = '/message/index.php?usergroup='.$usergroup.'&id='.$user2->id;

//including the id of the user sending the message in the logged URL
add_to_log(SITEID, 'message', 'write', $returnurl.'&user='.$user1->id, $user1->id);
redirect($CFG->wwwroot.$returnurl);
} }
} }
} }
Expand Down

0 comments on commit 88c9987

Please sign in to comment.