Merge branch 'develop' into matthew/dharma

This commit is contained in:
Matthew Hodgson 2018-08-03 17:15:00 -07:00
commit 4fbf34e05b
15 changed files with 213 additions and 6983 deletions

View file

@ -98,6 +98,7 @@ const LoggedInView = React.createClass({
this._setStateFromSessionStore();
this._matrixClient.on("accountData", this.onAccountData);
this._matrixClient.on("sync", this.onSync);
},
componentWillUnmount: function() {
@ -142,6 +143,20 @@ const LoggedInView = React.createClass({
}
},
onSync: function(syncState, oldSyncState, data) {
if (syncState === oldSyncState) return;
if (syncState === 'ERROR') {
this.setState({
syncErrorData: data,
});
} else {
this.setState({
syncErrorData: null,
});
}
},
_onKeyDown: function(ev) {
/*
// Remove this for now as ctrl+alt = alt-gr so this breaks keyboards which rely on alt-gr for numbers
@ -259,15 +274,15 @@ const LoggedInView = React.createClass({
// When the panels are disabled, clicking on them results in a mouse event
// which bubbles to certain elements in the tree. When this happens, close
// any settings page that is currently open (user/room/group).
if (this.props.leftDisabled &&
this.props.rightDisabled &&
(
ev.target.className === 'mx_MatrixChat' ||
ev.target.className === 'mx_MatrixChat_middlePanel' ||
ev.target.className === 'mx_RoomView'
)
) {
dis.dispatch({ action: 'close_settings' });
if (this.props.leftDisabled && this.props.rightDisabled) {
const targetClasses = new Set(ev.target.className.split(' '));
if (
targetClasses.has('mx_MatrixChat') ||
targetClasses.has('mx_MatrixChat_middlePanel') ||
targetClasses.has('mx_RoomView')
) {
dis.dispatch({ action: 'close_settings' });
}
}
},
@ -286,6 +301,7 @@ const LoggedInView = React.createClass({
const NewVersionBar = sdk.getComponent('globals.NewVersionBar');
const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar');
const PasswordNagBar = sdk.getComponent('globals.PasswordNagBar');
const ServerLimitBar = sdk.getComponent('globals.ServerLimitBar');
let page_element;
let right_panel = '';
@ -370,7 +386,9 @@ const LoggedInView = React.createClass({
let topBar;
const isGuest = this.props.matrixClient.isGuest();
if (this.props.showCookieBar &&
if (this.state.syncErrorData && this.state.syncErrorData.error.errcode === 'M_MAU_LIMIT_EXCEEDED') {
topBar = <ServerLimitBar />;
} else if (this.props.showCookieBar &&
this.props.config.piwik
) {
const policyUrl = this.props.config.piwik.policyUrl || null;

View file

@ -309,10 +309,14 @@ module.exports = React.createClass({
);
} else {
let consentError = null;
let mauError = null;
for (const m of unsentMessages) {
if (m.error && m.error.errcode === 'M_CONSENT_NOT_GIVEN') {
consentError = m.error;
break;
} else if (m.error && m.error.errcode === 'M_MAU_LIMIT_EXCEEDED') {
mauError = m.error;
break;
}
}
if (consentError) {
@ -327,6 +331,8 @@ module.exports = React.createClass({
</a>,
},
);
} else if (mauError) {
title = _t("Your message wasnt sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.");
} else if (
unsentMessages.length === 1 &&
unsentMessages[0].error &&

View file

@ -121,6 +121,15 @@ module.exports = React.createClass({
const usingEmail = username.indexOf("@") > 0;
if (error.httpStatus === 400 && usingEmail) {
errorText = _t('This Home Server does not support login using email address.');
} else if (error.errcode == 'M_MAU_LIMIT_EXCEEDED') {
errorText = (
<div>
<div>{ _t('This homeserver has hit its Monthly Active User limit') }</div>
<div className="mx_Login_smallError">
{ _t('Please contact your service administrator to continue using this service.') }
</div>
</div>
);
} else if (error.httpStatus === 401 || error.httpStatus === 403) {
if (SdkConfig.get()['disable_custom_urls']) {
errorText = (

View file

@ -164,7 +164,12 @@ module.exports = React.createClass({
if (!success) {
let msg = response.message || response.toString();
// can we give a better error message?
if (response.required_stages && response.required_stages.indexOf('m.login.msisdn') > -1) {
if (response.errcode == 'M_MAU_LIMIT_EXCEEDED') {
msg = <div>
<p>{_t("This homeserver has hit its Monthly Active User limit")}</p>
<p>{_t("Please contact your service administrator to continue using this service.")}</p>
</div>;
} else if (response.required_stages && response.required_stages.indexOf('m.login.msisdn') > -1) {
let msisdnAvailable = false;
for (const flow of response.available_flows) {
msisdnAvailable |= flow.stages.indexOf('m.login.msisdn') > -1;

View file

@ -0,0 +1,31 @@
/*
Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import React from 'react';
import { _t } from '../../../languageHandler';
export default React.createClass({
render: function() {
const toolbarClasses = "mx_MatrixToolbar mx_MatrixToolbar_error";
return (
<div className={toolbarClasses}>
<div className="mx_MatrixToolbar_content">
{ _t("This homeserver has hit its Monthly Active User limit. Please contact your service administrator to continue using the service.") }
</div>
</div>
);
},
});

View file

@ -33,12 +33,6 @@
"VoIP is unsupported": "VoIP is unsupported",
"You cannot place VoIP calls in this browser.": "You cannot place VoIP calls in this browser.",
"You cannot place a call with yourself.": "You cannot place a call with yourself.",
"Conference calls are not supported in encrypted rooms": "Conference calls are not supported in encrypted rooms",
"Conference calls are not supported in this client": "Conference calls are not supported in this client",
"Warning!": "Warning!",
"Conference calling is in development and may not be reliable.": "Conference calling is in development and may not be reliable.",
"Failed to set up conference call": "Failed to set up conference call",
"Conference call failed.": "Conference call failed.",
"Could not connect to the integration server": "Could not connect to the integration server",
"A conference call could not be started because the intgrations server is not available": "A conference call could not be started because the intgrations server is not available",
"Call in Progress": "Call in Progress",
@ -211,7 +205,6 @@
"Authentication check failed: incorrect password?": "Authentication check failed: incorrect password?",
"Failed to join room": "Failed to join room",
"Message Pinning": "Message Pinning",
"Jitsi Conference Calling": "Jitsi Conference Calling",
"Disable Emoji suggestions while typing": "Disable Emoji suggestions while typing",
"Use compact timeline layout": "Use compact timeline layout",
"Hide removed messages": "Hide removed messages",
@ -271,6 +264,7 @@
"No display name": "No display name",
"New passwords don't match": "New passwords don't match",
"Passwords can't be empty": "Passwords can't be empty",
"Warning!": "Warning!",
"Changing password will currently reset any end-to-end encryption keys on all devices, making encrypted chat history unreadable, unless you first export your room keys and re-import them afterwards. In future this will be improved.": "Changing password will currently reset any end-to-end encryption keys on all devices, making encrypted chat history unreadable, unless you first export your room keys and re-import them afterwards. In future this will be improved.",
"Continue": "Continue",
"Export E2E room keys": "Export E2E room keys",
@ -683,6 +677,7 @@
"A new version of Riot is available.": "A new version of Riot is available.",
"To return to your account in future you need to <u>set a password</u>": "To return to your account in future you need to <u>set a password</u>",
"Set Password": "Set Password",
"This homeserver has hit its Monthly Active User limit. Please contact your service administrator to continue using the service.": "This homeserver has hit its Monthly Active User limit. Please contact your service administrator to continue using the service.",
"Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).",
"Checking for an update...": "Checking for an update...",
"No update available.": "No update available.",
@ -1041,6 +1036,7 @@
"Message not sent due to unknown devices being present": "Message not sent due to unknown devices being present",
"<showDevicesText>Show devices</showDevicesText>, <sendAnywayText>send anyway</sendAnywayText> or <cancelText>cancel</cancelText>.": "<showDevicesText>Show devices</showDevicesText>, <sendAnywayText>send anyway</sendAnywayText> or <cancelText>cancel</cancelText>.",
"You can't send any messages until you review and agree to <consentLink>our terms and conditions</consentLink>.": "You can't send any messages until you review and agree to <consentLink>our terms and conditions</consentLink>.",
"Your message wasnt sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.": "Your message wasnt sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.",
"%(count)s of your messages have not been sent.|other": "Some of your messages have not been sent.",
"%(count)s of your messages have not been sent.|one": "Your message was not sent.",
"%(count)s <resendText>Resend all</resendText> or <cancelText>cancel all</cancelText> now. You can also select individual messages to resend or cancel.|other": "<resendText>Resend all</resendText> or <cancelText>cancel all</cancelText> now. You can also select individual messages to resend or cancel.",
@ -1158,6 +1154,8 @@
"Send Reset Email": "Send Reset Email",
"Create an account": "Create an account",
"This Home Server does not support login using email address.": "This Home Server does not support login using email address.",
"This homeserver has hit its Monthly Active User limit": "This homeserver has hit its Monthly Active User limit",
"Please contact your service administrator to continue using this service.": "Please contact your service administrator to continue using this service.",
"Incorrect username and/or password.": "Incorrect username and/or password.",
"Please note you are logging into the %(hs)s server, not matrix.org.": "Please note you are logging into the %(hs)s server, not matrix.org.",
"Guest access is disabled on this Home Server.": "Guest access is disabled on this Home Server.",