             @props.addAlert type: "danger", "Something went terribly wrong! See console."
 
         peer.on "open", (peerId) =>
+            @peerId = peer.id
+
             if isFounder
                 peerIdForFounder = peer.id
                 @setState peerIdForFounder: peerIdForFounder


    render: ->
        (Dom.ul id: "chat-messages", className: "media-list",
            displayName = null
            _.map @props.messages, (message) ->
                if displayName == message.displayName
                    isRepeated = true
                else
                    isRepeated = false
                displayName = message.displayName
                (ChatMessage content: message.content, displayName: message.displayName, email: message.email, isRepeated: isRepeated))

ChatForm = React.createClass


    sendMessage: (message) ->
        messages = @state.messages
        message.peerId = @peerId
        messages.push message
        @setState messages: messages

