Merge branch 'MDL-63834_master' of git://github.com/markn86/moodle

This commit is contained in:
Jun Pataleta
2018-11-13 09:35:23 +08:00
2 changed files with 17 additions and 0 deletions
+9
View File
@@ -1982,6 +1982,15 @@ class api {
global $DB;
$validtypes = [
self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL,
self::MESSAGE_CONVERSATION_TYPE_GROUP
];
if (!in_array($type, $validtypes)) {
throw new \moodle_exception('An invalid conversation type was specified.');
}
// Sanity check.
if ($type == self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL) {
if (count($userids) > 2) {