Permalink
Browse files

message MDL-26119 now logs when a user sends a message

  • Loading branch information...
1 parent eef3578 commit 88c9987e8909d345e72c31a93cbfda61005a3cc5 @andyjdavis andyjdavis committed Feb 2, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 message/index.php
View
8 message/index.php
@@ -158,7 +158,13 @@
$messageid = message_post_message($user1, $user2, $data->message, FORMAT_MOODLE, 'direct');
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);
}
}
}

0 comments on commit 88c9987

Please sign in to comment.