mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
46 lines
1005 B
TypeScript
46 lines
1005 B
TypeScript
|
|
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();
|