Fix login

This commit is contained in:
Peter Maquiran
2022-01-10 10:22:17 +01:00
parent 053e5a2370
commit 402e1f8a95
2 changed files with 20 additions and 9 deletions
@@ -34,6 +34,10 @@ class _RocketChatClientService {
if(this.hasPing == false) {
// first ping
firstPingFunx()
setTimeout(()=>{
this.getRooms()
}, 5000)
this.hasPing = true
}
}
@@ -51,11 +55,8 @@ class _RocketChatClientService {
id: requestId,
params: [
{
"user": { "username": user.username },
"password": {
"digest": user.password,
"algorithm":"sha-256"
}
user: { username: user.username },
password: user.password
}
]
}
@@ -85,13 +86,21 @@ class _RocketChatClientService {
return requestId;
}
receive() {}
subtribe() {}
joinRoom(){}
deleteMessage() {}
createRoom() {}
getRooms() {
const requestId = uuidv4()
const request = {
"msg": "method",
"method": "rooms/get",
"id": requestId,
"params": [ { "$date": 1480377601 } ]
}
this.ws.send(request, requestId)
}
@@ -116,10 +125,10 @@ class _RocketChatClientService {
// socket class ==================================================================
private socket!: WebSocket;
private wsUrl = ''
wsMsgQueue : msgQueue[] = []
private wsMsgQueue : msgQueue[] = []
private wsCallbacks: {[key: string]: wsCallbacksParams} = {}
ws = {
private ws = {
connected: false,
registerCallback:(params: wsCallbacksParams) =>{