add support for unsupported attribute close code and remove SAVE_MESSAGES
This commit is contained in:
parent
918a34f882
commit
02665902ff
2 changed files with 3 additions and 3 deletions
|
@ -60,7 +60,7 @@ class GatewayConnection {
|
|||
}
|
||||
}
|
||||
|
||||
GatewayConnection.prototype.connect = function(token, attributes=["PRESENCE_UPDATES", "SAVE_MESSAGES"]) {
|
||||
GatewayConnection.prototype.connect = function(token, attributes=["PRESENCE_UPDATES"]) {
|
||||
if (token) this.token = token;
|
||||
if (this.token) token = this.token;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ const wsCloseCodes = {
|
|||
NOT_AUTHORIZED: [4006, "Not authorized"],
|
||||
FLOODING: [4007, "Flooding"],
|
||||
NO_PING: [4008, "No ping"],
|
||||
UNSUPPORTED_ATTRIBUTE: [4009, "Unsupported attribute."],
|
||||
};
|
||||
const cancelReconnectionForCodes = [
|
||||
wsCloseCodes.NOT_AUTHENTICATED[0],
|
||||
|
@ -25,6 +26,7 @@ const cancelReconnectionForCodes = [
|
|||
wsCloseCodes.SERVER_DENIED_CONNECTION[0],
|
||||
wsCloseCodes.TOO_MANY_SESSIONS[0],
|
||||
wsCloseCodes.FLOODING[0],
|
||||
wsCloseCodes.UNSUPPORTED_ATTRIBUTE[0],
|
||||
];
|
||||
|
||||
globalGatewayConnection.onopen = (sessionData) => {
|
||||
|
@ -86,6 +88,4 @@ globalGatewayConnection.onclose = function(code) {
|
|||
}, 5000);
|
||||
};
|
||||
|
||||
window.___gateway = globalGatewayConnection;
|
||||
|
||||
export default globalGatewayConnection;
|
||||
|
|
Loading…
Reference in a new issue