 NewPublicChannelRoute = require './newpublicchannel'
 AllPublicChannelsRoute = require './allpublicchannels'
 PublicChannelNotificationSettingsRoute = require './publicchannelnotificationsettings'
+SingleMessageRoute = require './singlemessage'
 
 module.exports = class SingleChannelRoute
 
   constructor: ->
 
-    @path = ':channelName(/:postId)'
+    @path = ':channelName'
     @childRoutes = [
       new NewPublicChannelRoute
       new AllPublicChannelsRoute
       new PublicChannelNotificationSettingsRoute
+      new SingleMessageRoute
     ]
 
 

      done()


  onLeave: ->

    threadActions.changeSelectedThread null
    messageActions.changeSelectedMessage null


transitionToChannel = (channelName, postId, done) ->

  successFn = ({ channel }) -> changeToChannel channel, postId, done
  channel = channelByName channelName

  if channel


  onEnter: (nextState, replaceState, done) ->

    messageActions.changeSelectedMessage null

    { channelName } = nextState.params
    thread = kd.singletons.reactor.evaluate selectedChannelThread

    # if there is no channel name set on the route (/NewChannel, /Channels)
