From e15d070e8fe4f442c159876d04595b92cfa63374 Mon Sep 17 00:00:00 2001 From: RiotTranslate Date: Tue, 30 May 2017 13:11:04 +0000 Subject: [PATCH] [WEBLATE] fix issues. --- .../views/context_menus/MessageContextMenu.js | 31 +++++++++++++++++-- .../views/settings/Notifications.js | 1 + src/i18n/strings/pt.json | 1 - src/i18n/strings/pt_BR.json | 1 - 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index e135557209..56758b2f30 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 11948acebe..74b9c24a74 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 44041bc8fc..d55488059c 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 a4297ad9d2..7687d4c4c6 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",