diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index e1355572..56758b2f 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -40,6 +40,31 @@ module.exports = React.createClass({ onFinished: React.PropTypes.func, }, + getInitialState: function() { + return { + canRedact: false, + }; + }, + + componentWillMount: function() { + MatrixClientPeg.get().on('RoomMember.powerLevel', this._checkCanRedact); + this._checkCanRedact(); + }, + + componentWillUnmount: function() { + const cli = MatrixClientPeg.get(); + if (cli) { + cli.removeListener('RoomMember.powerLevel', this._checkCanRedact); + } + }, + + _checkCanRedact: function() { + const cli = MatrixClientPeg.get(); + const room = cli.getRoom(this.props.mxEvent.getRoomId()); + const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId); + this.setState({canRedact}); + }, + onResendClick: function() { Resend.resend(this.props.mxEvent); if (this.props.onFinished) this.props.onFinished(); @@ -136,10 +161,10 @@ module.exports = React.createClass({ ); } - if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted + if (this.state.canRedact) { redactButton = (
- { _t('Redact') } + { _t('Remove') }
); } @@ -206,7 +231,7 @@ module.exports = React.createClass({ externalURLButton = (
{ _t('Source URL') } + rel="noopener" target="_blank" onClick={ this.closeMenu }>{ _t('Source URL') }
); } diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 11948ace..74b9c24a 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -178,6 +178,7 @@ module.exports = React.createClass({ Modal.createDialog(TextInputDialog, { title: _t('Keywords'), description: _t('Enter keywords separated by a comma:'), + button: _t('OK'), value: keywords, onFinished: function onFinished(should_leave, newValue) { diff --git a/src/i18n/strings/pt.json b/src/i18n/strings/pt.json index 44041bc8..d5548805 100644 --- a/src/i18n/strings/pt.json +++ b/src/i18n/strings/pt.json @@ -2,7 +2,6 @@ "Add an email address above to configure email notifications": "Adicione um endereço de email acima para configurar as notificações por email", "All messages": "Todas as mensagens", "All messages (loud)": "Todas as mensagens (alto)", - "All notifications are currently disabled for all targets.": "Todas as notificações estão atualmente desativadas para todos os destinos", "An error occurred whilst saving your email notification preferences.": "Um erro ocorreu enquanto salvava suas preferências de notificação por email.", "Cancel Sending": "Cancelar o envio", "Can't update user notification settings": "Não é possível atualizar as preferências de notificação", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index a4297ad9..7687d4c4 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -2,7 +2,6 @@ "Add an email address above to configure email notifications": "Insira um endereço de email no campo acima para configurar suas notificações por email", "All messages": "Todas as mensagens", "All messages (loud)": "Todas as mensagens (alto)", - "All notifications are currently disabled for all targets.": "Todas as notificações estão atualmente desabilitadas para todos os destinatários.", "An error occurred whilst saving your email notification preferences.": "Um erro ocorreu enquanto o sistema estava salvando suas preferências de notificação por email.", "Call invitation": "Convite para chamada", "Cancel Sending": "Cancelar o envio",