var React = require('react'); var MatrixClientPeg = require("../../../../src/MatrixClientPeg"); var ComponentBroker = require('../../../../src/ComponentBroker'); var MessageTile = ComponentBroker.get('molecules/MessageTile'); var RoomHeader = ComponentBroker.get('molecules/RoomHeader'); var MemberList = ComponentBroker.get('organisms/MemberList'); var MessageComposer = ComponentBroker.get('molecules/MessageComposer'); var RoomViewController = require("../../../../src/controllers/organisms/RoomView"); var Loader = require("react-loader"); module.exports = React.createClass({ displayName: 'RoomView', mixins: [RoomViewController], getMessageTiles: function() { return this.state.room.timeline.map(function(mxEv) { return (
  • ); }); }, render: function() { var myUserId = MatrixClientPeg.get().credentials.userId; if (this.state.room.currentState.members[myUserId].membership == 'invite') { if (this.state.joining) { return (
    ); } else { var inviteEvent = this.state.room.currentState.members[myUserId].events.member.event; // XXX: Leaving this intentionally basic for now because invites are about to change totally var joinErrorText = this.state.joinError ? "Failed to join room!" : ""; return (
    {inviteEvent.user_id} has invited you to a room
    {joinErrorText}
    ); } } else { return (
      {this.getMessageTiles()}
    ); } }, });