Merge pull request #835 from thecodingmachine/warningMessage

FIX: fixed a error in the validation of receiveGlobalMessagePrompt in pusher/AdminController
This commit is contained in:
Kharhamel 2021-03-24 14:37:50 +01:00 committed by GitHub
commit 1d69af0664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ export class AdminController extends BaseController{
if (typeof body.text !== 'string') {
throw 'Incorrect text parameter'
}
if (body.type !== 'warning' || body.type !== 'message') {
if (body.type !== 'capacity' && body.type !== 'message') {
throw 'Incorrect type parameter'
}
if (!body.targets || typeof body.targets !== 'object') {
@ -61,7 +61,7 @@ export class AdminController extends BaseController{
roomClient.sendAdminMessageToRoom(roomMessage, (err) => {
err ? rej(err) : res();
});
} else {
} else if (type === 'capacity') {
const roomMessage = new WorldFullWarningToRoomMessage();
roomMessage.setRoomid(roomId);