Add websocket feature (#3562)

* add websocket feature

* Added 2.7.0_min_version
This commit is contained in:
ctrlaltca 2019-02-06 09:08:59 +01:00 committed by Zach H
parent 073c531855
commit 46b34d6515
3 changed files with 14 additions and 8 deletions

View file

@ -86,7 +86,7 @@ var WebClient = {
resetConnectionvars : function () {
this.cmdId = 0;
this.pendingCommands = {};
this.pendingCommands = {};
},
sendCommand : function (cmd, callback)
@ -151,7 +151,7 @@ var WebClient = {
WebClient.sendSessionCommand(sc, function() {
WebClient.lastPingPending = false;
});
}, WebClient.options.keepalive);
},
@ -168,6 +168,9 @@ var WebClient = {
"feature_set",
"room_chat_history",
"client_warnings",
"websocket",
"2.6.1_min_version",
"2.7.0_min_version",
/* unimplemented features */
"forgot_password",
"idle_client",
@ -404,7 +407,7 @@ var WebClient = {
this.socket.onclose = function() {
WebClient.setStatus(StatusEnum.DISCONNECTED, 'Connection closed');
}
}
this.socket.onerror = function() {
WebClient.setStatus(StatusEnum.DISCONNECTED, 'Connection failed');
@ -412,7 +415,7 @@ var WebClient = {
this.socket.onopen = function(){
WebClient.setStatus(StatusEnum.CONNECTED, 'Connected');
}
}
this.socket.onmessage = function(event) {
//console.log("Received " + event.data.byteLength + " bytes");
@ -431,7 +434,7 @@ var WebClient = {
{
str += String.fromCharCode(uint8msg[i]);
}
console.log(str);
console.log(str);
}
return;
}
@ -456,7 +459,7 @@ var WebClient = {
WebClient.processRoomEvent(msg.roomEvent);
break;
}
}
}
},
disconnect : function() {