Merge pull request #2106 from matrix-org/dbkr/chairman_mau_pt_2_message_send

Support active user limit on message send
This commit is contained in:
David Baker 2018-08-03 13:14:18 +01:00 committed by GitHub
commit bc1d359398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

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

@ -1035,6 +1035,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.",