mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
rewrite chat
This commit is contained in:
@@ -1,9 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RoomService } from './room.service';
|
||||
import { RocketChatClientService } from 'src/app/services/socket/rocket-chat-client.service';
|
||||
import { MessageService } from 'src/app/services/chat/message.service'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ChatService {
|
||||
|
||||
constructor() { }
|
||||
rooms: RoomService[] = []
|
||||
group = []
|
||||
|
||||
constructor(
|
||||
private RocketChatClientService: RocketChatClientService
|
||||
) {
|
||||
this.getAllRoomAndSubscribe()
|
||||
}
|
||||
|
||||
getAllRoomAndSubscribe() {
|
||||
this.RocketChatClientService.getRooms().then((rooms: any) => {
|
||||
rooms.result.update.forEach((roomData:any) => {
|
||||
const room = new RoomService(new RocketChatClientService(), new MessageService())
|
||||
room.setData({id: roomData.lastMessage.rid})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user