message-history #2

Closed
hippoz wants to merge 3 commits from message-history into master
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 02665902ff - Show all commits

View file

@ -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 (token) this.token = token;
if (this.token) token = this.token; if (this.token) token = this.token;

View file

@ -18,6 +18,7 @@ const wsCloseCodes = {
NOT_AUTHORIZED: [4006, "Not authorized"], NOT_AUTHORIZED: [4006, "Not authorized"],
FLOODING: [4007, "Flooding"], FLOODING: [4007, "Flooding"],
NO_PING: [4008, "No ping"], NO_PING: [4008, "No ping"],
UNSUPPORTED_ATTRIBUTE: [4009, "Unsupported attribute."],
}; };
const cancelReconnectionForCodes = [ const cancelReconnectionForCodes = [
wsCloseCodes.NOT_AUTHENTICATED[0], wsCloseCodes.NOT_AUTHENTICATED[0],
@ -25,6 +26,7 @@ const cancelReconnectionForCodes = [
wsCloseCodes.SERVER_DENIED_CONNECTION[0], wsCloseCodes.SERVER_DENIED_CONNECTION[0],
wsCloseCodes.TOO_MANY_SESSIONS[0], wsCloseCodes.TOO_MANY_SESSIONS[0],
wsCloseCodes.FLOODING[0], wsCloseCodes.FLOODING[0],
wsCloseCodes.UNSUPPORTED_ATTRIBUTE[0],
]; ];
globalGatewayConnection.onopen = (sessionData) => { globalGatewayConnection.onopen = (sessionData) => {
@ -86,6 +88,4 @@ globalGatewayConnection.onclose = function(code) {
}, 5000); }, 5000);
}; };
window.___gateway = globalGatewayConnection;
export default globalGatewayConnection; export default globalGatewayConnection;