diff --git a/.gitignore b/.gitignore index dcfe1c355d..b99c9f1145 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,5 @@ npm-debug.log # test reports created by karma /karma-reports -# ignore auto-generated component index +/.idea /src/component-index.js diff --git a/src/UnknownDeviceErrorHandler.js b/src/UnknownDeviceErrorHandler.js index 2aa0573e22..2b1cf23380 100644 --- a/src/UnknownDeviceErrorHandler.js +++ b/src/UnknownDeviceErrorHandler.js @@ -22,7 +22,7 @@ let isDialogOpen = false; const onAction = function(payload) { if (payload.action === 'unknown_device_error' && !isDialogOpen) { - var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog"); + const UnknownDeviceDialog = sdk.getComponent('dialogs.UnknownDeviceDialog'); isDialogOpen = true; Modal.createDialog(UnknownDeviceDialog, { devices: payload.err.devices, @@ -33,17 +33,17 @@ const onAction = function(payload) { // https://github.com/vector-im/riot-web/issues/3148 console.log('UnknownDeviceDialog closed with '+r); }, - }, "mx_Dialog_unknownDevice"); + }, 'mx_Dialog_unknownDevice'); } -} +}; let ref = null; -export function startListening () { +export function startListening() { ref = dis.register(onAction); } -export function stopListening () { +export function stopListening() { if (ref) { dis.unregister(ref); ref = null; diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index 25ca025a23..5f1aa0d32a 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -183,7 +183,7 @@ export default React.createClass({ ConferenceHandler={this.props.ConferenceHandler} scrollStateMap={this._scrollStateMap} />; - if (!this.props.collapse_rhs) right_panel = ; + if (!this.props.collapse_rhs) right_panel = ; break; case PageTypes.UserSettings: @@ -195,7 +195,7 @@ export default React.createClass({ referralBaseUrl={this.props.config.referralBaseUrl} teamToken={this.props.teamToken} />; - if (!this.props.collapse_rhs) right_panel = ; + if (!this.props.collapse_rhs) right_panel = ; break; case PageTypes.CreateRoom: @@ -203,7 +203,7 @@ export default React.createClass({ onRoomCreated={this.props.onRoomCreated} collapsedRhs={this.props.collapse_rhs} />; - if (!this.props.collapse_rhs) right_panel = ; + if (!this.props.collapse_rhs) right_panel = ; break; case PageTypes.RoomDirectory: @@ -219,12 +219,12 @@ export default React.createClass({ teamServerUrl={this.props.config.teamServerConfig.teamServerURL} teamToken={this.props.teamToken} /> - if (!this.props.collapse_rhs) right_panel = + if (!this.props.collapse_rhs) right_panel = break; case PageTypes.UserView: page_element = null; // deliberately null for now - right_panel = ; + right_panel = ; break; } @@ -253,7 +253,7 @@ export default React.createClass({
diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 4b05d746f3..d8e1f881f1 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -117,8 +117,9 @@ module.exports = React.createClass({ collapse_rhs: false, ready: false, width: 10000, - sideOpacity: 1.0, + leftOpacity: 1.0, middleOpacity: 1.0, + rightOpacity: 1.0, version: null, newVersion: null, @@ -490,12 +491,14 @@ module.exports = React.createClass({ collapse_rhs: false, }); break; - case 'ui_opacity': + case 'ui_opacity': { + const sideDefault = payload.sideOpacity >= 0.0 ? payload.sideOpacity : 1.0; this.setState({ - sideOpacity: payload.sideOpacity, - middleOpacity: payload.middleOpacity, + leftOpacity: payload.leftOpacity >= 0.0 ? payload.leftOpacity : sideDefault, + middleOpacity: payload.middleOpacity || 1.0, + rightOpacity: payload.rightOpacity >= 0.0 ? payload.rightOpacity : sideDefault, }); - break; + break; } case 'set_theme': this._onSetTheme(payload.value); break; diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 4b3b09f1fa..e939510c72 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -125,6 +125,8 @@ module.exports = React.createClass({ room: null, roomId: null, roomLoading: true, + + forwardingEvent: null, editingRoomSettings: false, uploadingRoomSettings: false, numUnreadMessages: 0, @@ -452,6 +454,11 @@ module.exports = React.createClass({ callState: callState }); + break; + case 'forward_event': + this.setState({ + forwardingEvent: payload.content, + }); break; } }, @@ -1195,7 +1202,10 @@ module.exports = React.createClass({ onCancelClick: function() { console.log("updateTint from onCancelClick"); this.updateTint(); - this.setState({editingRoomSettings: false}); + this.setState({ + editingRoomSettings: false, + forwardingEvent: null, + }); dis.dispatch({action: 'focus_composer'}); }, @@ -1473,16 +1483,17 @@ module.exports = React.createClass({ }, render: function() { - var RoomHeader = sdk.getComponent('rooms.RoomHeader'); - var MessageComposer = sdk.getComponent('rooms.MessageComposer'); - var RoomSettings = sdk.getComponent("rooms.RoomSettings"); - var AuxPanel = sdk.getComponent("rooms.AuxPanel"); - var SearchBar = sdk.getComponent("rooms.SearchBar"); - var ScrollPanel = sdk.getComponent("structures.ScrollPanel"); - var TintableSvg = sdk.getComponent("elements.TintableSvg"); - var RoomPreviewBar = sdk.getComponent("rooms.RoomPreviewBar"); - var Loader = sdk.getComponent("elements.Spinner"); - var TimelinePanel = sdk.getComponent("structures.TimelinePanel"); + const RoomHeader = sdk.getComponent('rooms.RoomHeader'); + const MessageComposer = sdk.getComponent('rooms.MessageComposer'); + const ForwardMessage = sdk.getComponent("rooms.ForwardMessage"); + const RoomSettings = sdk.getComponent("rooms.RoomSettings"); + const AuxPanel = sdk.getComponent("rooms.AuxPanel"); + const SearchBar = sdk.getComponent("rooms.SearchBar"); + const ScrollPanel = sdk.getComponent("structures.ScrollPanel"); + const TintableSvg = sdk.getComponent("elements.TintableSvg"); + const RoomPreviewBar = sdk.getComponent("rooms.RoomPreviewBar"); + const Loader = sdk.getComponent("elements.Spinner"); + const TimelinePanel = sdk.getComponent("structures.TimelinePanel"); if (!this.state.room) { if (this.state.roomLoading) { @@ -1610,17 +1621,16 @@ module.exports = React.createClass({ />; } - var aux = null; - if (this.state.editingRoomSettings) { + let aux = null; + if (this.state.forwardingEvent !== null) { + aux = ; + } else if (this.state.editingRoomSettings) { aux = ; - } - else if (this.state.uploadingRoomSettings) { + } else if (this.state.uploadingRoomSettings) { aux = ; - } - else if (this.state.searching) { + } else if (this.state.searching) { aux = ; - } - else if (!myMember || myMember.membership !== "join") { + } else if (!myMember || myMember.membership !== "join") { // We do have a room object for this room, but we're not currently in it. // We may have a 3rd party invite to it. var inviterName = undefined; @@ -1733,14 +1743,13 @@ module.exports = React.createClass({ } // console.log("ShowUrlPreview for %s is %s", this.state.room.roomId, this.state.showUrlPreview); - var messagePanel = (