Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.js.SDK
Commits
cc139910
Unverified
Commit
cc139910
authored
May 31, 2018
by
Mikael Mello
Browse files
Temporary answer to commands from the client, to be changed
parent
6cd1118b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/driver.ts
View file @
cc139910
...
...
@@ -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
.
cm
m
}
`
)
logger
.
info
(
`[Incoming]
${
command
.
u
.
username
}
:
${
command
.
cm
d
.
msg
}
`
)
lastReadTime
=
currentReadTime
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment