prevent sending the event to the same user
parent
3bb5179619
commit
aaa89996a2
|
@ -20,13 +20,13 @@ class Client
|
||||||
if msg.cmd == 'ping'
|
if msg.cmd == 'ping'
|
||||||
@.sendPong()
|
@.sendPong()
|
||||||
else if msg.cmd == 'auth'
|
else if msg.cmd == 'auth'
|
||||||
@.auth(msg.data)
|
@.authUser(msg.data)
|
||||||
else if msg.cmd == 'subscribe'
|
else if msg.cmd == 'subscribe'
|
||||||
@.addSubscription(msg.routing_key)
|
@.addSubscription(msg.routing_key)
|
||||||
else if msg.cmd == 'unsubscribe'
|
else if msg.cmd == 'unsubscribe'
|
||||||
@.removeSubscription(msg.routing_key)
|
@.removeSubscription(msg.routing_key)
|
||||||
|
|
||||||
auth: (auth) ->
|
authUser: (auth) ->
|
||||||
if auth.token and auth.sessionId and signing.verify(auth.token)
|
if auth.token and auth.sessionId and signing.verify(auth.token)
|
||||||
@.auth = auth
|
@.auth = auth
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue