rewrite chat

This commit is contained in:
Peter Maquiran
2022-01-10 23:52:33 +01:00
parent 3e4067e851
commit 7a6b2a57ea
8 changed files with 69 additions and 54 deletions
+21 -1
View File
@@ -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})
});
});
}
}