                 messages = @state.messages
                 messages.push data.message
                 @setState messages: messages
+
+    showAlertAboutNewConnection: ->
+        @props.addAlert type: "info", "Someone joined the channel!"
 
 Settings = React.createClass
     mixins: [React.addons.LinkedStateMixin]


                peer.on "connection", (connection) =>
                    connection.on "open", =>
                        @connections.push connection
                        @listenForMessage connection


                    @connections.push connection
                    @listenForMessage connection

                    connection.on "open", =>
                        @showAlertAboutNewConnection()

                        connectionsWithoutNewConnection = _.filter @connections, (c) -> c.peer != connection.peer
                        peerIdsWithoutNewConnection = @connectionsToPeerIds connectionsWithoutNewConnection

