While the thread starter (and me too) would like to prevent students from sending messages to other students, but ok to send messages to teachers.
So to be clear, the messaging system is designed to allow users to send messages to pretty much anyone. Every year I have enabled it, my teenage students go insane trolling each other with the system. Disabling it is a must. That's a shame since it's a great way to notify students, and keep a record of what was sent rather than dealing with email and forums.
So I'm working on the core hacks to Moodle 3.5 restrict student message to just between the teacher and the students. Moodle developers definitely have moved classes around in the Message folder which is why the old 3.0 hacks do not work anymore.
If you are a student:
- Searching for contacts only pulls up teachers and administrators accounts.
- When clicking a students profile, a student can only see the SEND MESSAGE and ADD CONTACT button if they are viewing a teacher profile.
- When you get a message from a teacher, the BLOCK CONTACT link is missing.
Let me know if there's anything I'm missing.