         invitePanel.hide()
 
   sendHipChatMessageTo: (mentionName) ->
+    if mentionName[0] isnt "@" then mentionName = ("@" + mentionName)
     hc_client = new HipChat(@hc_key)
 
-    @sessionId = "#{@app_key}-#{@app_secret}-#{randomstring.generate(11)}"
+    @generateSessionId()
 
     params =
       room: @room_id

      return unless rows.length > 1
      @pairingChannel.trigger 'client-text-select', {colour: @markerColour, rows: rows}

  receiveFriendInfo: (data) ->
    friendInfo = {colour: data.colour}
    unless _.contains(@friendColours, friendInfo.colour)
      @friendColours.push(data.colour)
    unless friendInfo.markerSeen
      @addMarker 0, data.colour
      friendInfo.markerSeen = true

  syncGrammars: ->
    @editor.on 'grammar-changed', => @sendGrammar()


      alertView = new AlertView "Please set your Pusher keys."
      atom.workspace.addModalPanel(item: alertView, visible: true)
    else
      @generateSessionId()
      @startView = new StartView(@sessionId)
      @startPanel = atom.workspace.addModalPanel(item: @startView, visible: true)
      @startView.focus()
      @startPairing()

  generateSessionId: ->
    colourIndex = _.random(0, @colours.length)
    @markerColour = @colours[colourIndex]
    @sessionId = "#{@app_key}-#{@app_secret}-#{randomstring.generate(11)}-#{colourIndex}"

  inviteOverHipChat: ->
    @getKeysFromConfig()
