Skip to content

Commit e15d070

Browse files
committed
[WEBLATE] fix issues.
1 parent 83926ee commit e15d070

4 files changed

Lines changed: 29 additions & 5 deletions

File tree

‎src/components/views/context_menus/MessageContextMenu.js‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,31 @@ module.exports = React.createClass({
4040
onFinished: React.PropTypes.func,
4141
},
4242

43+
getInitialState: function() {
44+
return {
45+
canRedact: false,
46+
};
47+
},
48+
49+
componentWillMount: function() {
50+
MatrixClientPeg.get().on('RoomMember.powerLevel', this._checkCanRedact);
51+
this._checkCanRedact();
52+
},
53+
54+
componentWillUnmount: function() {
55+
const cli = MatrixClientPeg.get();
56+
if (cli) {
57+
cli.removeListener('RoomMember.powerLevel', this._checkCanRedact);
58+
}
59+
},
60+
61+
_checkCanRedact: function() {
62+
const cli = MatrixClientPeg.get();
63+
const room = cli.getRoom(this.props.mxEvent.getRoomId());
64+
const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId);
65+
this.setState({canRedact});
66+
},
67+
4368
onResendClick: function() {
4469
Resend.resend(this.props.mxEvent);
4570
if (this.props.onFinished) this.props.onFinished();
@@ -136,10 +161,10 @@ module.exports = React.createClass({
136161
);
137162
}
138163

139-
if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted
164+
if (this.state.canRedact) {
140165
redactButton = (
141166
<div className="mx_MessageContextMenu_field" onClick={this.onRedactClick}>
142-
{ _t('Redact') }
167+
{ _t('Remove') }
143168
</div>
144169
);
145170
}
@@ -206,7 +231,7 @@ module.exports = React.createClass({
206231
externalURLButton = (
207232
<div className="mx_MessageContextMenu_field">
208233
<a href={ this.props.mxEvent.event.content.external_url }
209-
rel="noopener" target="_blank" onClick={ this.closeMenu }>{ _t('Source URL') }</a>
234+
rel="noopener" target="_blank" onClick={ this.closeMenu }>{ _t('Source URL') }</a>
210235
</div>
211236
);
212237
}

‎src/components/views/settings/Notifications.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ module.exports = React.createClass({
178178
Modal.createDialog(TextInputDialog, {
179179
title: _t('Keywords'),
180180
description: _t('Enter keywords separated by a comma:'),
181+
button: _t('OK'),
181182
value: keywords,
182183
onFinished: function onFinished(should_leave, newValue) {
183184

‎src/i18n/strings/pt.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"Add an email address above to configure email notifications": "Adicione um endereço de email acima para configurar as notificações por email",
33
"All messages": "Todas as mensagens",
44
"All messages (loud)": "Todas as mensagens (alto)",
5-
"All notifications are currently disabled for all targets.": "Todas as notificações estão atualmente desativadas para todos os destinos",
65
"An error occurred whilst saving your email notification preferences.": "Um erro ocorreu enquanto salvava suas preferências de notificação por email.",
76
"Cancel Sending": "Cancelar o envio",
87
"Can't update user notification settings": "Não é possível atualizar as preferências de notificação",

‎src/i18n/strings/pt_BR.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"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",
33
"All messages": "Todas as mensagens",
44
"All messages (loud)": "Todas as mensagens (alto)",
5-
"All notifications are currently disabled for all targets.": "Todas as notificações estão atualmente desabilitadas para todos os destinatários.",
65
"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.",
76
"Call invitation": "Convite para chamada",
87
"Cancel Sending": "Cancelar o envio",

0 commit comments

Comments
 (0)