Skip to content
Snippets Groups Projects
Commit 8ef654dc authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Create method to rediret to room by room id

parent 588704b9
No related branches found
No related tags found
No related merge requests found
......@@ -110,3 +110,17 @@ FlowRouter.route '/direct/:username',
openRoom 'd', params.username
triggersExit: [roomExit]
FlowRouter.goToRoomById = (roomId) ->
subscription = ChatSubscription.findOne({rid: roomId})
if subscription?
switch subscription.t
when 'c'
FlowRouter.go 'channel', {name: subscription.name}
when 'p'
FlowRouter.go 'group', {name: subscription.name}
when 'd'
FlowRouter.go 'direct', {username: subscription.name}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment