Merge pull request #835 from thecodingmachine/warningMessage
FIX: fixed a error in the validation of receiveGlobalMessagePrompt in pusher/AdminController
This commit is contained in:
commit
1d69af0664
@ -40,7 +40,7 @@ export class AdminController extends BaseController{
|
|||||||
if (typeof body.text !== 'string') {
|
if (typeof body.text !== 'string') {
|
||||||
throw 'Incorrect text parameter'
|
throw 'Incorrect text parameter'
|
||||||
}
|
}
|
||||||
if (body.type !== 'warning' || body.type !== 'message') {
|
if (body.type !== 'capacity' && body.type !== 'message') {
|
||||||
throw 'Incorrect type parameter'
|
throw 'Incorrect type parameter'
|
||||||
}
|
}
|
||||||
if (!body.targets || typeof body.targets !== 'object') {
|
if (!body.targets || typeof body.targets !== 'object') {
|
||||||
@ -61,7 +61,7 @@ export class AdminController extends BaseController{
|
|||||||
roomClient.sendAdminMessageToRoom(roomMessage, (err) => {
|
roomClient.sendAdminMessageToRoom(roomMessage, (err) => {
|
||||||
err ? rej(err) : res();
|
err ? rej(err) : res();
|
||||||
});
|
});
|
||||||
} else {
|
} else if (type === 'capacity') {
|
||||||
const roomMessage = new WorldFullWarningToRoomMessage();
|
const roomMessage = new WorldFullWarningToRoomMessage();
|
||||||
roomMessage.setRoomid(roomId);
|
roomMessage.setRoomid(roomId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user