mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Add a new 'rejected' disconnect reason
This reason will be used in a future commit that will reject erroneous messages.
This commit is contained in:
parent
13252c955c
commit
45ec8326f0
3 changed files with 28 additions and 3 deletions
|
@ -63,9 +63,26 @@ var padconnectionstatus = (function()
|
|||
what: 'disconnected',
|
||||
why: msg
|
||||
};
|
||||
var k = String(msg); // known reason why
|
||||
if (!(k == 'userdup' || k == 'deleted' || k == 'looping' || k == 'slowcommit' || k == 'initsocketfail' || k == 'unauth' || k == 'rateLimited' || k == 'badChangeset' || k == 'corruptPad'))
|
||||
{
|
||||
|
||||
// These message IDs correspond to localized strings that are presented to the user. If a new
|
||||
// message ID is added here then a new div must be added to src/templates/pad.html and the
|
||||
// corresponding l10n IDs must be added to the language files in src/locales.
|
||||
const knownReasons = [
|
||||
'badChangeset',
|
||||
'corruptPad',
|
||||
'deleted',
|
||||
'disconnected',
|
||||
'initsocketfail',
|
||||
'looping',
|
||||
'rateLimited',
|
||||
'rejected',
|
||||
'slowcommit',
|
||||
'unauth',
|
||||
'userdup',
|
||||
];
|
||||
let k = String(msg);
|
||||
if (knownReasons.indexOf(k) === -1) {
|
||||
// Fall back to a generic message.
|
||||
k = 'disconnected';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue