Files
doneit-web/src/app/services/socket/rocket-chat-client.service.ts
T

46 lines
1005 B
TypeScript
Raw Normal View History

2022-01-07 09:03:15 +01:00
import { Injectable } from '@angular/core';
import { SocketInterfaceService } from './interface/socket-interface.service'
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class RocketChatClientService {
private SocketInterfaceService = new SocketInterfaceService()
constructor() {
const url = environment.apiChatUrl.replace('https','wss')
// this.SocketInterfaceService.connect(url);
}
login(user) {
const loginRequest = {
msg: "method",
method: "login",
id: "42",
params: [
{
"user": { "username": user.username },
"password": {
"digest": user.password,
"algorithm":"sha-256"
}
}
]
}
// this.SocketInterfaceService.send(loginRequest)
}
logout(){ }
send(roomId, message, option) {}
receive() {}
joinRoom(){}
deleteMessage() {}
}
window['RocketChatClientService'] = new RocketChatClientService();