diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 67c47263..3aae164a 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -417,7 +417,7 @@ var RoomSubList = React.createClass({ if (this.props.incomingCall) { var self = this; // Check if the incoming call is for this section - var incomingCallRoom = this.state.sortedList.filter(function(room) { + var incomingCallRoom = this.props.list.filter(function(room) { return self.props.incomingCall.roomId === room.roomId; }); @@ -507,7 +507,7 @@ var RoomSubList = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + self.props.tagName + " to room" + err); Modal.createDialog(ErrorDialog, { - title: "Error", + title: "Error", description: "Failed to add tag " + self.props.tagName + " to room", }); }); diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index e3640f77..db416b8a 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -62,19 +62,24 @@ module.exports = React.createClass({ }, onRedactClick: function() { - MatrixClientPeg.get().redactEvent( - this.props.mxEvent.getRoomId(), this.props.mxEvent.getId() - ).done(function() { - // message should disappear by itself - }, function(e) { - var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - // display error message stating you couldn't delete this. - var code = e.errcode || e.statusCode; - Modal.createDialog(ErrorDialog, { - title: "Error", - description: "You cannot delete this message. (" + code + ")" - }); - }); + const ConfirmRedactDialog = sdk.getComponent("dialogs.ConfirmRedactDialog"); + Modal.createDialog(ConfirmRedactDialog, { + onFinished: (proceed) => { + if (!proceed) return; + + MatrixClientPeg.get().redactEvent( + this.props.mxEvent.getRoomId(), this.props.mxEvent.getId() + ).catch(function(e) { + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + // display error message stating you couldn't delete this. + var code = e.errcode || e.statusCode; + Modal.createDialog(ErrorDialog, { + title: "Error", + description: "You cannot delete this message. (" + code + ")" + }); + }).done(); + }, + }, 'mx_Dialog_confirmredact'); if (this.props.onFinished) this.props.onFinished(); }, @@ -121,7 +126,7 @@ module.exports = React.createClass({ ); } - if (!eventStatus) { // sent + if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted redactButton = (
Redact diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index 0998194e..289121f1 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -24,7 +24,7 @@ import sdk from 'matrix-react-sdk'; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import dis from 'matrix-react-sdk/lib/dispatcher'; import DMRoomMap from 'matrix-react-sdk/lib/utils/DMRoomMap'; -import Rooms from 'matrix-react-sdk/lib/Rooms'; +import * as Rooms from 'matrix-react-sdk/lib/Rooms'; import * as RoomNotifs from 'matrix-react-sdk/lib/RoomNotifs'; import Modal from 'matrix-react-sdk/lib/Modal'; diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index 4a0c1663..42730aca 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -23,6 +23,8 @@ var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var DateUtils = require('matrix-react-sdk/lib/DateUtils'); var filesize = require('filesize'); var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); +const Modal = require('matrix-react-sdk/lib/Modal'); +const sdk = require('matrix-react-sdk'); module.exports = React.createClass({ displayName: 'ImageView', @@ -62,19 +64,23 @@ module.exports = React.createClass({ }, onRedactClick: function() { - var self = this; - MatrixClientPeg.get().redactEvent( - this.props.mxEvent.getRoomId(), this.props.mxEvent.getId() - ).done(function() { - if (self.props.onFinished) self.props.onFinished(); - }, function(e) { - var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - // display error message stating you couldn't delete this. - var code = e.errcode || e.statusCode; - Modal.createDialog(ErrorDialog, { - title: "Error", - description: "You cannot delete this image. (" + code + ")" - }); + const ConfirmRedactDialog = sdk.getComponent("dialogs.ConfirmRedactDialog"); + Modal.createDialog(ConfirmRedactDialog, { + onFinished: (proceed) => { + if (!proceed) return; + var self = this; + MatrixClientPeg.get().redactEvent( + this.props.mxEvent.getRoomId(), this.props.mxEvent.getId() + ).catch(function(e) { + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + // display error message stating you couldn't delete this. + var code = e.errcode || e.statusCode; + Modal.createDialog(ErrorDialog, { + title: "Error", + description: "You cannot delete this image. (" + code + ")" + }); + }).done(); + } }); }, diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss b/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss index f241d2c5..0926a11a 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss @@ -130,14 +130,13 @@ limitations under the License. color: $event-notsent-color; } -.mx_EventTile_redacted { - padding-top: 0px; -} - -.mx_EventTile_redacted .mx_EventTile_line, -.mx_EventTile_redacted:hover .mx_EventTile_line, -.mx_EventTile_redacted.menu .mx_EventTile_line { - background-color: $primary-fg-color; +.mx_EventTile_redacted .mx_EventTile_line .mx_UnknownBody { + display: block; + width: 100%; + max-width: 300px; + height: 24px; + border-radius: 4px; + background-color: black; } .mx_EventTile_highlight,