Unverified Commit cc139910 authored by Mikael Mello's avatar Mikael Mello
Browse files

Temporary answer to commands from the client, to be changed

parent 6cd1118b
......@@ -264,7 +264,15 @@ export function login (credentials: ICredentials = {
return subscribeToCommands()
})
.then(() => {
return respondToCommands(() => {})
return respondToCommands((err, cmd) => {
console.log(cmd);
callMethod('replyClientCommand', [cmd._id, { msg: 'OK' }]);
if (cmd.msg == 'pauseSubscriptions') {
console.log(cmd);
} else if (cmd.msg == 'resumeSubscriptions') {
console.log(cmd);
}
})
})
.catch((err: Error) => {
logger.info('[login] Error:', err)
......@@ -405,7 +413,7 @@ export function respondToCommands (callback: ICallback, options: IRespondOptions
// At this point, command has passed checks and can be responded to
logger.info(`Command receive callback ID ${command._id} at ${currentReadTime}`)
logger.info(`[Incoming] ${command.u.username}: ${command.cmm}`)
logger.info(`[Incoming] ${command.u.username}: ${command.cmd.msg}`)
lastReadTime = currentReadTime
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment