 
     else
       @channel.one 'channel:subscribed', (participantStates) =>
+        console.log "subscribed to #{@id} as peer"
         @setParticipantStates(participantStates)
         @channel.one 'welcome', ({doc, siteId, repoSnapshot}) =>
           @site = new Site(siteId)

  getClientIdToSiteIdMap: -> @doc.get('collaborationState.clientIdToSiteId')

  subscribe: (name) ->
    token = keytar.getPassword('github.com', 'github')
    channel = new WsChannel({name, @host, @port, @secure, token})
    {@clientId} = channel


      @connectDocument()
      @channel.one 'channel:subscribed', (participantStates) =>
        console.log "subscribed to #{@id} as leader"
        @setParticipantStates(participantStates)
        @listening = true
        @trigger 'started', @getParticipants()
